Monthly Archives: July 2018

What is PID Control and How Does it Work?

We use control loops all the time. For instance, it is much easier to place an object on a tabletop with your eyes open than it is with the eyes closed. The eyes provide us with visual feedback to control the hand to place the object in the required position on the tabletop without error. In the same way, modern industrial controls regulate processes as a part of a control loop. The user sends a set point request to the controller, which then compares it to a measured feedback. The difference between the two forms the error and the controller tries to eliminate the error.

PID controls also work in the above manner, but also add a bit of mathematics. In fact, PID is an acronym for Proportional, Integral, and Derivative. The three terms allow the controller to adjust the rate at which it minimizes the error.

For instance, the proportional factor introduces a constant multiple KP. Therefore, the controller moves at a constant factor from its present position to the desired set point. If the present position is far from the desired set point, the error is large, keeping the speed of approach high. As the error decreases, the speed of approach reduces. This is similar to a car running at high speed when it is far from its destination, with the speed reducing as it nears its terminus. When error reduces to a certain level, the Integral term takes over.

The integral term controls the rate of change over a given interval based on the summation of error over time. Therefore, the rate of change is no longer linear but changes in a non-linear manner. The speed of approach reduces non-linearly as the error approaches zero, and just before the controller settles, the derivative term takes over.

The derivative term controls the rate of change of the error over a given interval. In fact, it corrects the controller’s position based on the last time the positional error was checked. In reality, the three terms do not work independently as above, but concurrently. The magnitude of error defines which among them affects the controller more than the others.

All three components of the PID controller create outputs based on the measured error of the process under regulation. For a properly operating control loop, any change in error caused by a process disturbance or set point change can be quickly eliminated by the combination of the P, I, and D factors.

Sometimes PID controllers use only the proportional term. However, a proportional-only loop works with only a sizable error. When the error becomes small, the output of the controller is too low to enable corrections. Therefore, even when the control loop has reached steady state, there is still some error. The steady state error will reduce by setting a high proportional factor. However, setting a very large proportional factor, which depends on the gain of the controller, leads to repeatedly overshooting the set point, resulting in oscillations and making the loop unstable. This leads to steady state error and this is called offset.

Raspberry Pi and Automated Greenhouse

Many people set up greenhouses to grow tropical plants that need plenty of warmth and moisture. Usually these areas are enclosed in steel bracings holding glass/plastic panels that allow sunlight in and prevent moisture from going out. Greenhouse owners control the temperature by opening panels to allow ventilation. In winter, maintaining temperature could be difficult without use of heaters. Manually controlling temperature and humidity could be a tedious task taking away from the actual task of attending to the plants.

Therefore, an environment management system is an excellent way of controlling the weather within the greenhouse. Asa Wilson and his wife used a Raspberry Pi (RBPi) as the main computer for the environment management system for their greenhouse. They set up their greenhouse in Colorado on the western slope of Pike’s Peak. This place is notorious for its strong winds, while the normal growing season is very short.

As their greenhouse is rather small, measuring 10 x 12 ft., Asa uses a single temperature and relative humidity sensor. For larger greenhouses, the temperature and humidity at different locations will need to be monitored for effective control. Based on the input from the sensors, the RBPi controls the exhaust fans placed at opposite corners at the base of the greenhouse. The speed of these exhaust fans can be varied through custom speed control boards. Vents on the roof allow air to be drawn in when the exhaust fans are rotating. For air circulation, Asa uses a large oscillating fan mounted near the roof. The speed of this fan is set manually, and the RBPi can turn it on and off.

The greenhouse roof has four vents. Earlier, each vent could be opened with a single arm. However, that allowed the vents to vibrate in the wind, and they would sometimes close up. Asa designed and used vent controllers with geared motors and housed them in 3-D printed cases. The new vent controllers have two arms to hold each vent panel firmly on both sides, and this prevents any oscillations.

Initially, Asa used the RS232 protocol to let the RBPi talk to all the custom controllers. However, noise generated by the different devices caused communication issues. This led Asa to change over to RS485 drivers, which uses differential mode of communication for driving the signals. This solved the noise issue.

Although this is only a beginning, Asa is pleased with the results of his greenhouse. He is now planning for additional work. He is planning to add twenty more temperature sensors in the growing area for sensing temperature of individual plants, and a thermal controller for monitoring the sensors. He also plans to add seven water valves that will allow fine control on the humidity within the greenhouse.

Other people have also built automated greenhouses. For instance, David Dorhout has an automated watering robot that potters around carrying a 30-gallon tank for watering plants that need watering. Instrument Tek also has a similar greenhouse to Asa’s with an Arduino based system. In addition to watering and fan control, this also controls heat and communicates remotely to a computer.

What Are Field Logic Controllers?

FLC or Field Logic Controllers are standard IO blocks with the ability to perform logical operations. By attaching them to individual industrial devices, engineers allow them to execute arithmetic functions, support the use of counters and timers, and toggle bits. FLCs have the capability to create a web-based human-machine interface (HMI) as well.

