Go to Post My favorite is always "The Next One!" - Bill Moore [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 04-02-2006, 20:35
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Robot Runs in full Reverse

I am using the camera code from kevin's website and have modified it alot, i have been using the Arcade 1-Joystick drive that is commented out in the defult
code. My problem started when i tried to switch two a Two Joystick drive system. My problem is the robot runs in full reverse. So i made my Program print the values from p1_y, p2_y, pwm03, and pwm04(the drive pwms). But what confuses me is the p1_y and p2_y print as 127 when the joystick is centered but pwm01 and pwm02 = 0. if i move the joystick the pwm values do not change. My code is below:

pwm03 = Limit_Max(p1_y);
pwm04 = Limit_Max(p2_y);

my 1 joystick code is below:

pwm03 = Limit_Max(p1_x + p1_y - 127);
pwm04 = Limit_Max(p1_x - p1_y + 127);

Can anybody help?
  #2   Spotlight this post!  
Unread 04-02-2006, 20:38
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Robot Runs in full Reverse

Easiest solution - don't use Limit_Max.

Your joystick will never give values outside the acceptable range. Whatever Limit_Max is supposed to do, it isn't.
  #3   Spotlight this post!  
Unread 04-02-2006, 21:01
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Robot Runs in full Reverse

I would like to understand why Limit_Max would not work the way it is suppose to. And why it would be in the default code when it isn't needed?
  #4   Spotlight this post!  
Unread 04-02-2006, 21:14
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Robot Runs in full Reverse

Are you sure you don't mean Limit_Mix? The default code doesn't have a Limit_Max that I can see.

Limit_Mix requires that you add 2000 to the value you pass to it. It's a silly trick to try to avoid an even sillier behavior by the compiler, but it works.
  #5   Spotlight this post!  
Unread 04-02-2006, 21:19
Andrew Blair's Avatar
Andrew Blair Andrew Blair is offline
SAE Formula is FIRST with Gasoline.
FRC #0306 (CRT)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Corry
Posts: 1,193
Andrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond repute
Send a message via AIM to Andrew Blair Send a message via Yahoo to Andrew Blair
Re: Robot Runs in full Reverse

Limit_Max and Limit_Min are function to control limit switches. They control motor outputs that should be limited by a limit switch. Alan is right; Limit mix is the actual function that you want to use. That should give you the reaction that you expect.

Edit--------------------------------------------------------------------

This is for 1 joystick drive. For two, as Alan says below, just assign them directly.
__________________
Reading makes a full man, conference a ready man, and writing an exact man.
-Sir Francis Bacon

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."
-Albert Einstein

Last edited by Andrew Blair : 04-02-2006 at 21:47.
  #6   Spotlight this post!  
Unread 04-02-2006, 21:33
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Robot Runs in full Reverse

Actually, for two-joystick control, LimitMix isn't appropriate either. Its only purpose is to mix the x and y axes of a joystick for single-joystick control. It subtracts 2000 from its input as part of doing its job.

Abwehr is right -- just copy the joystick values to the pwms.
Code:
  pwm03 = p1_y;
  pwm04 = p2_y;
It's that simple.
  #7   Spotlight this post!  
Unread 04-02-2006, 23:39
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Robot Runs in full Reverse

Thanks everyone this has all helped alot!
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
[moderated]: A Challenge: YOU Rewrite G25 Tom Bottiglieri General Forum 10 30-03-2005 21:18
How much do you design before kickoff? Allison K General Forum 19 07-12-2004 21:32
what kind of robot will win? Bcahn836 Championship Event 44 12-04-2004 00:02
Help On Coding 2K1 Controller GregTheGreat Programming 9 05-12-2003 18:35
about how Drive Train push the robot... shouldn't the force accelerate the robot? Ken Leung Technical Discussion 12 26-11-2001 09:39


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

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