Go to Post I was cheering like mad during the last match on Einstein - I think the rest of my team thought I was crazy...or crazier than they thought I was before! - Sean Schuff [more]
Home
Go Back   Chief Delphi > Other > VEX
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-17-2012, 02:29 PM
code009 code009 is offline
Registered User
None #1234
 
Join Date: Mar 2012
Location: Canada
Posts: 2
code009 is an unknown quantity at this point
Question controlling robot speed in RC mode

Hi!!
I am new to Vex Robot programming. We have a competition coming up in our school where we are supposed to run our robot in RC-mode on a racing track and complete the lap in less than three minutes. We are using easy-C for programming our robot. I am having some trouble in handling the robot as one of our motor module runs faster than the other. I was wondering if there was any way to control the speed through some programming code,etc. to make both the motor modules work at the same speed?!?!
Thanks!!
Reply With Quote
  #2   Spotlight this post!  
Unread 03-17-2012, 03:49 PM
alancop's Avatar
alancop alancop is offline
200mph club member
AKA: Alan Copeland
FRC #1716 (Redbird Robotics)
Team Role: Electrical
 
Join Date: Dec 2009
Rookie Year: 2009
Location: De Pere WI
Posts: 6
alancop is an unknown quantity at this point
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-17-2012, 04:17 PM
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: 208
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
  #4   Spotlight this post!  
Unread 03-17-2012, 10:31 PM
code009 code009 is offline
Registered User
None #1234
 
Join Date: Mar 2012
Location: Canada
Posts: 2
code009 is an unknown quantity at this point
Re: controlling robot speed in RC mode

Thanks a lot that was very helpful!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:40 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi