View Single Post
  #3   Spotlight this post!  
Unread 17-03-2012, 17:17
ManicMechanic ManicMechanic is offline
Registered User
AKA: Yolande
VRC #0438 (Metal Gear)
Team Role: Mentor
 
Join Date: Dec 2005
Rookie Year: 2003
Location: CA
Posts: 213
ManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond reputeManicMechanic has a reputation beyond repute
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.
__________________
He is no fool who gives what he cannot keep to gain that which he cannot lose. - Jim Elliot
Reply With Quote