Go to Post This year's theme is "It will be neat if it works!" - s_forbes [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-03-2005, 23:34
Calvin Calvin is offline
Registered User
no team
 
Join Date: Feb 2005
Location: Portland OR
Posts: 105
Calvin has a spectacular aura aboutCalvin has a spectacular aura about
Reversing controls?

Ok we shipped the robot, and now our team decided that they want to redefine which side of the robot is the front. I don't have anything to test this.. but would this work:

pwm01 = ((-1 * p2_y) + 255);
pwm02 = ((-1 * p1_y) + 255);
  #2   Spotlight this post!  
Unread 02-03-2005, 23:40
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Reversing controls?

Quote:
Originally Posted by Calvin
Ok we shipped the robot, and now our team decided that they want to redefine which side of the robot is the front. I don't have anything to test this.. but would this work:

pwm01 = ((-1 * p2_y) + 255);
pwm02 = ((-1 * p1_y) + 255);
I usually do:

pwm01 = 254 - p2y;

et cetera...

255 is usually a reserved value for these types of speed controllers.

Regards,
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #3   Spotlight this post!  
Unread 02-03-2005, 23:40
MikeDubreuil's Avatar
MikeDubreuil MikeDubreuil is offline
Carpe diem
FRC #0125 (Nu-Trons)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Boston, MA
Posts: 967
MikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond reputeMikeDubreuil has a reputation beyond repute
Send a message via AIM to MikeDubreuil
Re: Reversing controls?

Quote:
Originally Posted by Calvin
pwm01 = ((-1 * p2_y) + 255);
pwm02 = ((-1 * p1_y) + 255);
You almost have it, add 254 instead. The controls and victors operate on values from 0 to 254. To test whether this works, try your formula in excel; it can be a great tool for determining if your algorithms are correct.
__________________
"FIRST is like bling bling for the brain." - Woodie Flowers
  #4   Spotlight this post!  
Unread 03-03-2005, 07:20
ldeffenb ldeffenb is offline
Registered User
AKA: Lynn Deffenbaugh (Mr)
None #0386 (Team Voltage 386)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Florida
Posts: 75
ldeffenb has a spectacular aura aboutldeffenb has a spectacular aura aboutldeffenb has a spectacular aura about
Send a message via ICQ to ldeffenb Send a message via AIM to ldeffenb Send a message via Yahoo to ldeffenb
Re: Reversing controls?

Actually, testing in Excel won't fix this one. MPLAB and the IFI environment makes the pwm and joystick values unsigned chars. I'm not sure if the -1* will change this, but the 254-p1_y is certainly a safer way to go and executes faster than a multiply anyway.
  #5   Spotlight this post!  
Unread 03-03-2005, 21:13
Cody Carey's Avatar
Cody Carey Cody Carey is offline
,':-)
AKA: C. Carey
FRC #0306 (CRT)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Corry, PA
Posts: 1,137
Cody Carey has a reputation beyond reputeCody Carey has a reputation beyond reputeCody Carey has a reputation beyond reputeCody Carey has a reputation beyond reputeCody Carey has a reputation beyond reputeCody Carey has a reputation beyond reputeCody Carey has a reputation beyond reputeCody Carey has a reputation beyond reputeCody Carey has a reputation beyond reputeCody Carey has a reputation beyond reputeCody Carey has a reputation beyond repute
Send a message via AIM to Cody Carey Send a message via Yahoo to Cody Carey
Re: Reversing controls?

Wouldn't you be able to just switch the output wires on the speed controller(s),or would that be illegal?
__________________
  #6   Spotlight this post!  
Unread 03-03-2005, 22:06
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: Reversing controls?

Not only do you want to reverse the output pwm values, you will also want to swap the left and right side

At the "swamp thing" scrimmage a few weeks ago, we decided to swap front and back in between rounds. After simply reversing the output pwms (255-output pwm), we found out much to our driver's amusement that not only were front and back reversed, but so were left and right


....it is also a good idea to "min/max" the outputs to stay between 1 and 254

eric
__________________

