View Full Version : Arcade Function
gabrielse
07-02-2006, 19:51
We programmed our robot with the Arcade function. It is too sensitive to drive.
We want to make it less sensitive/slow it down. We tried to use a variable to collect the output from the Arcade function. Then we were going to use a linear function to reduce the speed of the output and send the result to the motors.
When we tried to send the PWM signals to a variable (we tried various types) in the Arcade function we got really large numbers that didn't vary with the joystick.
If anyone has more information on the Arcade function, or how to make our robot controls less sensitive, please let us know. Thanks.
BradAMiller
08-02-2006, 00:49
We programmed our robot with the Arcade function. It is too sensitive to drive.
We want to make it less sensitive/slow it down. We tried to use a variable to collect the output from the Arcade function. Then we were going to use a linear function to reduce the speed of the output and send the result to the motors.
When we tried to send the PWM signals to a variable (we tried various types) in the Arcade function we got really large numbers that didn't vary with the joystick.
If anyone has more information on the Arcade function, or how to make our robot controls less sensitive, please let us know. Thanks.
I'm guessing you are looking for "ramping" where the values increase gradually rather than at the same rate the joystick is moved.
The arcade function is a single block that first reads values from the joysticks, mixes the X and Y values, and sends the values to the left and right motors. You could replicate this code yourself and add in the ramping function.
To read the joystick inputs use the "Analog OI Input" block. This will return a value between 0-255 that corresponds to the joystick value with 127 in the center.
To set the motor speeds, use the "PWM Control" block. It takes a value between 0-255 as well.
The ramping is done by determining whether the current value is bigger or smaller than the "requested" value. Then add/subtract a small increment in the requested direction each time through your robot control loop. The size of that increment will determine the speed that the motors catch up with the requested speed.
A slightly tricky part of this will be simulating the arcade steering and mixing the X and Y values. The left and right motors effectively get Y+X and Y-X where the signs depend on the mounting of the motors. You also have to handle the overflow case (where the X+Y or X-Y inputs either exceed 255 or are less than 0).
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.