Today, I finally finished the hardware setup for the Mr. CR. During the initial preparations I removed all the existing control hardware for the unit leaving only the, motors, pots and LEDs. I wired the motors to 3 L9110 Stepper Motor Driver Controller Board H-bridge units. Powered everything up with the only hiccup being I no longer have control over D1 pin...no big deal just picked another pin.
Started work using EZ-Builder... It seems I am struggling to get finite control over the movements of the robot. To return the head from the looking up/looking down pitch position I use this code:
#31 adc value is looking up
#192 adc value is looking level
#255 adc value is looking down
#Clear pre-existing state
$headPitch = GetADC(adc1)
iF ($headPitch < 190) #looking up then look down
Elseif ($headPitch > 210) #looking down then look up
Else #is inside the range of 190 to 210
The code is simple, yet I can not get predictable reads on the the pots. The motors over overshoot an go to far down outside the value buffer(190-200 on the adc) and head moves back up trying to correct. This leads to unpredictable head bobbing in order to position the head's pitch angle inside the value buffer. During testing I was randomly getting timing hops/delays between the EZ-B reading the pot.
So based on this conclusion I am making the assumption that controlling DC motors via pots with EZ-Robot is not a good idea. Additionally, I can only seem to get 0-255 resolution on the analog ports which offer significantly limited resolution in movement degrees.
So I ask the community a couple of questions:
1. Does anyone have any experiences with controlling precise angles with DC motors via pots, optical or any other sort of encoder?
2. Is the assumption that EZ-Robot works best with servos and using any other precise method of actuation is a fools errand?
3. I am I clear in my post? Any other thoughts, ideas, etc...