LROBBINS wrote:Thanks Eugene, that will be most helpful.
How have those Chinese geared-brushless motors been working out? Have you monitored current draw under various loads and speeds? (You can do that either by adding a line in the script to print battery current and copying the text from the Run tab, or with a clamp meter on a battery lead - not on a motor lead because of the square-wave commutation of the brushless.) I ask because those motors, as many, use a worm gear and I'm wondering about their efficiency.
Ciao,
Lenny
Motors work great! We build two identical chairs. One with Permobil M300 motors and one with brushless. Brushless have better ride, very smooth. I monitored amps using Roboteq Motor AMP and Battery AMP variables. Most I got was 35A. I will modify script, print values and let you know if it goes higher.
Here is my routine for SpeedPot:
ASpeedPot:
DIM TempPot AS Integer
IF (LoopCycles MOD CyclesPerSpeedPotRead) = 0 THEN
IF SpeedPotInstalled=TRUE THEN
SpeedLeft = GetValue (_BSR, 1)
SpeedRight = GetValue (_BSR, 2)
Pot = GetValue (_VAR, 1) + 10
IF Pot > 100 THEN
Pot = 100
END IF
IF Pot < 0 THEN
Pot = 0
END IF
TempPot = Pot
IF SuppressPrinting = FALSE THEN
PRINT ("SPEED POT set to " , Pot , "% \n")
END IF
ELSE 'speed pot not installed
Pot = DefaultPot
TempPot = Pot
END IF 'end of IF SpeedPotInstalled=TRUE
TempPot = Pot - abs((Pot - (abs(SpeedLeft) + abs(SpeedRight))/20))
IF (Throttle >=0)THEN
Min = SpeedPotFwdMin
Max = SpeedPotFwdMax
ELSE
Min = SpeedPotRevMin
Max = SpeedPotRevMax
END IF
'PRINT ("TEMPPOT set to " , TempPot ," Pot ",Pot, "% \n")
SpeedPot = ((Max-Min)*TempPot)/100 + Min
IF (Throttle > -150) THEN ' use Fwd turn values when at or above "turn in place"
Min = TurnPotFwdMin
Max = TurnPotFwdMax
ELSE ' use Rev turn values only when definitely going backwards
Min = TurnPotRevMin
Max = TurnPotRevMax
END IF
TurnPot = ((Max-Min)*TempPot)/100 + Min
END IF 'end of IF (LoopCycles MOD CyclesPerSpeedPotRead) = 0
RETURN 'End of "SpeedPot:"
VAR 1 holds the value for Potentiometer (I use software vs hardware).
By reading speed from the motors I dynamically change SpeedPot value. That way Pot defines maximum value and SpeedPot changes with the speed allowing for smoother ride and automatic adjustment of joystick commands based on speed.