I have bought the following motor driver: http://www.canakit.com/dual-motor-l298-h-bridge-control-ck1122-uk1122.html
Using two motors and two hall sensors (Hamlin - Hall-sensor 55100-3H-02-A, http://www.hamlin.com/specsheets/55100%20IssueAG.pdf
) and a few magnets, Ive build a small test setup that is capable of measuring the RPM and current of each motor.
At the moment I control the motors using PWM and read the RPM but I want to give a desired RPM so a PID algorithm calculates the optimal PWM value based on the current RPM and current (mA).
When the motors are running freely the current usage and RPM are really stable (as expected). When force is applied to the motor(s), the RPM value decreases and the mA value increases.
I think that a PID algorithm might be enough to calculate a new PWM value but for a more accurate value I think it might putting the used current into the equation migth be a good idea. But how......?
Is there anyone with some experience or good ideas before I reinvent the wheel?
I will post the code of the library I am making later