Digital Controller For Motor Position
MotorPositionControlBlockDiagram.png

Before I jump into the ultimate goal of controlling BoRam. I wanted to verify my parameters. The easiest way I could think of was by implementing a controller but for only the DC Motor. A digital controller for position reference will transform my normal DC motor into a glamorous servo, a servo motor only without the horse power. The code for the controller was generated using Simulink Real-time Workshop Toolbox - Embedded Coder. ATmega168 is not officially supported as a target system in Real-time Workshop Toolbox. As a result I had to customize and port the code into my environment as well as define the interface with existing components in the system manually.

Digital Control - Proportional

To confirm my motor model, a simple proportional control was conducted and realized. Both have sampling time of 0.02[s] but the amplitude step size of the position is larger in reality. This is because in the simulation I did not consider the sensor dynamics. The encoder has large quantization error. When I conducted this experiment I used 64 lines in the encoder. This means I could only measure the position every 5.6 degrees and that not a small number. I believe the error in the response is mainly due to this quantization error. After this experiment I had increased the sensitivity by the factor of 2 in the encoder so I could get more accurate position and velocity values. The gain value used in this experiment was 2.

1rad2G-P-control-sim.png
1rad2G-P-control-Enhanced.png

Digital Control - Root Locus

I used Control System Toolbox in Matlab, more specifically I used 'sisotool' to design a Root Locus controller by applying gain and placing poles and zeros. I devised several designs that looked robust
in theory, but performed not as well in the simulation or worse in the real system. The main reason I have discovered was that this control design technique is only meant for linear systems and the effects of saturation can only be revealed in simulation including the saturation block or in the real physical system. Here I present one of my working example. The same quantization error can be observed here as well.

RootLocus-Response.png
Parameter Value
Gain 7.26864330434832
Zeros [-0.973326359832636;0.90376569037657]
Poles [0.71;-0.98]
(1)
\begin{align} Controller=\frac{7.2686(z+0.9733)(z-0.9038)}{(z-0.71)(z+0.98)}\] \end{align}
RootLocus-MotorPositionSim.png
RootLocus-MotorPositionReal.png
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License