Building an Inverted Pendulum System The Ups and Downs of Defying Gravity…

January 30, 2010

More current analysis

Filed under: Software — Bruce Ammons @ 9:49 am

It 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.

Current waveform, 25% duty cycle, no rotation, 470 uH inductor
Current waveform, 25% duty cycle, no rotation, 470 uH inductor

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.

Current waveform, 25% duty cycle, no rotation, no inductor

Current waveform, 25% duty cycle, no rotation, no inductor

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.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress