​Introduction

The Celtic Engineer is a weekly newsletter produced by Celtic Engineering Solutions.  We hope you enjoy it.  If you have any suggestions for topics, would like to give feedback or want your email added to the distribution list please send an email to TCE@celticengineeringsolutions.com.

What the HITL are you doing?

Have you ever wondered how large, and sometimes dangerous or expensive, embedded systems are developed? The answer is hardware-in-the-loop (HITL or HIL).  There are two pieces of a HITL system, the embedded controller and the plant.  The embedded controller is the part you are developing, this is the hardware in HITL.  It has inputs from the system and outputs to actuators.  The plant simulates the real-world thing you are trying to control.  From the point of the controller it thinks it is connected to the real world.

A little fuzzy can you give me an example?

Some years ago, I was involved in developing active armor for the military.  When a projectile would enter the active area, sensors would pick up its presence and activate the system.  In my system, there were 17 microcontrollers all talking to one another.  One was in charge of the simulation, the captain.  It was in charge of tracking an imaginary projectile and telling the array the distance and direction of the incoming round.  This one MCU was the plant.  As far as the array was concerned the information being fed to it was real.  Each cell in the array could communicate with its neighbor and with the captain, but it was also autonomous.  Each cell was running a complex algorithm to decide if and when to fire its countermeasure.
Success was achieved when a cell could fire its countermeasure and hit the projectile and it decided to fire, and it did so at the correct time.  Success was also having cells not fire when they could not hit the projectile. It was a good feeling when an incoming projectile was swatted out of the air, a bad feeling when the round was missed or no cell took a shot, that meant someone died.
Of course, there were no live rounds, no countermeasures, no life or death consequences. The entire scenario played out quietly on the side of my desk.  I designed the hardware and wrote the embedded code and then sat there as thousands of simulations ran testing the validity of the system.

Full speed ahead?

At what speed does the simulator run?  That depends a great deal on the system.  If everything is digital then it can run at any speed you desire.  That is because every step is tied to a clock signal, it is synchronous. Like halting a program on an MCU and stepping through the code one line at a time you can advance, run, stop at will.  If on the other hand, you have some part of the system that has an analog component, then you are stuck and must run at the same speed as you would if the system were running on the battlefield, the tarmac, deep space, or on the car with the family in it running down the road at 65mph.

What’s it good for Jim? 

HITL is good at allowing the developer to try out more situations then would be possible using real systems.  It allows them to do so in a safe and controlled way.  It allows them to do so at a fraction of the cost of testing a system using the real components.
A HITL system can be a multi-billion-dollar project that has hundreds of people working on it or it can be one lone engineer with two MCU’s talking to each other; one the plant the other the control system.  Recently I had to check the performance of a system at elevated temperatures.  The two MCU HITL ran quietly in an oven for some time. The benefits are the same: Safety, Speed and Cost.  I highly recommend looking for opportunities to test out parts of your project using HITL concepts.

Final thoughts

This newsletter is sponsored by Celtic Engineering Solutions LLC, a design engineering firm based out of West Jordan, Utah, which can be found on the web at: www.celticengineeringsolutions.com.  You can find the newsletter on the company blog, LinkedIn or by subscribing.  Send your emails to The Celtic Engineer at:  TCE@celticengineeringsolutions.com.