Algorithm Development for Control Applications – Trevor Smouter


Loosely speaking an algorithm is a mathematical procedure that can be followed to arrive at a specific solution. In the field of controls the understanding of what an algorithm is tends to be more focused. Essentially in controls, an algorithm is a mathematical process or function that takes in variables which represent state(s) of a system and generates an output that can be used to control the system. Alternatively the output of the algorithm is simply used to infer some sort of related data.

Algorithm development of this type is the secret sauce that can make or break the success of modern technology products. An example of this is the trendy wearable fitness monitors. They measure data such as angular rates, accelerations and even bio feedback to determine factors such calories burned, fitness level, hours of sleep per day etc. Another example is a WiFi positioning system, where again different types of data generated by the WiFi system are used to infer a WiFi modules position indoors. The outputs of these systems are an educated guess based on certain facts that are defined in the algorithm. A poor algorithm can result in a useless product whereas a product with a well-developed algorithm can almost appear magical in the way that it works.

Algorithms for some applications are easier to develop into a good working solution then others. A key consideration for easy and accurate algorithm development is whether there is an underlying physical model. If there is a well-defined physical model that relates the input parameters to the output parameters then a straight forward transfer function can often provide excellent and deterministic results. In some cases there is a well-defined physical model however the underlying mechanisms are not obvious. Usually this is discovered during the algorithm development stage by analysing experimental data in Matlab to find an appropriate algorithm. It may be that a highly accurate and simple algorithm can be flushed out that indicates there is some underlying physical mechanism. Since the application here is practically oriented, understanding the underlying mechanism is not important as long as the developed algorithm works well for the application.

In other situations the underlying relationships are not understood and therefore may be defined non-deterministic or are so complex that it appears to be non-deterministic. In this case the focus of the algorithm is to generate an answer that is statistically true. In many cases this is possibly the best output that can be generated in that given a set of inputs it is the output that is most often correct. In fact these types of problems occur often in control problems especially when you consider that all sensors have some significant level of uncertainty and error. This area of stochastic control achieves higher accuracy in the output certainty by probabilistically fusing multiple uncertain inputs into a single and much more certain output – as is the case with the application of a Kalman filter. For this type of algorithm development a more diverse and exhaustive data set is used to more adequately determine which inputs have the most predictive effect on the output and provide a statistically relevant sample.

There are many different types of algorithms that can be applied to control applications and this knowledge is gained through experience. Typically a controls engineer is used to analyze experimental data within Matlab and use it to develop an algorithm. A key requirement is to have the necessary and sufficient experimental data (a dataset that covers every scenario the algorithm is likely to encounter) to facilitate algorithm development. Once the algorithm is developed it must be tested against a different data set that was not used to actually develop the algorithm. This different dataset is used to validate the algorithm. If there is close agreement between the output of the algorithm and the output of the second data set then the algorithm is deemed to be successful and is forwarded to the software engineer for implementation.

Ready to get started in algorithm development to make your product work like magic? Contact Fidus to engage our engineers and learn more about solutions to the problem you are trying to solve.

Trevor Smouter – Fidus Hardware Designer