Hi, We are using Joystick A for Left Motor and Joystick D for Right Motor. Would like to reduce the speed to say 75% of max. This is the code that we are using. However, this is not allowing the motor to go in reverse when we move either joystick back.
If you barely move the joystick back, not more then 75persent, but more than 25 percent back, does the motor move backwords?
Just multiply the value of controller A and D by .75.
A deadband of 25 is pretty big.
This would set the left motor to 75% of max power of Axis A with a deadband of 5.
That works, and we used it last year. The only problem is they might have code planed but not implemented, that needs it in the format it was in. Also I did not want to suggest a huge change,.
@LarsonVex Also, if you need to change the dead band, change this number.
Then make another copy of this code for the right side.
Great responses and thank you…the kids also figured out the 0.75 multiplier. However…they are now thinking of using Joystick A for Left and Right Motors - Forward and Backward and Joystick C for turning. If they use the ‘Drive Train’ mode…could that still be set with a 75% velocity ? I think yes…but wanted suggestions.
I would not recommend drive train. You lose the ability to do point turns and read encoders.
The left motor would be the sum of A and C and the right would be the difference… Or it may be the opposite. This is typically called a split arcade.
The only trouble with this approach is that you will often get numbers over 100 and you may lose some sensitivity… But that’s something they may never even notice depending on how they drive.
Sankey
It is the other way. Right is A-C and left is A+C
newbie coach here,
how do the motors handle velocities > 100 or < -100? and will the robot be still driving/turning in a way that’s intuitive to the driver?
Great question! It just goes as if it were at 100, so no big deal.
Velocity gets pushed down to be acceptable to the robot.