### More current analysis

Saturday, January 30th, 2010It looks like I jumped the gun on the inductor curves. I started looking at the curves as the current increases by preventing the motor from rotating. I found out that the curve did NOT stay the same shape as it shifted up. For some reason, the Off current is roughly twice as much as the On current. The shape of the curve also gradually changes, which makes the inductor oscillations unusable.

I decided the inductor wasn’t going to be useful, so I went back to just the motor and took a look at the currents at the higher loads. I get the graph below, which shows a very smooth curve and the Off cycle is almost exactly twice the On cycle. I recorded the curve at many different duty cycles and this looks pretty repeatable.

From my observations, I came up with an algorithm for measuring current. I measure the current at 140 counts in whichever part of the cycle is longer, then estimate the other part of the cycle by multiplying or dividing by two. I multiply each value by its percentage of the total cycle time, add together, and divide by total cycle time to get average current. For all my recorded graphs the value was very close to the mean value of the entire graph. I think this will be accurate enough to control the motor. I will code it into the FPGA and see how well it works. The next step will be writing a PID control loop for the current.