An overview of miLoCo

miLoCo: a control system library for embedded systems

If you want to work with control systems on microcontrollers miLoCo is what you are looking for.

miLoCo is mostly a template library, which means that it is mainly composed by header files. Actually besides one class (TaskExecuter) and the examples, the rest are only headers.

It offers different features:

  • – Filtering
  • – Loop control (also nested loops)
  • – Pole placement method
  • – Reduced-order observer
  • – Plant simulation (by means of transfer function or state space representation)
  • – Interpolation

Motivation

I started a mini project using a STM32, more precisely a blue pill, in which my idea was to implement a control loop for DC motors using encoders. At the beginning it was only about a simply control loop but as the time went on I added more and more functionalities (starting with filtering and nested loop control). The time to separate the code into a library had come. The most important advantage of this is the possibility of reusing it for another architecture.

Beginning with miLoCo

In order to understand how to use miLoCo, two concepts are important: Tasks and Entities.

A Task is the procedure needed for a control logic. Let’s say for example in a control loop, the error between the current output and the desired input (set point) is the input of a controller. The output of the controller will be the input of the actuator, which controls the plant. In this case, the steps are: calculate the error, update the controller and set an input to the plant through the actuator.

Control System

A task needs Entities to accomplish its steps. Following with the example above, it is needed a sensor, a controller, an actuator and a desired input. If you are reading the code, you probably realized that the entities are the parameters of the template.

You will find examples and additional info in the git repo.

How to continue

If you still want to see miLoCo in action, there are some good news: I will continue with a post series sharing a use case. On these I’ll be using a beaglebone blue because it is a very nice platform for robotics.

Gabriel Moyano

Electronics engineer currently working at On-board systems Group DLR SC (German Aerospace Center - Institute for Software Technology).