Current PID first look

I added PID control for the current to the program.  I used the standard NI PID routine that comes with the FPGA toolkit.  All I have to do is feed in my PID coefficients, setpoint and control variable and it takes care of the rest.  I just added it to the output of my current measurement routine so it updates the PWM value once per cycle.  I also added a switch so I can change between PWM control and current control.

The initial tests are promising.  I made the setpoint alternate between small positive and negative currents and watched the current values as it cycled.  I managed to come up with PID coefficients that quickly reach the setpoint values without going unstable.  The values were small enough that nothing moved.  There is still a lot of testing to go, but the PID control of current looks pretty good at first glance.

Leave a Reply