Question of the Weekly Q406

By Control Engineering Staff March 21, 2007

December 26, 2006

QUESTION: Can a vision system reject cartons with incorrect bar codes?

Khalid Jamal Khayyat, Pharmaceutical Solutions Industry Ltd., Jeddah, Saudi Arabia, wants to know, ‘Is there a vision inspection system available that can read barcodes on carton labels as they move down a production packaging line, and can reject cartons that have incorrect bar codes?’

This is a classic control application using machine vision, and there have been a number of systems built to do it. With a popular application like this, your best bet is to look for a pre-packaged application from a major vision-equipment vendor, such as Cognex or Systech International. To pick the right system, however, you’ll need to supply a few details about your application.

First, how repeatable is the position of the barcode and label? At issue is where will each barcode appear in the camera’s field of view.

In some situations, the barcode is sure to appear in exactly the same spot in the field every time. If that is the case, you might be better off just mounting a conventional laser-based barcode reader. They are somewhat less expensive than vision systems because they are manufactured in very large quantities for many applications.

Vision-based barcode reading becomes more useful when it’s difficult to predict where the barcode will appear and/or what its orientation will be. At the extreme end of the spectrum are multi-camera systems used when packages are thrown willy-nilly onto the conveyor so that you don’t even know whether the barcode will show up on the top, front or side—or even bottom!

Another consideration is how clear the barcode printing is. Vision systems can read through quite amazing levels of distortion, misprinting, or damage.

Finally, think about what else you might call on the vision system to do at the same time it reads the barcode. I recall an application at the Harley Davidson Engine Plant where they started out planning to just make sure all the parts were there. As they developed the software, the design team kept thinking up little things the system could do. They ended up making more than a dozen tests, including timing chain adjustments and checking that bolts were tight. The more tests the vision system can do, the more valuable it will be to you.

Most likely, you will need an off-the-shelf system, such as the Cognex InSight product. If you start coming up with a lot of complex tasks, however, you may need the services of a competent vision-system integrator. Your equipment vendor should be able to connect you to an integrator experienced with your application if and when it becomes necessary. Most major vision-equipment vendors maintain lists of third-party system integrators having expertise in a wide range of application types. (Or use the multi-parameter search tool at www.controleng.com/integrators .)

The hard part may actually be interfacing the vision system with the rest of the packaging line. I envision a pre-packaged system consisting of the requisite camera, camera interface board, and computer. A software-development environment that includes a barcode-reader utility can walk you through engineering the application software. Plan to connect your vision system to the system controller via Ethernet to allow two-way communication as well as uploading of images and other data during maintenance and operation.

For more information about machine vision TECHNOLOGY, visit the Control Engineering website at www.controleng.com .

C.G. Masi , Control Engineering Senior Editor

December 19, 2006

QUESTION: Why do we all of a sudden hear so much about safety products for machine control?

I’m not sure that ‘all of a sudden’ is quite the right way to say it. Machine-control products vendors have, however, been rolling out safe-motion versions of their wares at an increasingly rapid clip recently.

What has changed over the past year is that efforts to harmonize machine-safety regulations between Europe and North America are bearing fruit. Specifically, the old idea that safety-related control signals should go over separate signal lines from machine control signals is being passed by. This has ushered in an era when it is possible to pass machine-safety messages over the machine-control LAN.

In the past, machine-safety signals, such as those for interlocks, manual alarm buttons, light curtains, etc., were point-to-point hard wired from the remote access point to the controller, leading to a spider web of special-purpose signal wires filling cable trays and conduits with a rainbow of color-coded conductors. Sending those signals over existing machine-control networks empties out the conduits, simplifies installation and maintenance, and reduces downtime for safety-system failures.

To carry safety related signals over the machine-control net, however, you need network-ready safety components. Take a simple emergency stop button, for example. In the old paradigm, the emergency stop button was a simple mechanically latching normally closed SPDT push button. For simplicity and robustness, all emergency stop buttons on the machine would be wired in series on a current loop. Activating any of these sensors broke the circuit, collapsing the current in the loop, stopping the entire machine, and activating the alarm.

Nobody would know what sensor raised the alarm, however, or where on the machine to look for the unsafe condition. Someone would have to physically visit every sensor and check it with a voltmeter to find the fault, clear it, and manually reset the switch before the machine could be restarted.

To gain more visibility, system integrators could, for example, break the machine into zones, with alarm buttons for each zone collected and brought back to the main control point individually. The problem with this approach was that you traded complexity for visibility.

At one end of the spectrum, you could wire all safety sensors in the whole machine together and bring them back via two leads into the control HMI. That gave maximum system simplicity, but practically no visibility.

At the other end of the spectrum, you could wire all of the safety sensors individually and bring each sensor back via one wire (using a common safety ground). This gave maximum visibility, but loaded the machine with an enormous burden of safety-related wiring.

Any compromise between these extremes provided, well, a compromise. ‘Compromise’ being defined as ‘that solution to a problem that makes everyone equally unhappy.’

The new paradigm breaks the dilemma by substituting local area network (LAN) technology for point-to-point wiring. Depending on the physical-layer network employed, as little as one conductor pair, or even a single optical fiber), to carry all the control and safety signals throughout the machine. One can, for example, supply a CANbus interface—consisting of a single pair of copper conductors—that will multiplex all the sensor and control signals running the machine as a serial stream of data packets. Packets containing sensor, control, safety, and similar information then differ only in their source and destination addresses. Crystal clear visibility for safety issues comes at a zero price as far as system complexity.

