NO SCRIPT of any sort is currently running it's just using the Roboteq's RC mix algo.
And he can actually drive it?
Yes those. Or any in fact that have a 100A and 5v swing, reversible.
NO SCRIPT of any sort is currently running it's just using the Roboteq's RC mix algo.
Burgerman wrote:NO SCRIPT of any sort is currently running it's just using the Roboteq's RC mix algo.
And he can actually drive it?
Maybe its me. But that last script appears to have made acc and dec monumentally slow with the pot turned down!
Seems a sign is reversed or something?
And turn acc has gone very slow even with turn accboost turned up to 1000... Wherever the speed pot is set.
SpeedPotPin = 5 'Analog input number in Roboteq setup.
LeftCurrentSensorPin = 7 'Analog input number.
RightCurrentSensorPin = 8 'Analog input number.
AlarmPin = 6 'Digital output number in roboteq setup used for low voltage alarm.
Brake1Pin = 1 'Dig output number of brake operating in setup.
Brake2Pin = 0 'Dig out number as above, both brakes controlled by pin 1 if 0 choosen.
'JOYSTICK AND SPEEDPOT SETTINGS
Damping = 1 'Number of joystick readings to moving average. 1 to 20 acceptable figures.
SpeedPotInstalled = TRUE 'Is speed potentiometer installed? (TRUE/FALSE)
SpeedPot = 100 'Default if SpeedPotInstalled = FALSE. 90, allows speed headroom for steer/mixing.
SpeedPotLowFault = 30 'Chair speed used if pot fails giving too low voltage.
SpeedPotHighFault = 60 'Chair speed used if pot fails giving too high voltage.
SpeedPotFwdMax = 100 'Percent max forward speed at max speedpot setting. <100 for turn headroom at speed.
SpeedPotFwdMin = 15 'Percent max forward speed at min speedpot setting.
SpeedPotRevMax = 26 'Percent max reverse speed at max speedpot setting.
SpeedPotRevMin = 12 'Percent max reverse speed at min speedpot setting.
TurnPotFwdMax = 16 'Percent max turn rate going forwards at max speedpot setting.
TurnPotFwdMin = 12 'Percent max turn rate going forwards at min speedpot setting.
TurnPotRevMax = 13 'Percent max turn rate going backwards at max pot speed setting.
TurnPotRevMin = 11 'Percent max turn rate going backwards at min pot speed setting.
TurnAtFullSpeed = 100 '100=no reduction of turn rate with speed, 0=turn rate goes to 0 at full speed
' DRIVING CHARACTERISTICS
'the following override the settings in the Roboteq configuration
M1Accel = 350 'Max motor 1 acceleration.
M2Accel = 350 'Max motor 2 acceleration. (Set both the same!)
M1Decel = 300 'Max motor 1 deceleration.
M2Decel = 300 'Max motor 2 deceleration. (Set both the same!)
AccelMotorComp = 0 'Adjust accel & decel for motor compensation 0 = no effect,
DecelMotorComp = 0 'but I have no idea of how sensitive this parameter will prove to be
'20 makes a noticeable difference in initial acceleration in bench test
PowerAccel = 45 'boost of accel/decel proportionate to difference between MotorCommand and MotorPower
PowerDecel = 40
PowerCurving = 1 '1=no curving, 2=mild curving, 3=mid curving, 4=strong curving, 5=full curving
TurnAccel = 100 'boost of accel/decel proportionate to diffeence between targetTurnRate
TurnDecel = 100 'and currentTurnRate.
'mixing of acceleraton and deceleration when starting and stopping turns
AccelMix = 800 'TURN ACCELERATION. 0 = no effect of M1-M2 motor power on accel/decl, 100 = full effect
'if 100 is not enough, it's OK to try values > 100
DecelMix = 800 'TURN DECELERATION. 0 = no effect of M1-M2 motor power on accel/decl, 100 = full effect
'if 100 is not enough, it's OK to try values > 100
' BACK STICK BRAKING
DecelBoost = 20 'Back stick braking. Percent of added deceleration to use if Throttle crosses 0.
'effect of this is proportional to how far past 0 the stick is moved.
MotorResistance = 50 'MOTOR COMPENSATION. (SETTING THIS TOO HIGH IS DANGEROUS AND WILL CAUSE A RUNAWAY)
'Set to less than motor mOhms, then adjust based on response a little at a time.
UseCurrentSensors = TRUE 'Set to TRUE if using external current sensors on analog inputs
'Set to FALSE to use Roboteq's internal motor current estimates. (Erratic results).
'parameters added to allow motor compensation boost at low estimated motor current; irrelevant if
'equipped with motor current sensor
BoostStart = 5 'no boost below this to avoid drift at small or no joystick movements
BoostEnd = 500 'safety limit - make sure there's no boost at 50% or more stick throw
MaxBoostFactor = 1 'increase MotorCompensation by this factor at low currents; 0 = no boost
BoostEndCurrent = 100 'taper boost to zero when this value of motor current (10X amps, e.g. 60 = 6 Amps)
'is reached
' PROGRAM TIMING
MainLoopWaitTime = 0 'milliseconds to wait for each cycle through MainLoop: set to 0 for max loop speed
CyclesPerSpeedPotRead = 200/(MainLoopWaitTime+1)'number of cycles between each read of pot
'reduce number of cycles if there is a wait time in main loop
TimeBetweenAmpHrReads = 1000 '1000 mSec = 1 second - time interval between checking current draw
TimeBetweenAmpHrOutputs = 10000 '10000 msec = 10 seconds - time interval for sending current used to display
'device
' MISCELLANEOUS
SuppressPrinting = TRUE 'Set to TRUE to suppress printing to speed and smooth controller/PC
'interaction; PRINT of current used will not be suppressed, but is sent only
'once every vTimeBetweenAmpHrOutputs msec
AllowSerialInput = FALSE 'Set to TRUE if using serial joystick or emulation
FullRechargeVoltage = 449 'ten times battery voltage; 44.9V = 3.45V/cell - voltage present only
'immediately after recharging -- used to reset AmpHrs-used measurement to 0
LowVoltsAlarm = 150 'LENNY tenths of volts, 410 = 3.14V/cell for 13s pack
NoLoadCurrent = 30 'current with no motors running (20 = 2 Amps) YOU SHOULD CHECK THIS ON YOUR CHAIR AND
'SET THE VALUE JUST OVER WHAT YOU MEASURE
NoVoltReads = 50 'no. of times to read quiescent volts before averagingM1Diff = abs(M1Calc - M1Power) [i]no curving[/i]1 M1Diff
2 (2*M1Diff + M1Diff^2)/3
3 (M1Diff + M1Diff^2)/2
4 (M1Diff + 2*M1Diff^2)/3
5 M1Diff^2Burgerman wrote:But the BOOST in acceleration should be road speed related. Greatest around zero mph. Although quite how you would determine speed I don't know. Maybe motor pulsewidth? (Motor power?). Not speedpot.
Motor back EMF.. if you've any way to determine it.
As the back EMF is generated from the rotor is moving through the magnetic field generated by the permanent magnets, the back EMF is directly proportional to the motor speed, and the motor voltage constant. The motor voltage constant includes parameters like magnetic field strength which are also constant.
equation:
- Code: Select all
backEMF =RPM
Kv
P.S. When you're not doing anything else (oh yeah), do take a look at those simulation curves I posted yesterday. Does that look like the way you want the chair to behave (except for the high slope that lasts too long)? That is, does this look like nearly-instant steering changes take precedence over speed changes?
andWe can calculate the back EMF by measuring the current in steady state with no load (emphasis added) and comparing it to a calculated value for the stall current. We can then use this value with the no load speed and the motor’s constants to calculate the speed for the given back EMF.
That is, if stall current is not contributing to the "measured current draw".We now have a way of calculating the back EMF and then in turn the speed of the motor from the measured current draw.
M1Accel = 800
M2Accel = 800
M1Decel = 800
M2Decel = 800
AccelMotorComp = 0 'adjust accel & decel for motor compensation 0 = no effect,
DecelMotorComp = 0 'but I have no idea of how sensitive this parameter will prove to be
'20 makes a noticeable difference in initial acceleration in bench test
'boost of accel/decel proportionate to difference between MotorCommand and MotorPower
PowerAccel = 80
PowerDecel = 15
PowerCurving = 5 '1=no curving, 2=mild curving, 3=mid curving, 4=strong curving, 5=full curving
'boost of accel/decel proportionate to diffeence between targetTurnRate and currentTurnRate
TurnAccel = 100
TurnDecel = 100
'mixing of acceleraton and deceleration when starting and stopping turns
AccelMix = 800 '0 = no effect of M1-M2 motor power on accel/decl, 100 = full effect
'if 100 is not enough, it's OK to try values > 100
DecelMix = 800 '0 = no effect of M1-M2 motor power on accel/decl, 100 = full effect
'if 100 is not enough, it's OK to try values > 100
' BACK STICK BRAKING
DecelBoost = 1 'percent of added deceleration to use if Throttle crosses 0.
'effect of this is proportional to how far past 0 the stick is moved.
MotorResistance = 50 'MOTOR COMPENSATION. (SETTING THIS TOO HIGH IS DANGEROUS)
'Set to less than motor mohms and then adjust based on chair response
UseCurrentSensors = TRUEReturn to Everything Powerchair
Users browsing this forum: emilevirus, JazzyBand, jefferso, slomobile, Superchunk, Yennek and 387 guests