I'm looking to see if I'm scripting correct.
I'm doing the power train to a BB-9. The way the drive is set up is it uses multiple DC planetary motors each with a single motor h-bridge. The motors are dome spin, dome tilt, ball rolling and motor tilt, which causes it to turn and a spin which lets it spin in place to face a different direction.
Since I can only add 1 h-bridge control, I want to use that for the ball rolling and motor tilt, so the other motor controls I'm creating scripts.
Am I doing this correct? Or is there an easier way?
Dome spin is pretty simple since it's a 360 degrees with no stops.
I have a second script to spin it right, a third script to stop the spin and a fourth script that centers the dome to a specified ADC reading. If the spinning script is running, running the stop or centering script won't work unless I add ScriptStop to their script, is this correct?
ControlCommand("Script Manager", ScriptStop, "Dome Spin Right")
ControlCommand("Script Manager", ScriptStop, "Dome Spin Left")
My last question deals with the dome tilting front or back, it does have a range it can go. From my ADC readings, 93 is center, 139 and 38 are the max ranges front and back. Here is one of the tilt direction scripts, using this, will it stop correctly when it reaches the max 139?
$adcSpecified = 139
$adcCurrent = GetADC(adc2)
if ($adcCurrent < $adcSpecified)
goto( front )
if ($adcCurrent = $adcspecified)
This will also have 4 scripts, front, back, stop and center. Also I have 5v going to the EZ-B, D0 and D3 connect to the vcc and ground to the h-bridge and the signal from them I have it connecting to the PWM inputs of the H-Bridges which will be a question for later!
Thanks I added a video of the dome spin test.