Engineers use FLCs to transfer the burden of logical operations to individual devices. Therefore, they need not rely on centralized computing power such as from programmable logic controllers (PLCs).

Therefore, for some applications, engineers do use FLCs to replace PLCs. This is because FLCs can serve the logic requirements of a single device at its location just as easily as a centralized PLC can.

For instance, consider a sensor that checks if a bottle has a certain label attached to it. An FLC can easily receive the reading from the sensor, and provide the logic to send the bottle automatically for packing or for re-labeling, based on the label reading.

Devices that must operate in harsh environments can also benefit from the exclusive use of FLCs available with the IP69K rating that need no protective enclosure. On the other hand, PLCs need to be housed in enclosures for protecting their circuitry, and this often adds significant extra cost.

For example, an FLC works very well with a liquid level sensor inside a tank. By setting the ideal liquid level in a tank, an engineer can ensure the tank’s pump never runs dry, while also keeping the tank from overflowing. As the tank fills above the ideal level, the sensor sends a signal to the FLC, which in turn, turns the pump on to remove liquid. When the liquid level goes below the ideal level, the FLC turns the pump off and allows the tank to refill.

FLCs have the advantage of working together with PLCs to provide point-of-use backup. This is when the PLC fails or if communications are interrupted, the FLC performs the logical operations required for shutting down the process in a safe manner.

In addition, during normal operations, the FLC can send updates to the PLC every few microseconds, while performing logical operations at the location of the device. With this approach, engineers remove some computational load from a busy PLC. This method also avoids upgrading or replacing an expensive PLC.

For medium speed operations, such as conveyor belts, using FLCs along with PLCs can also mitigate latency issues. Although the speed of logic operations of FLCs is comparable to those of PLCs, their short response times are not yet adequate to qualify the use of FLCs for high-speed motion.

Setting up and programming an industrial PLC is exorbitantly expensive. Apart from the cost of acquiring programming talent and software, engineers setting up the PLC must also erect enclosures, electrical panels, and add extra wiring for ensuring the entire setup can handle the industrial environment.

On the other hand, engineers using FLCs are paying only for the computational power necessary for each device. The IO blocks are small enough to require minimum electrical panel work, and equally minimum additional wiring.

Nanoparticles Toggle a Window between Clear and Reflective

By applying a coating on a clear window, it has been possible to convert the window into a one-way reflective mirror. If applied correctly, the coating allows people from inside the room to see outside, but for those outside the room, the windowpanes act like mirrors, preventing them from looking in. To revert to the clear glass, it is necessary to peel off the coating. Clearly, this is not a reversible process.

A research team from the Imperial College London has now developed a process by which window panes can instantly turn reflective, or clear, as the user wishes. The material for the coating they use is made of an array of gold nanoparticles. This is different from the earlier chemical process, which, although based on nanoscopic systems that did alter the optical properties of the glass pane, was not reversible.

Using gold nanoparticles that are thousands of times smaller than the width of a single human hair, the researchers placed them in an array between two liquids that normally do not mix. On application of voltage, the nanoparticles assembled themselves into a new configuration of close dense formation. This made the surface reflective. Removal of voltage allowed the nanoparticles to drift apart, and the surface reverted to its transparent nature. The applied voltage modulated the density of the nanoparticle layer to allow or disallow light passing through the liquid layers.

According to Professor Joshua Edel, coauthor of the study, the team had achieved a really fine balance. For a long time, the applied voltage only served to form a clump of the nanoparticles as they assembled, rather than allowing them to space out evenly and accurately. The team had to build several models and conduct innumerable experiments to reach the point where they had a really tunable layer of nanoparticles.

Anthony Kucernak, a professor in the Department of Chemistry at Imperial, explains the phenomenon. The application of a specific voltage drives the nanoparticles, and they travel to an interface. The nanoparticles congregate here to form a mirror, reflecting the incident light, and not allowing it to pass through. Switching to a different voltage or removing the voltage allows the nanoparticles to move away from the interface, making the mirror transparent again.

Scientists have already been working with smart windows with the ability to adjust to sunlight falling on them. Such windows self-shade, allowing only a part of the sunlight falling on them to pass through. This helps in regulating the temperature of a building, and saving on expenditure on heating and cooling. Other developments turn windows into solar power generators, augmenting the power supply, and turning skyscrapers into potential solar farms.

The new window/mirror innovation will further advance the temperature control ability for windowpanes. However, this is not the only application for this technology. According to the research team, they can use this technology to create tunable optical filters for telescopes. This will not only help in astronomy, it will also make chemical sensors more sensitive. However, the team from Imperial College first wants to increase the response time of the nanoparticles.

Whisker Growth in Printed Circuit Boards

in whiskers are not fanciful or imaginative items, but are real and pose a serious problem for all types of electronic manufacturing. Pure tin is often used as a finish material on printed circuit boards (PCBs) to protect the exposed copper pads from tarnishing. However, pure tin spontaneously grows conductive whiskers, thin wire like growth that can form electrical paths and affect the operation of the PCB assembly.