For related information about safety, visit the Control Engineering website at www.controleng.com and search on ‘safety bus.’

For additional information, visit these websites:
www.siemens.com
www.pilz.com

C.G. Masi , Control Engineering Senior Editor

December 12, 2006

QUESTION: How do RFID tags work?

A lot of folks here at the SPS/IPC/Drives Exhibition are asking that very same question. Several motion control vendors, most notably Siemens, are demonstrating how RFID tags can be used, but there’s little emphasis on how they actually work.

‘RFID’ stands for ‘radio frequency identification,’ and an RFID tag serves the same purposes that labels and barcodes have, in a limited way, served in the past. They provide archival information about objects to which they are attached. A label tells every human who sees it about the origins of the object. Barcodes perform a similar service in machine-readable form. RFID tags can do exactly the same thing, but much more.

Passive RFID tag circuits have four elements. SOURCE: Control Engineering with information from Wikipedia, private conversations

The RFID tags that get the most attention today are so-called ‘passive’ RFID tags, which include no power storage technology in the tag itself so they can only operate when powered from an outside source. That source is an RF beam from an external unit, usually called a reader . The figure shows the minimum architecture for a passive RFID tag.

Such an RFID tag includes four elements: antenna, power converter, memory, and transmitter. The antenna is a set of conductors laid down on a thin piece of flexible circuitry. The conductors’ pattern and size cause them to absorb RF energy in only a narrow band of radio frequencies. When a reader is close enough to create a sufficiently strong signal at the antenna, the tag’s power converter ‘turns on’ and provides system power for the rest of the electronics, which is built onto a tiny (usually fraction of a millimeter across) semiconductor chip mounted on the tag.

The memory contains a small amount (usually several kilobytes) of information in non-volatile form—such as a tiny EEPROM. When powered, the memory gives this information to the tag transmitter, which finally sends the information to the reader in a radio signal at the same frequency as the reader’s original signal .

To the reader, it appears that the signal it sent out bounced back in a process called ‘backscattering,’ but with additional information encoded into the return signal. The reader then decodes the returned information.

So far, this seems like a hard way to get information that is already available in an ordinary barcode. An RFID tag, however, can carry a lot more information than a barcode. With several kilobytes available, it can store all kinds of interesting information, such as a serial number for every bottle of pills, and even the final QA test results.

Of course, there has to be a way to add this information to the tag in the first place. That is done by encoding a packet of information in the reader’s radio signal. The packet would contain an access code that tells the tag that the reader has a legitimate right to download information, and the information itself.

Typically, the tag will start out blank, and just add information as provided. This makes it possible for each package to have a ‘memory’ for everything that happens to it. At the end of its life, the tag on a package of glue, for example, might record a history such as:

11/28/06@8:45:27; add 2 ml from batch 38381; test results=8432,9578,1876,…

11/29/06@13:25:18; ship from dock 6 via…

11/31/06@10:53:41; received @…

5/14/07@16:42:32; issued to…

5/15/07@9:16:38; removed 0.205 ml for project T34.495

5/15/07@9:16:51; removed 0.293 ml for project T34.495

5/15/07@9:17:05; removed 0.216 ml for project T34.495

5/15/07@12:32:28; removed 1.503 ml for project 00000000

5/15/07@13:16:42; removed 0.198 ml for project T34.495

5/15/07@13:16:55; removed 0.221 ml for project T34.495
.
.
.
Note that it looks like on 5/15/07, somebody sneaked by during lunchtime and ‘diverted’ 1.503 ml. Nobody particularly cares about 1.5 ml of epoxy glue, but they would if it were a more valuable or dangerous substance.

What makes passive RFID technology so powerful is that tags can be manufactured in quantity at pennies per tag. At that price, manufacturers can use them to tag anything they want to tag. Pill bottles, consumables packages, and just about anything with a flat surface a few centimeters across to which you can attach or embed a tag.

The fact that there’s a class called ‘passive RFID tags’ leads one to suspect that there is a class called ‘active RFID tags’ as well. Sure enough, there is. Active tags have some means of storing small amounts of electrical energy for extended periods of time. This allows the tag to do things between reader sessions. For example, a tag might include circuitry to record temperature readings periodically during shipping. Or, it could record the time, GPS location and strength of any mechanical shock over some threshold level. That way you could locate the particular baggage handler who broke your equipment.

Wouldn’t that be nice!

For more information about RFID technology, visit the Control Engineering website at www.controleng.com , or

click here

to read ‘RFID on the Production Line.’

For additional information, visit these websites:
www.siemens.com
en.wikipedia.org/wiki/RFID
www.aimglobal.org/technologies/rfid/
www.ti.com/rfid

Have something you always wanted to know, but didn’t know who to ask? Email your control-system questions to controleng@reedbusiness.com with ‘Questions’ in the subject line and question, and full contact information in the body of the email. If we use it, we’ll send you an ‘Engineer and proud of it!’ pocket protector.

C.G. Masi , Control Engineering Senior Editor

December 5, 2006

QUESTION: How can a data acquisition system be used for control?

