How to build an optimal electric engine controller using OpenDDPT







Engine CC (Continuous Current)can be described trough the fundamental Lorenzt formula that describes the physic of a charged particle into a electro-magnetic field:



Where q is the electric charge , E electric field , B magnetic field.


Picture 1.1: Spire in a magnetic field

In the picture above charged particles are moving in the spire because of the difference of potential applied to spire itself. These particles cut the flow lines of the magnetic field B generating a perpendicular force to spire plane that produces a rotational movement. This engine is a reversible machine too, indeed if an external force is applied to it, that engine can be transformed in a electric generator with output voltage linear dependent to rotational speed.


Picture 1.2: Spire with rotational movement in a magnetic field

If Omega is the rotational speed of the engine and it supposed to be constant then the formula of electrical tractor force can expressed as follow :




Picture 1.3: difference of potential output for engine used as generator




The Engine CC can be divided in two part with different behaviors : the stator (or inductor because it generates the magnetic induction) and the rotor (ot induct).



The stator is ferromagnetic, has a shape similar to a yoke and can be realized with permanent or electrical magnets. In every case it must be very slim so we can raise the magnitude of magnetic flow B without any saturation. The magnetic flow B is solenoidal that's the force field lines start from a pole to close themselves to another one.



The rotor mut have high magnetic permeability and have a diameter that must ensure minimal distance from the stator. This planning choice is made for avoiding the reluctance of empty spaces between stator and rotor itself witch reduces engine's performance.








Where Ie is the stator current that generate magnetic flow (but this circuit is a valid model for static magnets with constant flow too) Ia, Ra and Va are the current, the resistance and the potential difference of engine armor; E is the electrical tractor force that is generated by engine's work . Starting form this equivalent circuit we can enumerate all physic laws about engine behavior in the table below and we can design a equivalent Laplace control block like in picture 1.4.


Picture 1.4 : Engine Laplace Schema For Permanent Magnets


Picture 1.5: Engine Speed Control

Speed control is a retroactive system designed with two digital and linear trasfer function as in picture 1.5. This control must be realized to ensure that input requested speed is equal to output device's one. Saturation are inserted for limiting outputs to acceptable values for example in picture 1.5 we limit engine's input potential difference to 540 Volt (that's the linearized triphase voltage value). These two filters are called speed ring and current ring.


Picture 1.6: SLS Filter (FIR+IIR)

Continuous trasfer function can be transformed in a SLS (that's the general expression of picture 1.6 for defining digital linear control devices ) with some techniques like bilinear transform or other method like minimal mean squares (See literature about “how to design a digital filter”) and so it can be plugged in the OpenDDPT library . Also OpenDDPT has a basic support about digital filter design based on interpolation method that seems to work well. After engine's digital filter building we have to constraint engine parameters (OpenDDPT support linear optimization with constraints trough projection formulas) because optimization procedures have not to modify engine's parameters but only speed control parameters.


Picture 1.7 : Bad engine controller

In Picture 1.7  Strating filter's parameters are bad evalutated so the engine not works well. indeed the required speed is 300 rad/s for 0.25 > t > 0 and 400 rad/s for 0.8 > t > 0.25 but the starting control do not satisfied these requests.




Starting OpenDDPT optimization template we force that required input speed are equal to output engine speed. How we can see from the animated gif below, the optimization template iteratively raises speed control performance and give an optimal estimation of the two digital filters parameters. (See in openDDPT package in the test-directory).