The idea of sending a control value to a motor that is proportional to battery voltage keeps coming up. So I decided it was time to see if there is any milage to be had out of this very simple open loop control method. Test subject was my usual three motor flywheel that was build last year and, so far, is a bit pathetic at actually shooting balls (one day I will have time to actually make it work properly). Here is it.
In the background you can see a bench power supply, the experiment involved setting the voltage supplying the flywheel, running the flywheel and adjusting motor control value so as to hit a pre-determined velocity of 100rpm at the motor. By observing the measured velocity and adjusting the control value I was essentially acting as my own proportional controller. The results for several different battery voltages were collected using the ROBOTC datalog functions, these were then brought into excel for analysis.
This graph shows the results. The blue line (sorry, almost hidden) and markers are the raw data. The red line was the result of calculation using the LINEST function in excel that finds the best fit line from a set of data.
X axis is the battery voltage in mV (as returned by the nAvgBatteryLevel function). Y axis is the motor control value. The resultant line equation is.
motor_control = battery voltage x -0.0117904 + 147.22
I put this back into the code and verified that constant velocity was achieved as battery voltage was changed.
This will not be as good as TBH or PID. It does not compensate for balls being shot or anything else, only different battery conditions. I make no claims that it will necessarily make your flywheel better, it was just an interesting experiment I did today as distraction from “work”