View Full Version : Triping Timed Fuses
02-18-2002, 12:10 PM
We are having a problem tripping our timed 30Amp Fuses when we go from forward to revers quickly on our drive traine. We are using the Drill motors and we believe that our traction on our wheels is causing the motors to stall when direction is reversed quickly. Can anyone recomend a fix either in hardware or in programing to help over come this tripping of our breakers? Thanks
PS sorry about spelling errors we have been up all night.
02-18-2002, 02:03 PM
Here's the acceleration code we use to make sure the drivers aren't crunching gears... Use it ONLY if you learn something from it. Take a look and figure out how it works...
SAFE_ZONE CON 1000
MAX_ACC CON 10
MAX_ACC_VAL CON SAFE_ZONE + MAX_ACC
MIN_ACC_VAL CON SAFE_ZONE - MAX_ACC
if (abs(left_control - 127) > DEAD_ZONE) then left_calc
left_control = MOTOR_OFF
speed_l = speed_l + (((left_control - speed_l + SAFE_ZONE) min MIN_ACC_VAL max MAX_ACC_VAL) - SAFE_ZONE)
if (abs(right_control - 127) > DEAD_ZONE) then right_calc
right_control = MOTOR_OFF
speed_r = speed_r + (((right_control - speed_r + SAFE_ZONE) min MIN_ACC_VAL max MAX_ACC_VAL) - SAFE_ZONE)
02-21-2002, 09:34 AM
Here is solution to your proplem that has been passed down by FIRST programmers for many moons (also on the InnovationFirst WEB site). This first order filter will limit the rate of change of the inputs.
Drive_yFiltCoef CON 50 'First Order Filter Coefficient = CON/200
Drive_xFiltCoef CON 20 'Adjust these values for improved control. Trial and Error.
Drive_yFilt VAR byte 'First Order Filter output for the Y-axis Joystick Input
Drive_xFilt VAR byte 'First Order Filter output for the X-axis Joystick Input
'**First order filter to limit rate of change of drive motors**
Drive_yFilt = (Drive_yFilt + ((256 + p1_Y - Drive_yFilt) * Drive_yFiltCoef / 200) - (256 * Drive_yFiltCoef / 200)) Min 0 Max 254
Drive_xFilt = (Drive_xFilt + ((256 + p1_X - Drive_xFilt) * Drive_xFiltCoef / 200) - (256 * Drive_xFiltCoef / 200)) Min 0 Max 254
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.