Recent Posts
- What microprocessors are favored for control applications? (Reprise again!)
- What are medium voltage drives?
- Is Eclipse similar to LabView?
- How long have batteries been around?
- What kinds of non-volatile RAM are there?
- How does Flash memory work?
- How does a buck regulator work?
- What microprocessors are favored for control applications (reprise)?
- What microprocessors are favored for control applications?
- What do semiconductor engineers mean by “critical dimension?”
Recent Comments
- John Schott, CAP, PE on What microprocessors are favored for control applications?
- Paul J. on What do semiconductor engineers mean by “critical dimension?”
- Tran Manh Ho on What are top-down and bottom-up design methods?
- GCB on Would highway automation work for a highway designated for automated cars only?
- Richard Mintz on Do high efficiency motors always save energy?
Most Commented On
- For a fail-safe 24 V dc auxilary supply, is it better to use 12 batteries of 2 V each, or two 12 V batteries? (3)
- How do I ensure timing in a microprocessor-based control system? (2)
- Is impedance matching as important when working with digital circuits as it is with analog circuits? (2)
- What can be done to monitor bridge structural condition? (2)
- Would highway automation work for a highway designated for automated cars only? (2)
Archives
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
Blog
How do I ensure timing in a microprocessor-based control system?
July 30, 2007
We are indebted to Carl Thompson, who is senior supervising engineer at PB Americas, Inc. for this question, the full text of which reads:
“When replacing a relay based control system with a microprocessor system, what must be taken into account to ensure that remote I/O will not pose a timing problem to the system?”
There are a couple of issues I want to bring up that you should cover before even thinking about timing. These are the sort of package you want for your system and the inputs you want to use.
Microprocessor-based systems come in a variety of form factors, such as PC-104, packaged embedded computers of various sizes and shapes, and raw motherboards (also of various sizes and shapes). What you choose depends on the space you have available and the computing power you need.
The fact that the original control system was based on relays indicates that your control algorithm relies on digital inputs. This is the time to reanalyze your control algorithm to see whether you want to bring analog values in, or whether the digital inputs the relays accept are enough.
Now, we’re ready to look at timing issues. Analog input and output channels operate on the basis of samples, and the number of samples through the channel per second determines the maximum timing error you expect. Many systems, however, multiplex one analog-to-digital convertor (ADC) to cover several analog input channels.
These are the timing issues arising from using remote I/O and a microprocessor-based system. With contemporary technology, however, you should be able to find reasonably priced equipment that will easily outpace your legacy relay system.
If you simply replace the relays with a computer, then things are even better. Digital I/O for microprocessors is blindingly fast. Even high-speed relays are slow by comparison.
To get digital data in and out of the microprocessor, you will need to configure at least two digital ports, one for input and one for output. Start by counting the number of digital inputs and the number of digital outputs. Let’s say you have 5 digital inputs and 2 digital outputs. Suppose your computer board is designed to allow configuring channels in groups of 4. You might configure the first 2 groups into one 8-bit digital input port, which gives you a single-precision (8-bit) integer. Configure the second group as digital output.
There will be 32 possible input patterns corresponding to the binary numbers 00000 through 11111, which correspond to the decimal numbers 0-31. There will be four possible output patterns corresponding to the binary numbers 00 through 11, which are 0-3 in decimal notation. The extra bits making up the single-precision words would simply be padded with zeros.
The control program would then consist of a lookup table with one column and 32 rows. The row number corresponds to the input value. The value loaded into that location corresponds to the output value. The program (in C) consists of one line:
while (flag == 1); {output = table(input);}
There will, of course, be other lines of code to define the array and set up the program’s structure, but this is the only line that will execute repeatedly.
The variable "input" refers to a buffer location carrying the current bit pattern from the digital input port, and "flag" refers to a similar buffer that signals whether the control system is running or stopped. The variable "output" refers to a buffer connected to the digital output port.
The executing statement looks at the table location pointed to by the value in input, and loads the value table(input) into the variable output. As long as the value loaded into the variable flag is 1, the statement in braces keeps executing at every program step.
Posted by Charlie Masi on July 30, 2007 | Comments (2)
In response to: How do I ensure timing in a microprocessor-based control system?
Deterministic Control commented:
Certainly to ensure timing for control systems you must isolate the processing from anything that causes uncertainty to the processing. An embedded RTOS is one way, another is to use a control device or system that is itself, independant from the PC that it communicates with. A system like ADwin which offloads all the control, I/O and signal processing to a stand-alone system does just this. ADwin localizes the I/O, signal processing and control functions in close proximity to the process itself. It provides communication back to a PC for visulaization, set-point manipulation or data storage (all the things that a PC is designed for) but isolates processing of the control algorithm from the sporadic system interrupts within Windows. The best way to ensure timing in any real-time process is to use a system that provides complete DETERMINISM.
In response to: How do I ensure timing in a microprocessor-based control system?
Paul Pan commented:
Could you recommend some handheld instruments that can easily measure and indicate room air pressure (positive or negative, and how much)?



