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.

Preventing or Mitigating Whisker Growth in PCBs

Growth of whiskers puts PCB assembly at considerable risk, since whiskers interfere with components, and this automatically qualifies a good product as a defective one. Although a growing tin whisker may seem harmless, it can pose a very real threat to both the product as well as to the human operator. In PCB assembly, one of the most common problems that whiskers create is a short circuit or arcing. This can cause breakdown of electrical equipment, as well as harm people from the arcing. Either way, it ultimately leads to a loss in time and money.

The impact of whisker growth on global PCB assembly results in ruined circuitry, broken equipment, and overall shoddy artisanship. Therefore, it is very important to address the issue of whisker growth. For mitigating or preventing whisker growth, the following precautions may help.

As pure tin coating is the basic reason for the growth of whiskers, avoiding the use of pure tin plating on PCBs and other components is the most obvious method. However, as this action falls in the realm of manufacturing, it is not always possible to implement at the PCB assembly level. Most manufacturing companies do utilize alloys to help stabilize the tin coating to mitigate tin whisker growth, but it is better to be cautious.

If there is a high risk of whisker growth, it may be possible to outsource the PCB/component to a contract manufacturing company to re-plate the area. To avoid tin whiskers, it is highly advisable to let the external manufacturing company strip away the current plating, and reapply newer plating.

Application of a coating or housing foam encapsulation on the whisker prone area can help to prevent problems of growth in the future. However, this method depends on several factors, including type of foam encapsulating coating used, the amount applied, and the intensity of infection of the whisker prone area. In actual practice, the foam encapsulating coating normally helps to prevent short circuits.

An alternate method is to relieve the stress on the area by using hot oil reflow, or by conducting a new reflow soldering job.

Most reliable assembly manufacturers are aware of tin whiskers, and are willing to help with any whisker growth problem. Several turnkey assembly manufacturers are also certified and make sure they use alloys in place of pure tin components for mitigating whisker formation. Of course, faulty and counterfeit components do raise the risk of causing tin whiskers, but working with US-based manufacturing and assembly companies normally ensures an overall higher standard of quality.

New Research on Preventing Tin Whiskers

New research in preventing growth of tin whiskers points to the use of an additional metal coating on the tin layer. Depositing a thin layer of nickel as an electroless metal deposition seems to be the most practical method. Although tin whiskers can penetrate most metal in days, a hundred-atom thick, about 35 µm, of nickel forms a virtually impenetrable layer. A thicker layer of nickel not only retards the growth of tin whiskers, it truly prevents their formation permanently. However, this requires a two pass electroplating process, one for depositing the tin layer, and the next for depositing the nickel layer on it.

A Cheaper Alternative for Batteries—Sodium Ion

A vast majority of electronic equipment running on batteries rely on the Lithium-ion technology for their electrode material. Since Lithium is relatively rare, its mining and refining make it an expensive material to use. This has led scientists to search for a cheaper alternative, and they have turned to the cheapest substance available, the common salt. A team from Stanford has developed a battery based on Sodium-ion whose cost per storage capacity is far lower than that of the existing batteries based on Lithium-ion.

Salt, being nearly omni-present in our oceans, together with its ability to carry charge, is a near-perfect candidate for low-cost energy storage. Many forms of Sodium-based batteries are now available, some with a unique design of anode made from a carbonized oak leaf to a more standard format for use in laptops. According to the lead researcher of the Stanford study, Zhenan Bao, although Lithium offers a superior performance, its rarity and high cost is leading people to search for materials such as Sodium to build low-cost but high performance batteries.

The research team uses a battery with Sodium salt cathode and a Phosphorous anode—materials that are abundant in nature. Near the cathode, Sodium ions combine with oppositely charged myo-inositol ions. To improve the charge-recharge cycle, the researchers had to study the forces at work at atomic-level, when Sodium ions detach and attach from the cathode.

The newly developed Sodium-ion battery has a reversible capacity of 484 mAh/gm, which translates to an energy density of 726 Wh/Kg. The research team claims the energy efficiency of the new batteries to be greater than 87%. Regarding the cost comparison between similar storage capacity batteries, the team says the new Sodium-ion battery will cost less than 80% of the cost of a Lithium-ion battery of similar storage capacity.

To obtain more performance from the Sodium-ion battery, the research team is planning to work more on its phosphorous anode. In addition, to be able to dictate the size of the Sodium-ion battery necessary to store a certain amount of energy, the team also plans to examine the volumetric energy density in comparison to that of Lithium-ion batteries.

Faradion Limited, of Sheffield, UK, has developed Sodium-ion technology that offers energy densities in batteries far exceeding those of other known Sodium-ion technologies. In addition, their new technology produces energy densities that exceed those from popular Lithium-ion materials such as Lithium iron phosphate. Faradion makes current collectors in their Sodium-ion batteries from Aluminum rather than from the more expensive copper that Lithium cells use.

According to electrochemical tests Faradion has conducted, they list the advantages of the Sodium-ion materials over conventional Lithium-ion materials as follows—better rate capability, better thermal stability (safer), improved transport safety, improved cycle life, and similar shelf life. Further, Sodium-ion material processing is similar to that followed for Lithium-ion materials at every step, beginning from synthesis of the active materials to the processing of electrodes.