Although some folks might argue that data acquisition (DAQ) is just a means of collecting information, veteran DAQ users (including yours truly) know that it is highly unusual to acquire data without exerting some control as well. In fact, DAQ without control is a separate sub-discipline called ‘datalogging.’

The figure below shows the block diagram for a plain-vanilla DAQ system. Generally, there is some apparatus out in the real world from which we hope to acquire data. It could be a process we want to monitor, or a product we want to test, or a scientific experiment. DAQ technology was, in fact, originally developed to aid high-energy physicists run their experiments.

The DAQ system’s front end consists of a number of sensors or transducers that each produce an electrical output based on the value of some parameter in the real-world, plus some signal-conditioning electronics that convert the electronic signal into an analog voltage signal.

‘Analog’ means the voltage value is a single-valued function of a real-world parameter the sensor is supposed to measure. It does not have to be a linear function, as long as every value of the voltage corresponds to one and only one parameter value. Typical transfer function types include linear, log, and exponential.

Data acquisition modules can be used to control systems. Source: Control Engineering

That analog voltage goes into an analog-to-digital converter (ADC) that plonks a digital code into a memory register based on the voltage value. A bus interface circuit then moves the code-now a digital ‘word’-onto the host computer’s internal bus.

In general, the ADC, memory and bus-interface circuitry come pre-packaged in a data acquisition board or module that plugs into the computer bus. In the past, DAQ circuits come on expansion boards that plugged into ISA or PCI bus backplanes. USB and FireWire have made it possible to plug DAQ modules into the host computer without using up expansion slots.

Note that nearly all DAQ systems also have a number of digital I/O lines that can move TTL-level digital signals between the real world and host computer. These lines can be configured either as input (to the DAQ system) or output (from the DAQ system) ports. It is these digital I/O lines that give the DAQ system its most rudimentary control capability. Since nearly all general-purpose DAQ boards and modules include a number of digital I/O lines, some level of control is almost always possible.

The host computer runs application software to store the incoming data permanently. Typically, the DAQ application has an HMI that may be used both for displaying results in real time and to give the user some level of control over the system producing the data. Once the Pandora’s box of digital control is open, however, nearly any level of control is possible, and most DAQ users prefer to create completely automated experimental setups.

The last such system I built, for example, ran a complete set of tests on an experimental angle-of-attack (AA) sensor set up in one of Arizona State University’s wind tunnels. The data acquired consisted of inputs from half a dozen sensors providing information about wind tunnel operating conditions, the AA sensor output signals, and the automated mechanism that set the attack angle. This last operated as a closed-loop servomotor with the host computer acting as controller and drive.

The experimenter merely typed in the experimental conditions for the run (or accepted the defaults) and hit the ‘start’ button. The DAQ system then planned the test conditions for the run and stepped through the test program, which took 15-30 minutes.

At each test step, the computer would provide the new attack angle as a set point for the closed-loop control algorithm (which ran as a subroutine). When the subroutine signaled that it reached the set point, the host recorded all sensor readings, then sent the next set point to the subroutine. Once the system finished the run, it packaged the resulting data into a Microsoft Excel spreadsheet, which it saved under a file name based on the actual test run date and starting time.

For more information about PC-based control, visit the Control Engineering website at www.controleng.com and look under Industry Channels, Information Control.

For additional information, visit these websites:
www.ni.com
www.keithley.com
www.omega.com

Have something you always wanted to know, but didn’t know who to ask? Email your control-system questions to controleng@reedbusiness.com with ‘Questions’ in the subject line and question, and full contact information in the body of the email. If we use it, we’ll send you an ‘Engineer and proud of it!’ pocket protector.

C.G. Masi , Control Engineering Senior Editor

November 28, 2006

QUESTION: What is the difference between U.S. and European pharmaceutical tracking requirements?

Control engineers need to be aware of product tracking requirements in their industries because they design the systems needed to capture the required historical data. Joseph Costa, director of marketing at Systech International, says that, in this case, it’s the difference between authentication and pedigree .

The European Union requires pharmaceutical manufacturers to provide a means of authenticating that an unopened package contains what it is supposed to contain. Costa says the appropriate technology to use is a 2-D barcode affixed to the label. Beyond the simple linear barcode we’re used to seeing on packages, which is simply a machine-readable version of the label, much more information can be encoded into a 2-D barcode.

Linear barcodes provide the information that the checkout person needs to properly ring up a sale: product ID and package size. Authentication demands additional information, such as lot number, that match that particular package to the manufacturer’s internal tracking system so that, after the product leaves the manufacturer’s shipping dock, anyone with proper access can find out when it was made, how it was tested, to whom it was shipped, etc. There are a number of reasons this might be useful. For example, should there be a product liability issue, authentication allows the manufacturer to locate the corresponding test results. If there is a problem with a particular batch, it allows a targeted recall instead of wholesale. Should product be diverted, it allows tracing the product from the manufacturer’s door to where it was diverted.

The United States, on the other hand, follows a pedigree model, and the enabling technology, Costa says, is RFID tagging. With an RFID tag, historical and tracking information can be added to the tag as the product goes from cradle to grave. In this model, the record goes with the package, making ‘chain of custody’ easier to trace. If an issue comes up at any time during the product’s existence, one may simply read the tag to find its history.

Having ways of doing things is, of course, problematical for pharmaceutical manufacturers who ship globally. A European manufacturer shipping to the U.S. has to include the RFID tag as well as the Europe-required barcode, and has to make sure the pedigree is started and maintained properly so that it meets requirements when it reaches the U.S. Similarly, a package filled in the U.S. must have the proper barcode and the manufacturer must maintain the required records to meet requirements when it reaches Europe. Such issues, however, are a normal part of doing business internationally.

Costa says that European Union regulators are looking at the pedigree model and may, if they find it to be superior, adopt it in the future. That would, of course, be good for international trade.

For more information about international business issues affecting control engineers, visit the Control Engineering website .

For additional information, visit these websites:
systech-tips.com
www.rfidupdate.com
www.authentix.com/pharma.asp
www.wbresearch.com/logipharmaeurope/full.html
www.emea.eu.int

C.G. Masi , Control Engineering Senior Editor

November 21, 2006

QUESTION: Why are there so many alternative systems of units and which is the best one to use?

The simple answer to the first part of your question is, to paraphrase the old saying: ‘Old units never die, they just fade away.’

About 15 years ago, I had custody of a historically significant antique BSA motorcycle (nobody ever ‘owns’ something like that, you only have temporary custody). Built in England during the early 1960s, all the bolts and screws used Whitworth threads. When working on the thing, it was imperative to carefully conserve all parts because they were irreplaceable. Always lubricate threads with motor oil and carefully torque them to avoid breakage, and never, ever, ever cross thread anything!

As we deal with the ongoing globalization process, it is important to remember that right now is just the latest instant of all past history. Over the millennia, civilizations have devised a wide variety of measurement standards to fit their particular cultural needs and the technologies they had available. Those systems still exist and have their own relevance and woe to those who force-fit them where they don’t belong.

The reason we have so many competing systems of units is that everyone and his cousin likes to come up with a special one that’s particularly useful for their particular field of study. So, you have oddball systems like ‘electrostatic units,’ which jigged the measurement standards to make the numeric constants in Coulomb’s Law and the Biot Savart law drop out. It seemed like a good idea at the time to the folks who thought it up, but just made trouble for everyone else. Once let loose, however, such things keep kicking around to trip up the unwary.

The so-called ‘metric system’ was invented by the French as part of the political upheaval of the French Revolution. The new order wanted to sweep away every vestige of the antiquated aristocratic culture, and one of the easiest and most obvious things to do was to drop the historical measurement units into a burlap bag along with a large rock, tie it tightly and drop it into the Seine. Later, as Francophilia gripped the international community, other countries began adopting their new metric system.

Another thing to keep in mind is the (largely ignored) fact that all complete systems of units are equivalent. Any system that contains well-defined units for length, mass and time can handle all mechanical measurements and calculations. Add a unit to bridge into electrodynamics (for SI units, it’s the Ampere), and you can handle all of physics.

The old British engineering (foot, slug, second) units work just as well as the new SI (meter, kilogram, second) units. The argument that ‘metric’ units are superior because they avoid using fractions is specious—it means nothing to anyone competent with fifth-grade math.

So, the answer the second part of your question is: ‘Whatever you are used to using is best.’

That sounds glib, but it’s not. For example, the aerospace industry was perhaps the last industry to begin embracing SI units. The reason is safety. It is vital (meaning that if you screw up, somebody dies) that the people working the technology are completely comfortable with the units they’re using.

During the 1980s an airline (which will remain unnamed) attempted to mandate using the SI system in all of its operations. A veteran pilot had to, as veteran pilots often must, make a quick decision regarding his fuel load and whether to top off the tanks. (Topping off the tanks is often a bad idea because airplanes can’t fly when full of both fuel and passengers. Adding fuel means kicking passengers off, which happened on a flight this reporter took in September 2006). Confused by having his fuel load quoted in kilograms when he thought in gallons, he made the wrong choice and ended up in a forced landing on a Canadian drag strip—while it was in use!

That is not to say that you should never change your system of units. The ideal situation would be for everyone to adopt the same units and stick to them, so the current trend toward international adoption of ISO units is a good thing. In the meantime, confusion will abound.

A final example arose when at least one of NASA’s Mars missions was lost because the aerospace engineers who provided the rocket dynamics parameters used SAE units while the astronomers provide orbital parameters in ISO units, and nobody specified the units !

The only thing that will save us is to always specify units whenever you quote a number. It is foolhardy to say that a distance is 305.78326. Is that centimeters or meters? Without the units, nobody will ever know.

For more information about measurement technology, visit the Control Engineering website .

For additional information, visit these websites:
www.nist.gov
www.ncsli.org
www.msc-conf.com

C.G. Masi , Control Engineering Senior Editor

November 14, 2006

QUESTION: What is the difference between central and distributed control systems?

The best way to visualize central vs. distributed control is to think about control loops, as shown in Figures 1 and 2. Figure 1 shows a system with four degrees of freedom having central control. Figure 2 shows a similar situation, but with distributed control.

By the way, a ‘degree of freedom’ (DOF) is any single action that a system can make. So, a robot with x, y, and z axes along with two rotational axes has five degrees of freedom. Turning on a heater to maintain a bath at a controlled temperature would not be considered another motion axis, but it would be a degree of freedom with its own control loop.

Each DOF must have its own control loop consisting of a sensor to monitor the actual state ( e.g ., position on the axis, temperature of the bath), an actuator to drive the DOF to a different state (e.g., a motor to move something along the axis, or a heater to change the temperature) and a controller that closes the loop by figuring out what the actuator should do based on what the sensor reports.

