Go to Post "What we really need to make sure we do is make our robot move." - Barngirl425 [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 18-01-2005, 21:29
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Help with code single joystick

The default code for single joy stick drive is
pwm01 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm02 = Limit_Mix(2000 + p1_y - p1_x + 127);

however with this code our robot turns right when joystick is forward , and goes forward when the joy stick is pushed to the left.

Mathematically
pwm01 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm02 = 254-Limit_Mix(2000 + p1_y + p1_x - 127);
would solve the problem, assuming 254 is the maximum value for the PWM since I dont have the robot with me I can not tell if this will work. Could you please tell me if this will work, if not could you please tell me why or point me in the right direction.

Thank you
James
  #2   Spotlight this post!  
Unread 18-01-2005, 21:49
roboticsguy1988's Avatar
roboticsguy1988 roboticsguy1988 is offline
Larry Johnston
AKA: Larry Boy
FRC #1501 (Team THRUST)
Team Role: Electrical
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Huntington, IN
Posts: 290
roboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud of
Send a message via ICQ to roboticsguy1988 Send a message via AIM to roboticsguy1988 Send a message via MSN to roboticsguy1988 Send a message via Yahoo to roboticsguy1988
Re: Help with code single joystick

I am not to sure on the code. I was looking at it with my mentor tonight because we kind of wanted to see how the code worked, for certain reasons . From what i learned tonight is that Limit_Mix is a function. I didn't know if you knew that or not?? I don't see though why your joystick is doing that. We are currently using a older joystick that was i think in the 2003 kit, we haven't really messed with using the new ones. So i don't know if it is just a problem with the new ones or not. I assume you are using the new joysticks that came in the kit? Also if i was you i would check the wiring going to the speed controllers and from the speed controllers, there could be a problem there.

As far as the code you did to correct that problem, i am not sure if that will work or not. Especially since i am kind of just learning C. However i am not sure if you can "legally" do "254-Limit_Mix" i don't know if C will compile that or not.
__________________
Larry Johnston, Team THRUST, Team #1501, Team THRUST webpage

2005 IRI - Imagery and Design Award
2005 - 2006 BMR - Professional Grade Award
2006 BMR - Delphi Driving Tomorrow's Technology Award

"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~ RogerR
~Da team that uses all tha rivets, Team #1501~


The FIRST Software Repository ~ Chief Admin
openFIRST ~ Project Supporter (Former editor)
DMOZ.org - FIRST - US Teams Section ~ Chief Editor
  #3   Spotlight this post!  
Unread 18-01-2005, 21:54
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Help with code single joystick

C will compile it I tried that just to make sure, I guess my real question is weather the maximum value is 254 and the minimum value is 0
  #4   Spotlight this post!  
Unread 18-01-2005, 21:57
roboticsguy1988's Avatar
roboticsguy1988 roboticsguy1988 is offline
Larry Johnston
AKA: Larry Boy
FRC #1501 (Team THRUST)
Team Role: Electrical
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Huntington, IN
Posts: 290
roboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud of
Send a message via ICQ to roboticsguy1988 Send a message via AIM to roboticsguy1988 Send a message via MSN to roboticsguy1988 Send a message via Yahoo to roboticsguy1988
Re: Help with code single joystick

If i remember right the answer would be yes the max is 254 and the min is 0. And doing it mathimatically if 127 is "stop" (center) 127 + 127 = 254 and 127 - 127 = 0 so i would assume so. And i am assuming thats the same way you guessed 254.
__________________
Larry Johnston, Team THRUST, Team #1501, Team THRUST webpage

2005 IRI - Imagery and Design Award
2005 - 2006 BMR - Professional Grade Award
2006 BMR - Delphi Driving Tomorrow's Technology Award

"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~ RogerR
~Da team that uses all tha rivets, Team #1501~


The FIRST Software Repository ~ Chief Admin
openFIRST ~ Project Supporter (Former editor)
DMOZ.org - FIRST - US Teams Section ~ Chief Editor
  #5   Spotlight this post!  
Unread 18-01-2005, 22:02
nuggetsyl's Avatar
nuggetsyl nuggetsyl is offline
Registered User
FRC #0025
Team Role: Coach
 
Join Date: Sep 2001
Location: north brunswick
Posts: 869
nuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond reputenuggetsyl has a reputation beyond repute
Re: Help with code single joystick

i would say if it is not tooooo late go to a tank drive. a single stick drive while different not as easy to steer
  #6   Spotlight this post!  
Unread 18-01-2005, 22:03
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Help with code single joystick

hmm well thanks for the help you got me in the right direction, When you mentioned it was a function(which i knew but was kind of ignoring) it made me realize i should check the function in the code when i found it the whole thing made sense, I would be happy to explain if any one has the same problem. Basically I think this should work, If any one knows other wise please let me know, I will post when I get a chance to test it tomorrow
  #7   Spotlight this post!  
Unread 18-01-2005, 22:04
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Help with code single joystick

Quote:
Originally Posted by nuggetsyl
i would say if it is not tooooo late go to a tank drive. a single stick drive while different not as easy to steer
We are going to do tank drive I was just playing around with this for a little while.
  #8   Spotlight this post!  
Unread 18-01-2005, 23:18
Bob Koehl Bob Koehl is offline
Engineer
no team (The MEZ)
Team Role: Mentor
 
Join Date: Nov 2001
Rookie Year: 2000
Location: Detroit, MI
Posts: 7
Bob Koehl is a jewel in the roughBob Koehl is a jewel in the roughBob Koehl is a jewel in the rough
Re: Help with code single joystick

Once you are convinced the math is OK, there is still one more possible thing to check.
The Limit Mix function absolutely requires that the joysticks be calibrated.
If the calibration is off, the robot will go in different directions than where the joystick is pointed.
The lights on the operator interface show if p1_y and p2_y are calibrated.
For single joystick, the p1_y and p1_x need to be calibrated.
Calibration is when both y and x values are 127 when the joystick is centered.
Hope this helps.
  #9   Spotlight this post!  
Unread 18-01-2005, 23:35
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: Help with code single joystick

We tried to do tank drive last year and it was awful. But then again we had an insanely fast robot last year. We should probably try it again this year with what will hopefully be a slower bot.
  #10   Spotlight this post!  
Unread 19-01-2005, 00:42
roboticsguy1988's Avatar
roboticsguy1988 roboticsguy1988 is offline
Larry Johnston
AKA: Larry Boy
FRC #1501 (Team THRUST)
Team Role: Electrical
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Huntington, IN
Posts: 290
roboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud ofroboticsguy1988 has much to be proud of
Send a message via ICQ to roboticsguy1988 Send a message via AIM to roboticsguy1988 Send a message via MSN to roboticsguy1988 Send a message via Yahoo to roboticsguy1988
Re: Help with code single joystick

Quote:
Originally Posted by russell
We tried to do tank drive last year and it was awful. But then again we had an insanely fast robot last year. We should probably try it again this year with what will hopefully be a slower bot.
I actually have found tank drive better than single joystick drive. Although i do have to admit it depends on the game for that season. To me with tank drive you seem to have a lot more control. But then again that also depends on what kind of drive system you have, ex. : 2 wheel, 4 wheel, 6 wheel. But yeah either one is fine with me, they both work great.
__________________
Larry Johnston, Team THRUST, Team #1501, Team THRUST webpage

2005 IRI - Imagery and Design Award
2005 - 2006 BMR - Professional Grade Award
2006 BMR - Delphi Driving Tomorrow's Technology Award

"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~ RogerR
~Da team that uses all tha rivets, Team #1501~


The FIRST Software Repository ~ Chief Admin
openFIRST ~ Project Supporter (Former editor)
DMOZ.org - FIRST - US Teams Section ~ Chief Editor
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
Single joystick control problem Mr. Van Programming 7 23-11-2004 09:10
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Changing 1 joystick code to 2 (rookie team) Brawler006 Programming 5 20-02-2004 17:00
single joystick programming Bill Bonsky OCCRA 2 04-10-2003 09:47
robot goes haywire with the one joystick default code Miles Programming 7 24-01-2003 14:58


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

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