|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: controlling robot speed in RC mode
Look into using VEX encoders, they send you data about exactly how fast a motor is running, then you can use that data to tell the motors to run at the same speed verses running at an ambiguous value.
|
|
#2
|
|||
|
|||
|
Re: controlling robot speed in RC mode
If your motors are running at significantly different speeds, it's good to look for mechanical answers first.
1. Are the motors the same type? If they are high strength motors, do they have the same internal gearing? 2. Is there significant friction on one side, or an imbalanced load? Try picking up the robot and running the motors "in air" to see what the speeds on each side look like. You can program the motors to run at different levels of R/C sensitivity, but this is more difficult than balancing mechanically. Are you using EasyCv2 (for PIC) or EasyCv4 (for Cortex)? In v4, the "stop" position is 0, with 127 at full CW and - 127 at full reverse. If you want to slow down one of the motors, you can store the input from a joystick (say 2) to a variable, then scale it. In pseudocode: declare constant Gain = 0.8 (or any number between 0 and 1) declare variable Ch2input, Ch2power while (1==1) Ch2input = GetJoystick(2) Ch2power= Gain*Ch2input Setmotor(2,Ch2power) //Motor port 2 end while For v2, you do something similar, but you have to subtract off 127 before scaling, then add it back on before setting the motor, because the "stop" motor position is at 127. Also in V2, use GetRxInput, rather than GetJoystick. You'll need to use floating point (not integers), because gain< 1. Lastly, there's a lot more Vex-related traffic on Vexforum.com, so you might get more/faster answers there. |
|
#3
|
|||
|
|||
|
Re: controlling robot speed in RC mode
Thanks a lot that was very helpful!
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|