*Inexpensive and portable wheel speed controller for use during shooter development. Use for exploring, developing, demonstrating, and tuning speed control algorithms:
Decode the signal from a counter on a spinning wheel, compute RPM, feed the computed RPM and a setpoint into a control algorithm which computes motor command, and generate an output PWM signal corresponding to that motor command.
I guess there really is only one way to tell :yikes:
There are several approaches to measuring and determining RPM. Figuring out which approach is optimal is going to have to be included in a project like this.
In fact, that might be a Whitepaper all by it’s self…hint hint.
I have used an Aduino with a fairly low speed motor, (vex motor) to drive a low CRP quad encoder (100 CRP) and it worked very well. Higher speeds and CPR’s may prove challenging, but heck, what fun is it when everything is easy??
The Arduino absolutely has the capabilities of doing this. We are using one this year to monitor our drive encoders (approximately 5000 counts/sec each - ISR triggering only on ‘A’ phase change, ‘B’ phase just for direction). I’ve also used it to determine RPM on our shooting wheel using a 256 count encoder on a wheel spinning at over 8000 rpm (‘A’ phase counter only). An internal 0.5 microsecond resolution timer was used in the RPM calculation. While I am not using it at the moment, I have code to drive 8 PWM signals off a timer (ISR driven). I’ve also ported the PID code we used to use on the IFI controller to the Arduino, but haven’t had a chance to debug it. So your project is definately feasible. This is being done on a Mega, only because it is what I happened to have available, but a smaller Arduino would also suffice.
I’m attaching the “Servo.cpp” file from the Arduino servo library. Reading through it seems to indicate a 1uS resolution for generating the PWM signals. That is far more than enough resolution to control any of the FRC motor controllers. Combine that with the comments above and it looks like this project just might be a winner.