While each DOF must have its own control loop, it is theoretically possible to have additional control loops to provide additional layers of control. I’ll discuss this more later.

It’s obvious where the terms ‘central’ and ‘distributed’ come from. With central control, there is one central controller that keeps tabs on the activities of all the DOFs and closes all the control loops more or less simultaneously. With the distributed control system, there is still a central authority running an application program that determines how all the DOFs should ‘act,’ but it does not exert constant real-time control. Each DOF has its own controller to close the loop for that DOF.

For example, an environmental test chamber for exercising printed circuit boards might have a control loop to maintain its temperature at a set point, a second loop to control the current through a certain part of the circuit, and a third to control the supply voltage for the board. As a distributed control system, each loop would have a separate controller holding its sensor value at a set point. There would also be a central host computer that would provide set points for the individual loops based on some application program.

The application program might call for the temperature to change from ambient to a specific elevated temperature, then hold it for a ‘soak’ period. At the end of the soak period, the power supply might step through a number of test voltages. At each test voltage step, the current control might step through a set of values as well.
The application program might run open-loop, where the central computer applies programmed set points independent of the unit under test’s (UUT) response to the different conditions.

I say ‘might’ because it is possible to have a hybrid system where the application program varies the set points based on the UUT’s behavior. This would be a second level of control loop. Each control level has to include an active loop to make sure that the signals it sends down are appropriate for constantly varying conditions.

For more information about using control loops, visit the Control Engineering website .

See also:
www.boschrexroth-us.com
www.ab.com

C.G. Masi , Control Engineering Senior Editor

November 7, 2006

QUESTION: I’m trying to figure out the cheapest way to raise and lower horizontal mini blinds. How do I find the smallest and cheapest motor that will have enough power to raise and lower the blinds?

Of course, the cheapest way to do it is to grab the manual control built into the mini blind and pull or turn it (as the case may be) manually. Since you want to do the job using some sort of computer controlled motor, you’ve strayed from the ‘cheapest’ route already.

The next cheapest alternative is to invoke one of my favorite system-development rules: ‘Never build anything you can buy.’ (See the Tech Tip in this issue.) There are a number of companies out there that manufacture the equipment you want. To find them, type ‘mini blind controller’ into Google. I did it and got 1,380,000 entries!

Your question indicates that you really want to go the most expensive route: designing and building your own automated control system. So, let’s go through the tasks to create a system starting with a clean sheet of paper.

Your first problem is figuring out exactly what you want to accomplish. You have to be more explicit than ‘Raise and lower the blinds.’

Start by taking a page from the old newspaperman’s handbook—the so-called four Ws (which are actually four Ws and an H):

Why do you want to do this in the first place?

Who should decide what action to take?

What characteristics do the original mini blinds present?

Where can you connect the input and output signals to your computer?

How can you feed information back to complete your control loop(s)?

For news articles, we usually start with ‘who,’ but here ‘why’ takes priority. The reason you want to automate the blinds determines the control-system constraints and decision algorithm. If you want to, for example, close the blinds whenever sunlight starts falling through the window directly onto your African Violets, your control needs are different than if you want the blinds to give you a 9:00 am wakeup call on Saturday morning. It affects what sensors you need and whether you want a digital (open/close) or analog (how far to open) control. Let’s assume you want digital control to wake you up on Saturday morning at 9:00 am, but only if the Sun is shining.

The second question (who) concerns automation. Let’s assume you want the system fully automated under control of your existing home computer.

Now, we have to look at the mini blinds to see what we have to deal with. For simplicity, let’s assume the blinds open and close via a pair of cords and that pulling one raises the blind, while pulling the other lowers it.

We also have to look at your home computer to see where we can move signals in and out. Let’s assume you have already installed a data acquisition (DAQ) card with lots of analog and digital I/O ports. For input signals, you’ll need the day of the week and the time of day, both of which are available in your computer. You will also need a photosensor outside to determine whether it’s a sunny day. Finally, don’t forget limit switches to signal when the blind reaches fully open and fully closed positions.

How to feed decision information back requires you to have data-acquisition-and-control software installed on your computer. I’ll assume LabVIEW from National Instruments because that’s what I’m most familiar with. You could use any of several other packages, or even C++ with appropriate DAQ-card drivers. Use this software to write an application program that looks at all your inputs, then does a Boolean computation ( i.e ., computer is on AND the day is Saturday AND the time is 9:00 am AND the Sun is shining AND the blinds are NOT already up). If the result is yes, the computer puts out a digital bit to drive the motor in the right direction to pull on the ‘open blinds’ cord.

Don’t forget to develop a Boolean expression that tells the computer when to close the blinds, again!

‘How’ also applies to figuring out how to disable the catch mechanism that prevents the blinds from simply falling down all the time. You won’t need it anymore, and it will get in the way.

Now, we’re finally to answer your question about the motor. I’ve built more than one of these ‘pull the cords’ motorized controls and found the best way to do it is to wrap a cord around a 1/4-inch shaft and let a dc gearmotor drive it. To prevent the cord slipping on the shaft, drill a hole diametrically through the shaft at about the middle. Make the hole just large enough to accommodate the cord’s diameter and run the cord through it. Sometimes I put a drop of cyanoacrylate (super glue) in to hold the cord in the hole, but it’s really no necessary.

With the blind at half-open position, wrap a lot of cord on either side of the central hole. It makes no difference which direction you wrap the cord as long as it is the same on both sides of the central hole. As the motor turns one way, it will wrap cord on one side while unwrapping on the other. Turning the motor the other way reverses the process.

Gearmotors turn very slowly (a few RPM), but can apply large amounts of torque, and torque is what you need.

How much torque do you need? To find out, you’ll have to measure the force needed to pull the cords. I usually end up hanging weights on the cord until it starts to move. Be careful, because things move rapidly when you reach the tipping point!

Multiply the force needed to move the blind up (which is usually several times what’s needed to move it down) by the diameter of your shaft to get the minimum torque. Look for a gearmotor that will deliver at least twice the required torque. In this case, more is always better.

How do you find a gearmotor? Type ‘gearmotor’ into Google, of course! I’ve built enough of these things that I keep a Stock Drive Products catalog on hand at all times, so I often start there instead. You can get the same information from their website.

Don’t worry about finding the ‘smallest and cheapest’ motor to do the job. By the time you get to it, you’ll find the cost of the motor is nothing compared to the time and money you will already have spent.

For more information about electromechanical controls, visit the Control Engineering website .

For additional information, visit these websites:
www.ni.com
www.sdp-si.com
www.digikey.com
www.omega.com

C.G. Masi
, Control Engineering Senior Editor

October 31, 2006

QUESTION: I’m looking for a more modern way to measure changes in water level in the bottom 50 ft of a 200 ft, 18-inch stilling well. Can any of today’s non-contact level sensors do the job at this 200 ft range?

The short answer is: ‘Yes.’ The long answer is that you have several choices.

There are several technologies you can choose from that don’t rely on mechanics. Probably the top three are ultrasonic, radar, and laser ranging. All three rely on time-of-flight measurements. That is, they send out pulses that bounce off the surface you’re trying to find, and record the time for a return signal to arrive. An embedded computer does a little simple math to compute a final level-measurement result.

Ultrasonic systems use echolocation to find the surface level. The time of flight is, of course, the distance from an ultrasonic transducer near the top of the well to the water level times two (for the round trip) divided by the speed of sound, which varies with temperature in the well.

Ultrasonic level sensors require the well casing to be straight with smooth walls. Protrusions, joints or other sound-reflecting structures can confuse the measurement, especially over a distance as long as 200 feet.

Radar can take one of two forms: unguided and guided. Unguided radar works exactly the same as ultrasonic measurement, but uses radio-wave pulses instead of sound pulses. Instead of the speed of sound, the calculation uses the speed of light, which is substantially constant. (Yes, I know the speed of light is supposed to be a universal constant, but that’s in a vacuum without any gravitational fields around. Making the measurement is left as an exercise for the reader!)

The kinds of reflecting structures that confuse radar are different from those that confuse ultrasonics. A metal bar 100 feet down across the well casing probably wouldn’t bother ultrasound, but would be very bad for radar. On the other hand, a plastic well cover might not bother radar, but would cause problems for ultrasound.

Guided radar uses a wire strung between the radio transmit/receive antenna and the well bottom to keep radio power from dissipating during its travel. Guided radar, therefore, works over longer distances than unguided radar. It is also less sensitive to confusing structures along the well casing.

Laser ranging can also do an excellent job. Since the laser wavelength is much shorter than that of radio waves, laser level sensing has all guided radar’s advantages without the disadvantages of having to string a wire down the well shaft. There may, however, be difficulty getting a good reflection from the water surface, especially if there are ripples.

Note that, with any of these devices, you don’t need to traverse the entire well depth. If you know that your level will never reach higher than, say, 125 feet from the well head, you could mount the transducer/antenna/laser 100 feet down. That means you’re measurement range need only be 25-100 feet. Doing so improves your signal-to-noise ratio for better accuracy and reliability. This tactic likely will allow you to use a less expensive unit as well.

One of the leading vendors of level-measuring equipment is Ktek. They can be especially helpful because their product line includes all of these level-sensing technologies, as well as mechanical and electromechanical systems. Their website ( www.ktekcorp.com ) is a good place to start.

For more information about level sensing and control, visit the Control Engineering website at www.controleng.com .

For additional information, visit these websites:
www.ktekcorp.com
sensors-transducers.globalspec.com/ProductFinder/Sensors_Transducers_Detectors/Level_Sensing
www.sti.com/level-sensors.htm

C.G. Masi , Control Engineering Senior Editor

October 24, 2006

QUESTION: We are using a transducer to maintain 0.03Mbar negative pressure in a furnace through a suction-side control damper, but fluctuations are very high. Furnace pressure is even going positive! What’s wrong and what can I do about it?

Your system conforms to Figure 1. Air enters the furnace through the inlet, fills the furnace volume, exits through the damper valve and is forcefully ejected back to atmosphere by the scavenging pump.

The schematic at the bottom of Figure 1 shows an electronic analog of the flow through the system. The first resistor ( Z 1 ) represents the flow impedance of the inlet fitting. The capacitor represents the tank volume. The second resistor ( Z 2 ) represents the variable impedance of the damper. Finally, the battery represents the scavenging pump.

Theoretically, the ratio of impedances sets the pressure in the tank in the same way that the ratio of resistors sets the voltage level across the capacitor. The system gains pressure control by modifying the damper impedance. Raising the impedance (by closing the damper) slows the flow rate and raises the absolute tank pressure (less vacuum pressure). Lowering that impedance (opening the damper) lowers the absolute pressure (more vacuum).

We asked the folks at pressure-transducer manufacturer Inficon about your problem. Vacuum Control Technical Support Engineer Amy Rice said: ‘The damper in this case is used to maintain a very slight negative pressure of 0.03mbar, which is hardly anything. [It’s] not really vacuum at all, more like a draft.’

The 0.03 mbar set point (SP) pressure corresponds to the energy density in air (at sea level in a standard atmosphere) moving at about 2.23 m/sec This is called the ram effect—a ram or stagnation pressure associated with moving air is proportional to the square of the air speed. The 2.23 m/sec associated with your pressure is a gentle breeze and could easily appear in your furnace with the flow-through system you describe.

Suddenly closing the damper after establishing airflow at that speed would raise the furnace pressure by that amount. This effect would account for your positive gauge pressure excursions: the pressure in the furnace has to rise above atmospheric pressure to counteract the momentum of the air already moving through the furnace. How long it takes for the airflow to respond depends on the furnace size and shape, and how rigid the walls are.

How strong pressure surge will be depends mainly on how rapidly the damper closes. Faster control response leads to higher pressure surges.

Of course, the control system responds to the pressure spike by wanting to open the damper, causing the pressure to spike the other way. The system enters an oscillation mode that will produce a loud rumbling sound that will vary in volume, but not pitch. Fluctuations of 0.03 mbar correspond to sound volume in the neighborhood of 103 dB, which is somewhere between the noise a circular saw generates (100 dB) and a medium-loud rock concert (110 dB).

The cure is to lower the control-loop gain (less damper response for a given pressure change) or add a low-pass filter to slow the control loop’s response

Amy, however, thinks you might have the opposite problem: ‘It [sounds] like… the response time of the controller is too long, or there is a large overshoot when correcting for sudden changes. I’m assuming from the information given that the pressure, after time, does return to the SP pressure.’

If this problem appears in your system, every change in the operating point—from a power surge at the pump to someone walking by the inlet—will be followed by a series of surges that start out large and then die out.

Your best choice is to incorporate a proportional-integral-derivative (PID) controller. How PID controllers work is beyond the scope of this article. Suffice it to say that they provide all the adjustments you need to tune the system to your application. Tuning requires finding the happy medium between a fast, jittery control system that oscillates, and a slow, lethargic system that struggles to keep up.

For more detail on PID controllers, visit the Control Engineering .

For additional information, visit:
physics.mtsu.edu/~wmr/log_3.htm
www.indiana.edu/~emusic/etext/acoustics/chapter1_amplitude4.shtml

Source: — C.G. Masi , Control Engineering Senior Editor

October 17, 2006

QUESTION: Are transducers, sensors, and transmitters really the same thing?

Pretty much.

The term transducer is often encountered. In strict terms, a transducer is a device that converts one physical quantity into another, in which the second is an analog representation of the first. A thermocouple is a transducer that converts temperature to an electrical potential. It is more common, however, to use the term sensor for the actual measurement device (i.e. the primary sensor), and use transducer for the entire measuring system local to the plant (including local signal processing). However, there are no strict rules, and in many cases the terms sensor and transducer are used interchangeably. The word transmitter is also often used to mean transmitter or sensor.

Source: Parr, E.A., Industrial Control Handbook, Butterworth-Heinemann Ltd., an imprint of Reed Elsevier, Oxford, U.K., 1995, p. 2.

October 10, 2006

QUESTION: How can I read a 120 V ac motor’s ON/OFF status into TTL?

This is actually harder than it might seem at first. There are two approaches: klunky and sophisticated. Which you use depends on what status information you want and how handy you are with a soldering iron.

Let’s start with the klunky approach. If all you really need to know is whether you’re motor is being energized or not, drop a single-pole/single-throw (SPST) 120 V ac relay across its power input terminals. The relay contacts will stay closed as long as the motor has power. To convert this to a TTL-level signal, connect one side of the switch to +5 V dc and the other to your TLL input. You’ll see 5 V when the motor’s on and zero when it’s off.

The problem is that the circuit tells you nothing about the motor itself. Is it actually running? Is the rotor locked? Is it shorted? Is it burned out? The way to answer these questions is to look at the current through the motor.

Figure 1 shows a more sophisticated solution. This circuit senses current through a very small resistor in series with the motor and measures the voltage drop across the resistor. This has been the standard way to sense current since the early 1800s. It works for any ac or dc current of nearly any size.

Size the resistor to get a 4-5 Vac drop at the motor’s rated current. This gives you an order-unity V ac differential input signal proportional to the motor’s current draw.

The next step is to run this signal through a full-wave bridge rectifier followed by a capacitive input filter with a time constant longer than 0.1 sec. (10

Put the filter’s output across the inputs of any appropriate operational amplifier set up as a differential amplifier with unity gain. Connect the positive voltage output to the amplifier’s plus input. This will give you a single-ended output voltage that is zero when the ac drop across the sensor is less than about 1 V ac and about 4 V dc when the motor draws rated current.

The problem is that your differential input signal sits on top of a 120 V ac common-mode voltage, which could be a problem for the op-amp. The first choice is to connect both differential leads to the shunt resistor through the biggest pair of blocking capacitors you can find. The larger these components’ capacitance, the less they will affect the measurements. Make sure they have at least 200 V working voltage, since the peak voltage for 120 V ac is 170 V. Alternatively, you can use an op-amp with isolated differential inputs or one that can stand off better than 200 V common mode. In either case, you need to have the op-amp output referenced to chassis (Earth) ground.

Now, you want a second op amp to create a Schmidt trigger that will give you TTL high when the motor draws less than a certain current, and TTL low otherwise. Assuming you have used op-amps running on 5 V dc power, use a divided-feedback op-amp circuit with a gain of a few hundred to 1,000. If your op-amp’s output ‘rail’ (maximum output voltage) is higher than 5 V, use a zener diode to limit it. Reference the op-amp’s minus input to the center tap of a linear-taper potentiometer wired between +5 V and ground.

Op-amp circuits tend to behave erratically with gains greater than 1,000. With gains much less than 100, the trigger will be sloppy. So, keep the gain well above 100 and below 1,000.

Using a potentiometer allows you to adjust the trigger’s set point in the field. With the motor in normal operation, adjust the potentiometer until the signal just switches between high and low. Then, turn it about half way between that setting and the potentiometer’s high-side limit. Now you have a signal that is low when the motor draws no current (either because it isn’t energized or because it has failed open), and high when drawing current (either normal operation or in some high-current failure mode).

If you thought that was fun, you can get even fancier. For example, you could follow the second op-amp with a third set up as an inverter, which would give you an alarm. If you bias the original circuit so that it only comes on when the current draw exceeds the typical current, it will warn you of an overload condition. Finally, you could set up three op-amp circuits connected in parallel to the filter’s output to give you separate TTL indicators for low-current (motor failed open or no power), normal-operation, and high-current (motor overloaded or shorted).

Of course, many readers will note that an even more sophisticated solution is to use a Hall-effect sensor to measure the magnetic field produced by the current through the motor. But, that’s a subject for another time.

For more detail on designing op-amp circuits, visit www.allaboutcircuits.com .

October 3, 2006

QUESTION: What is spread spectrum?

Spread spectrum refers to wireless communication scheme that spreads the energy content of a radio signal over a wide portion of the radio spectrum, unlike conventional radio communication, which concentrates the transmitted waves into a narrow frequency range. Spreading energy out in this way avoids interfering with other spectrum users, and prevents surreptitious spying on your data communications.

Conventional narrow band radio transmission sends out a continuous stream of radio waves at a specific carrier frequency. This carrier, by itself, contains no information. Adding information is called ‘modulation’ and the most common modulation method for data is frequency shift keying (FSK), where you shift the frequency up to represent a 1 and down to represent a 0. The higher the carrier frequency, the more rapidly you can shift the frequency up and down and the higher the maximum data rate.

Interference appears whenever two users try to send data at or near the same carrier frequency. Avoid interference by dividing the radio spectrum into narrow frequency bands called channels, and assigning each to a different user. The maximum number of users a frequency band can accommodate equals the band’s width divided by the width of each channel.

The problem is that the maximum data rate depends on the bandwidth in each channel—faster data rates require wider channels. So, the more users you try to accommodate, the slower the data must go.

Another problem is that somebody has to sort out who can use what channel and make sure they keep to their assigned channel. That means FCC licensing of transmitters and so forth. It also means when the user assigned to a certain channel isn’t sending data, that bandwidth goes to waste.

A third problem is that anyone with a receiver can listen in on anyone else’s data transmission by tuning into the carrier frequency in use.

Spread spectrum avoids the whole problem by sharing the entire band among all users simultaneously. The simplest spread spectrum scheme to visualize is frequency hopping. The transmitter breaks the data stream into small packets (as short as one bit), and sends each packet out as a burst of radio waves in a certain channel. It sends the next packet out as a burst in another channel. Each time it sends out a burst, it hops to another channel.

To a narrow-band receiver, spread spectrum traffic is indistinguishable from random noise. Because the transmitter power is spread over a wide frequency band, very little power appears in any given channel, and interference between users is negligible.

To receive the data, the receiver has to know the sequence of channels the transmitter is going to use. The hopping sequence, therefore, acts as a code to make spying virtually impossible. Since there are a large number of channels available, the number of hopping sequences is vast, as is the number of users the band can accommodate simultaneously.

Control engineers care about spread spectrum because the technology makes wireless communication of control and data signals practical. With wireless data and control, an HMI can move onto a handheld device, such as a PDA or palmtop computer, freeing the humans who tend the machines from bulky, fixed HMIs. (A maintenance technician can be at one end of a large machine observing its operation while the main HMI display is out of sight.

That’s just one, limited example. For another, Siemens demonstrated a remote HMI system at IMTS 2006 that parallels the main machine HMI. It was set up so that users could select which HMI (local or remote) had control of the machine, while both displayed machine status and activity. The link between the remote HMI and the machine went over Ethernet. Engineers there also showed how the system could work wirelessly using the same IEEE 802.11 (WiFi) network you use to get your email at an Internet cafe! WiFi uses spread spectrum technology.

For more on wireless from Control Engineering , see ‘ Measure More…Without Wires .’