Kind of off topic, but related to my previous post:
I think I may have found another error in the control scheme I suggested before. It seems I was oversampling the ADC a bit too much and getting some slow readings.
Code:
motor = setpoint + ( amps * gain ) ;
To debug and tune we set the motor to a certain base fake velocity, and tuned the gain so that when we applied friction to the wheel it would keep the same real velocity. The problem that arose was the wheel would keep the velocity it needed, but would take about .5 seconds to "spin up" when the friction was applied and another .5 to "spin down" after the friction was released. At first we attributed this to the 40Hz control frequency (which im still partially blaming), but now I'm guessing I can attribute this to the laggy ADC readings.
Kevin^2, any comments?