Go to Post Students can learn to drive on whatever they give us. Ramps, carpet, grating, HDPE, lexan, diamond plate, regolith, other robots the driver station wall, referees, stairs, Dean, the bar, goals, the scorer's table, you name it, I've watched robots somehow manage to drive on it - Peter Matteson [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 07-02-2006, 15:11
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
Dead zone for RC control

I'm using the arcade drive controls through Easy C, but the current controller the drivers want to use doesn't center itself very well, so I need to know if there is anyway to put a dead zone into the code. Thanks for the help.
  #2   Spotlight this post!  
Unread 08-02-2006, 15:44
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 747
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Dead zone for RC control

Quote:
Originally Posted by JJMax7
I'm using the arcade drive controls through Easy C, but the current controller the drivers want to use doesn't center itself very well, so I need to know if there is anyway to put a dead zone into the code. Thanks for the help.

I think you have two choices:

1. See this Post and use the drive ( ); function. "built in deadband".

2. Make your own "arcade" control by mixing the port1_x and port1_y with a SETPWM. Then using IF statements so that the mixed values from the joystick have to be greater than your deadband, else SetPWM 127.
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #3   Spotlight this post!  
Unread 15-02-2006, 17:37
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
Re: Dead zone for RC control

I figured out a really easy way to do it. Turns out I just didn't think it through. I made a simple If-Else statement. If the joystick values are between then set pwms as 127 else tank drive. Worked well enough.
  #4   Spotlight this post!  
Unread 15-02-2006, 18:16
ida_noeman's Avatar
ida_noeman ida_noeman is offline
Registered User
AKA: phobbs
FRC #1719 (Umbrella Corp.)
Team Role: Mechanical
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore, MD
Posts: 129
ida_noeman is on a distinguished road
Re: Dead zone for RC control

A very readable way to do it is to make an inline function like this:
Code:
#define STOP 127
#define DEAD_ZONE 15 // or any other number, fool around with this to make it work as you want it to
#define IN_DEAD_ZONE(x) (x <= DEAD_ZONE + STOP && x>= STOP - DEAD_ZONE)
This would work with something like this:
Code:
if (IN_DEAD_ZONE(p1_y))
p1_y = STOP;
__________________
--
"Weeks of coding can save you hours of planning"
"If the code was hard to write, I'm dam well going to make it hard to read!"

Last edited by ida_noeman : 15-02-2006 at 18:23.
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
Concept of PID explained ConKbot of Doom Technical Discussion 11 27-01-2008 00:11
Member of multiple (FRC, FLL, VEX) teams in profile/user control panel? Elgin Clock CD Forum Support 3 03-12-2005 20:41
YMTC - Flopper? in the ZONE? Jack Jones You Make The Call 6 04-04-2005 12:59
**FIRST EMAIL**/2005 FRC Game Design Communication to FRC Teams Goobergunch FIRST E-Mail Blast Archive 1 06-01-2005 09:29


All times are GMT -5. The time now is 01:33.

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