ebelski / rust-copter

A quadcopter build using a Teensy running Rust and some other cool stuff that's yet to be determined.
MIT License
6 stars 1 forks source link

Map PWM throttle percentages #21

Closed ebelski closed 4 years ago

ebelski commented 4 years ago

Map PWM throttle percentages to current draw as measured by the power supply. Knowledge of the current drawn by the motor allows the force exerted by the motor/prop combo to be inferred

ebelski commented 4 years ago

I created a spreadsheet to track this but don't know if it will upload well to github. @mciantyre if you have any suggestions for how to bring in a google sheet eloquently, that'd be much appreciated!

Otherwise, here's what I found. force-map

I stopped at 55% throttle for 2 reasons. One, I have my power supply limited to 5.5 A current and I didn't want to saturate the supply. Two, this motor was getting pretty rowdy so I didn't want to push it just yet. I'm hoping that this half of the curve will be an ok approximation of the actual force/throttle curve.

Here's a chart of the current supplied vs. throttle percent. throttle-chart

So far it looks as if a 3rd order polynomial represents the curve rather well. The only doubts that I have in the data are from the specified parameters of the motor. It calls out for our setup (2300 KV, 14.8V, 5045 prop):

motor_drawing

ebelski commented 4 years ago

Even a rough model will be useful in developing a state estimator control scheme. Obviously the more accurate the model the better, but I think even a 13% discrepancy is something the control loop will be robust to.

mciantyre commented 4 years ago

LGTM!

have any suggestions for how to bring in a google sheet [...]

Any option is good with me!

ebelski commented 4 years ago

https://docs.google.com/spreadsheets/d/e/2PACX-1vRwAtvcS9hT733l32kDBAb9rSdvrcgj9SYalw7AGWiev5Jk97nK2Tfy6cE2jeu-qcLKq769bl4RLJjm/pubhtml

ebelski commented 4 years ago

This issue still bothers me slightly. We're relying on the specs from this manufacturer...which I don't outright trust. We can go the more robust route and actually measure the force with a load cell

and create a true calibration of throttle percentage to force. I don't actually think this is necessary but let's keep this idea in the back of our minds should we need a more accurate quadcopter model.