Accel = 800 '800 use 2000 to speed up simulation
Decel = 800 '800
'boost of accel/decel proportionate to difference between MotorCommand and MotorPower
PowerAccel = 100 'at 200, maximum boosted accel will be 3X Accel, at 100 it sill be 2X Accel
PowerDecel = 100
'boost of accel/decel for turn-in-place
TurnAccel = 100 'at 200, maximum boosted accel will be 3X Accel, at 100 it sill be 2X Accel
TurnDecel = 100 'NOT PRESENTLY USED, but may be needed.
BoostLimit = 100 'currentSpeed ar which efffect of PowerAccel and TurnAccel is reduced to zero. (During
'deceleration refers to change of currentSpeed from speed at moment when deceleraton begins.)
'100 corresponds to 10% of max speed, 200 to 20% and so on.
BackStickBraking = 140 'percent of added deceleration to use if Throttle crosses 0. renamed from DecelBoost
The spikiness you saw in command at stick near center is probably caused by the absolute steer priority. Will be easy to cure, I think, and it may even go away all by itself when you've adjusted the various user settings and we've added a working TurnDecel to the script. BTW, how much deadband have you set in the profile? You should have at least a little bit - the Apem joystick doesn't always center to exactly the same mV. Just looked at an old profile of yours. In that one you have 5% deadband which should be sufficient, but for this testing you might want to up it to 10% - that might get rid of the spiking near center.
Do you mean PowerDecel? Don't really know, but here it does. I'll check over the code to make sure it's OK in your version. I can think of three possible reasons: absence of load, on deceleration the chair passes through the BoostLimit point more quickly so an effect on the curve may just be harder to see (and maybe invisible if the stick is cocked even a bit to the side so that turning is taking priority), and the fact that on Rachi's chair base Decel is set much higher - twice what Accel is at as opposed to less than Accel on yours. As the boost PowerDecel is a multiplier, it has a bigger effect if Decel is higher, though I'd still expect to see an effect when set outrageously high like the 2000 you tried.Why does the decboost even set high have no affect?
I don't see a bug, and driving Rachi's chair it definitely evens out the deceleration rate. However, I have her chair set to decelerate in half the time it takes to accelerate - otherwise it "coasts" too far before speed decays.Trust me, I have acc and dec set to around 7 full seconds each. The boost and boost limit are not seen at all. Unless its load (current sensor) dependent. Must be a bug somewhere.
[/quote] I don't think that this will feel odd. When you cross zero, you're actually changing from decelerating to accelerating, and it's from a momentarily stalled condition when the motor's reversing direction, so this is actually PowerAccel doing its thing, not the BackStickBraking.There is a slight dec/acc boost just as the motor power line crosses zero if you are back stick braking. Which will feel odd?[
This may not be the best way to deal with this, but the testing will tell us that. If the highest Decel you want to use gives too slow a stop of turn-in-place, I'll make TurnDecel work then too.
Accel = 1200
Decel = 1100
PowerAccel = 600
PowerDecel = 600
TurnAccel = 3000
TurnDecel = 3000
BoostLimit = 150
BackStickBraking = 140
MotorResistance = 50 '==========================================================================================
SpeedPotPin = 5 'analog input pin used for SpeedPot
LeftCurrentSensorPin = 7 'analog input pin
RightCurrentSensorPin = 8'analog input pin
AlarmPin = 6 'digital output pin used for low voltage alarm
'WILL and JOHN: I don't know what pins you are using for brakes, set here to silly numbers to allow compilation
Brake1Pin = 1 'digital output pin
Brake2Pin = 0 'digital output pin, 0 of only 1 brake pin used
'JOYSTICK AND SPEEDPOT SETTINGS
Damping = 1 'number of joystick readings to moving average
SpeedPotInstalled = TRUE 'Is speed potentiometer installed?
SpeedPot = 100 'default if SpeedPotInstalled = FALSE; 90 allows some headroom for steer/mixing
TurnPot = 16 'default if SpeedPotInstalled = FALSE;
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 speed at highest pot setting, set <100 for lower top
' speed or if headroom needed for turning
SpeedPotFwdMin = 15
SpeedPotRevMax = 26 '26 set at 100 for simulation only
SpeedPotRevMin = 12
TurnPotFwdMax = 16
TurnPotFwdMin = 12
TurnPotRevMax = 16
TurnPotRevMin = 11
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
Accel = 1200
Decel = 1100
'boost of accel/decel proportionate to difference between MotorCommand and MotorPower
PowerAccel = 600
PowerDecel = 600
'boost of accel/decel for turn-in-place
TurnAccel = 1500
TurnDecel = 1500
BoostLimit = 150 'currentSpeed ar which efffect of PowerAccel and TurnAccel is reduced to zero. (During
'deceleration refers to change of currentSpeed from speed at moment when deceleraton
'begins.)
'100 corresponds to 10% of max speed, 200 to 20% and so on.
BackStickBraking = 140 '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 = TRUE 'Set to TRUE if using external current sensors on analog inputs 7 & 8
'Set to FALSE to use Roboteq's internal motor current estimates
'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 averaging
'*************************************************************************************************************** IF (MovingForward AND ((M1Calc+M2Calc)>(M1Power+M2Power))) OR (MovingBack AND ((M1Calc+M2Calc)<(M1Power+M2Power))) THEN
Accelerating = TRUE
ELSEIF (MovingForward AND ((M1Calc+M2Calc)<(M1Power+M2Power))) OR (MovingBack AND ((M1Calc+M2Calc)>(M1Power+M2Power))) THEN
Decelerating = TRUE
END IF
IF (MovingForward AND ((M1Calc+M2Calc)>=(M1Power+M2Power))) OR (MovingBack AND ((M1Calc+M2Calc)<(M1Power+M2Power))) THEN
Accelerating = TRUE
ELSEIF (NOT MovingForward) AND (NOT MovingBack) THEN
Accelerating = TRUE
ELSEIF (MovingForward AND ((M1Calc+M2Calc)<(M1Power+M2Power))) OR (MovingBack AND ((M1Calc+M2Calc)>(M1Power+M2Power))) THEN
Decelerating = TRUE
END IF
Return to Everything Powerchair
Users browsing this forum: jefferso, Superchunk and 379 guests