Innovate UK co-funds a project for Williams Advanced Engineering, where the novel Sodium-ion technology from Faradion is currently being employed to build 3 Ah prismatic cells. Williams is further incorporating these cells into batteries for commercial use.

A Music Server on Your Raspberry Pi

If you are looking to create a music server on your Raspberry Pi (RBPi), Volumio may be a suitable choice. Although several websites give perfect instructions for setting up the RBPi as a media center for watching films and video series, very few provide solutions for audiophiles who would prefer to have a server dedicated to music.

Volumio is available as a Raspbian distribution. Using the application, one can manage the entire music library on a single device attached to the RBPi. Being very easy to use, Volumio supports all types of audio files—Vorbis, AAC, FLAC, mp3, and more. It even works with several DAC expansion cards. The team behind Volumio maintains it providing updates at least once a month, and this shows their seriousness in supporting this wonderful product.

The best way to get Volumio is to download it from their website. It is available as a Raspbian image, and it is necessary to download the image and decompress it. You will need a micro SD card to flash the uncompressed image—use one with a 16 GB capacity. Flashing requires a PC running Linux, Windows, or MAC. There is no need for an Ethernet cable, as Volumio works with a Wi-Fi connection.

It is advisable to use an RBPi3 with Volumio. On the first run, Volumio proceeds to install the application, which can take up quite a few minutes. In the selection presented, choose Wi-Fi and Volumio will try to connect with a network. If it does not find any network, or the network is inaccessible, Volumio will proceed to create its own hotspot. You can access this hotspot from your PC with the name Volumio and password volumio2. Typing the IP of your RBPi3 or the address volumio.local/ will take you to its web interface.

Once you are able to connect to Volumio on your PC, visit the Network tab, and move to the Wi-Fi Network section, where you can enter the code of security. Now you are fully equipped to run Volumio on your RBPi3, and add all your songs.

This is again a very simple process, and the recommendation is to have an external hard drive for this. Simply store all your songs on the external hard drive and let the RBPi3 use it. Navigate to Browse, then to Music Library, and select USB, which will allow you to see the hard drive. Alternatively, access the contents of the hard drive directly from the Album or Artist sections. Another possibility is to use a Network Attached System (NAS). For this, you must access the section My Music.

Still another possibility is to play the titles of Spotify, and you can do this by adding a plugin. This requires you to navigate to the Plugins section, and installing it from there. Once the installation finishes, activate Spotify on the RBPi.

Volumio is compatible to DLNA and AirPlay. Therefore, it is possible to broadcast audio streams from an iPhone. As Volumio offers a digital output, adding a DAC expansion card to the Raspberry Pi brings further gain in quality and listening pleasure.

Is It Necessary to Ground Cable Trays?

Within a cable tray system, one may use an Equipment Grounding Conductor (EGC), or use the body of the cable tray itself to ground the system—provided the cable tray is made of metal. There are no restrictions as to where one installs a cable tray system. Since the function of the EGC is to provide electrical safety, the EGC is the most important conductor in the electrical system. Therefore, one has three options for grounding in a cable tray wiring system:

  • Use an EGC conductor within or on the cable tray
  • Use individual EGC conductors on each multi-conductor cable
  • Use the metal cable tray itself as the EGC

Irrespective of the option used, one must follow proper bonding practices to ensure the cable tray system is effectively grounded.

If an EGC cable is installed within or on the cable tray, use grounding clamps to bond it with each or alternate cable tray section. The grounding clamps ensure an electrical connection exists between all the sections of the cable tray system. In addition, the grounding clamps also serve to anchor the EGC to the cable tray, so that the EGC is not thrown out of the cable tray due to magnetic forces generated during fault current conditions.

For cable trays made of Aluminum, a bare copper EGC should preferably not be used, as a moist environment has the potential to start electrolytic corrosion of the tray. In such cases, an insulated conductor is a better choice, with tin or zinc plated connectors for bonding to the cable tray, raceways, or equipment enclosures, after removing the insulation of the conductor at such places.

According to industrial standards, when cable trays are used as equipment grounding conductors, there is a minimum requirement for both steel and aluminum cable trays. For circuits with ground-fault protection above 600 amperes, steel cable trays are not recommended for use as EGC. However, one can use aluminum cable trays as EGC for circuits that have ground-fault protection above 2000 amperes.

The standards further clarify that if the cable tray cannot be used as a protective device because of its maximum ampere rating limitations, a separate EGC may be included along with the cable assembly. Alternatively, each cable assembly may include an EGC. Where the cable tray system is in the form of discontinuous segments, it is recommended to use vertical adjustable splice plates to link the various segments. As non-metallic cable trays cannot work as a conductor, they should preferably have a separate EGC along with the cables. In addition, wire mesh cable trays are not to be used as an equipment grounding conductor, as the wire mesh is not a reliable continuous conductor.

For wire-mesh cable trays supporting cables with a built-in equipment grounding conductor along with control or signal cables, one must provide a low impedance path on the tray to a non-system ground for reducing noise and removing induced or stray currents. It is usually not necessary to provide a separate grounding cable attached to the wire mesh of the cable tray.