Don't PANIC!
S. P. A. M.
  #7   Spotlight this post!  
Unread 03-03-2005, 23:52
Calvin Calvin is offline
Registered User
no team
 
Join Date: Feb 2005
Location: Portland OR
Posts: 105
Calvin has a spectacular aura aboutCalvin has a spectacular aura about
Re: Reversing controls?

Ok, Thanks
  #8   Spotlight this post!  
Unread 08-03-2005, 21:26
xchezhd xchezhd is offline
Registered User
#0171
 
Join Date: Mar 2005
Location: Platteville,WI
Posts: 2
xchezhd is an unknown quantity at this point
Re: Reversing controls?

[/quote]

....it is also a good idea to "min/max" the outputs to stay between 1 and 254

eric[/quote]

I'm trying to use the min function on digital_in14 to limit the reverse on PWM11. The motor is activated by the p3_sw_trig.

Exactly how do I use it? just call it every loop in process_data_from_local_io

==> xchezhd
  #9   Spotlight this post!  
Unread 14-03-2005, 22:05
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: Reversing controls?

Quote:
Originally Posted by xchezhd

I'm trying to use the min function on digital_in14 to limit the reverse on PWM11. The motor is activated by the p3_sw_trig.

Exactly how do I use it? just call it every loop in process_data_from_local_io

==> xchezhd
...hmmm I suppose you are refering to:
void Limit_Switch_Min(unsigned char switch_state, unsigned char *input_value); ... in UserRoutines.c

so I'd try something like:
/* set up a temp char variable */
unsigned char lnTemp ;

/* with your input switch wired "normally open", rc_dig_in14 is normally pulled hi...ie 1 or the enum OPEN. So, closing the switch will set it 0, or CLOSED. Then if pwm11 is < 127, Limit_Switch_Min will set it back to 127
*/
lnTemp = pwm11 ;
Limit_Switch_Min(rc_dig_in14, &lnTemp) ;
pwm11 = lnTemp ;

We didn't use this function, and, in fact, chose to wire our limit switches, normally closed. That way, they return 0 or false all of the time and 1 or true, when tripped....just a matter of taste, really...

so looking at it our way:
if (rc_dig_in14)
{
if ( pwm11 < 127)
pwm11 = 127 ;
}

...hope that helps,
Eric
__________________

Don't PANIC!
S. P. A. M.

Last edited by EricS-Team180 : 14-03-2005 at 22:07.
  #10   Spotlight this post!  
Unread 14-03-2005, 22:22
Kyle T Kyle T is offline
waiting for next season...
FRC #0810 (Mechanical Bulls)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Smithtown
Posts: 20
Kyle T is an unknown quantity at this point
Re: Reversing controls?

Couldn't you just flip the joysticks around in the controller? :-p
__________________
  #11   Spotlight this post!  
Unread 14-03-2005, 22:46
Rick TYler Rick TYler is offline
A VEX GUy WIth A STicky SHift KEy
VRC #0010 (Exothermic Robotics)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Redmond, Washington
Posts: 2,000
Rick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond reputeRick TYler has a reputation beyond repute
Re: Reversing controls?

Quote:
Originally Posted by Kyle T
Couldn't you just flip the joysticks around in the controller? :-p
We did this one round when the driver lost the arm (PWM plug problem) and decided the rear was the better choice for pushing people around. He ripped up the joysticks from the velcro and turned them around during the match.
__________________
Exothermic Robotics Club, Venturing Crew 2036
VRC 10A, 10B, 10D, 10Q, 10V, 10X, 10Z, and 575
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reversing the joystick axis JBotAlan Programming 3 09-02-2005 19:47
Controls for a Crab Drive Ein Control System 22 26-01-2005 20:31
1992 Controls Venkatesh Electrical 6 03-10-2004 22:04
[FVG]: Controls Round C1 Mike Ciance FIRST-related Organizations 18 29-07-2004 20:44
[FVG]: Controls Round B1 Mike Ciance FIRST-related Organizations 18 08-07-2004 09:32


All times are GMT -5. The time now is 00:18.

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


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