Understanding Tin Whiskers and their Effects

First reported in the 1940s, tin whiskers are mostly invisible to the naked eye as they can be ten to hundred times thinner than a human hair. They grow to considerable lengths bridging fairly long distances between tracks and pads on the PCB. Once bridged, the whisker can short the conductors. There is no set timetable for the whiskers to commence growing. Their incubation may be fairly rapid, ranging from days, or slow, taking years.

These needle-like tin whiskers can create a short circuit between two conductors. As they are very thin, most whisker growths usually fuse or burn out when current flows through them, creating a momentary short circuit. However, in rare circumstances, rather than vanishing like a fuse link does, the whisker can form a path capable of conducting several hundred amperes. The conductive path created by whiskers generates false signals at incorrect locations, which can cause the device to operate improperly.

Sometimes, whiskers break away and fall across other traces on the PCB or between neighboring conductive components, where they can disrupt or interfere with local electrical signals. For instance, falling on MEMS, whiskers may interfere with intended mechanical functions, or diminish the transmitted light if they fall into optical systems.

As more and more electronic systems form the backbone of our manufacturing and transportation systems, our communications and financial systems, and our conventional and nuclear power plants, the problem of whisker growth in pure tin-plated electronic PCBs becomes increasingly ubiquitous.

Impact of Tin Whiskers on PCB Assembly Reliability

Manufacturers utilize tin for coating several different components used on PC board assemblies. One popular way to stabilize the tin finish is by introduction of lead. However, this method is contrary to the concept of Restriction of Hazardous Substances (RoHS), which most governments follow, as lead is a dangerous substance affecting human health. Instead of using lead, most companies now use special alloys.

Whiskers can form in different ways, some of which are:

  • From stresses on poorly formed components that do not fit together very well
  • From intermetallic formation
  • From different outside sources of stress
  • From external or internal problems causing scratches, stretching, or bending of the assembled PCB

Whiskers are not to be confused with dendrites or other such shapes in PCBs and components, as they are considerably different in both nature and function. Unless they are found and identified correctly, whiskers can pose a serious problem for a circuit board assembly. These structures of crystalline formation, whiskers most commonly occur in electroplated tin used as a finish on components and PCB traces.

The CHIP Computer Rivals the Raspberry Pi

Since the 2010s, there has been a new wave of single board computers smaller than the credit card able to perform like any major computer. Offering a range of tinkering and educational adventures, two of the most popular SBCs, the Raspberry Pi and the CHIP computer, are two unique products. While the Raspberry Pi or RBPi was the product of a UK nonprofit supporting children’s education, the Chip started as a successful Kickstarter project that raised more than two million dollars.

The RBPi family includes the RBPi 3 and the RBPi 2, the traditional models ranging in price from $20 to $40. Although simply affordable, the Chip, coming in at $9, is rather more affordable, provided you were buying them in batches for casual use or for instruction. However, the RBPi family boasts of the Raspberry Pi Zero or RBPiZ, which you can buy for $5, making it cheaper than the Chip, and the cheapest computer on the market.

However, both the RBPiZ and the Chip are bare computers in the sense that they do not have power adapters or cords. For connecting each device to a display, along with USB power adapters to power them up, you will need to spend some more. The RBPiZ needs an SD card, as it does not have on-board storage, and therefore, has a higher all-in cost compared to the Chip.

One of the most important features of these devices being connectivity, the Chip offers both Bluetooth and Wi-Fi, making it easy to move around with the Chip when experimenting. The Chip also comes with a composite port for connecting screens physically, a mini USB port, and a standard USB port.

While USB 2 ports are available on most of the RBPi models, they vary from 1 port to 4 ports. Many of the RBPi models also have Ethernet connections, while the RBPiZW, another model of the family, has the wireless connectivity just as the Chip does. Both the SBCs can be upgraded with various boards to give them additional connectivity. That brings the HDMI and VGA connections for the Chip, and full USB connections for the RBPiZ.

While the Chip works with a 1 GHz R8 processor based on the ARM7 architecture, the RBPi family comes with a range of processors beginning with the ARM6 single core to ARM7 quad core, while the RBPiZ has an ARM11 core. Speeds of the processors also varies within the RBPi family, ranging from 700 MHz to 1 GHz. Likewise, the family also has varying RAM capacity, ranging from 256 MB to 1 GB. All the RBPis, except for the RBPiZ, come with a GPU, a multimedia processor of the dual core VideoCore IV family.

As the RBPi family has evolved over the years, the more expensive models of the family are generally superior in performance to the Chip. Although the latest RBPi3 could be several times more powerful than the Chip, it would only be fair to compare the Chip with the RBPiZ, its more direct competitor. The Chip comes with a 4 GB on-board flash memory, while the RBPi boards rely on the SD card to provide the storage.