Go to Post In FIRST you have the right to remain silent, anything you say can and will be held against you and your associates in the court of public opinion. - Koko Ed [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 28-03-2005, 22:20
Validius's Avatar
Validius Validius is offline
There is a shadow following me.....
AKA: Mark Ratering
FRC #1549 (Washtenuts)
Team Role: College Student
 
Join Date: Feb 2005
Rookie Year: 2005
Location: South Lyon
Posts: 159
Validius will become famous soon enoughValidius will become famous soon enough
Send a message via AIM to Validius
Autocalibrate function

I think we can all agree in saying that this years joysticks were really lousy. Ours lost calibration even with tape on the wheels.

I want to write an auto calibration function for the sticks so they we can compensate for a reasonable error (say, 10 -15). I have been programming for years but i am rather new to C and more importantly, to the default code. The way i had in mind was to use the user initialization function to grab the values of the sticks (assume they are at center) and calculate offsets that would later be applied to the drive function. I realize that issues that can come up regarding the drive curve when doing this and i have already solved them. What i need to know is if joystick values can be read AT COMPETITIONS in the user initialization function.

Thanks ahead of time!!
__________________
When a sociaty comes to believe that human life is not inherently worth living, it is a slippery slope to the gas chamber. You wind up on a low road that twists past Columbine and leads toward Auschwitz.

-Peggy Noonan
  #2   Spotlight this post!  
Unread 28-03-2005, 22:41
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,132
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
Re: Autocalibrate function

The joystick values should be able to be read during initialization, but just to be safe you could read them in the whole time during which the robot is disabled (by checking the disable bit).

We do almost the same thing, since our joysticks often become decalibrated, but instead of reading the joystick values at initialization or while in disable mode, we read them whenever p1_sw_top is depressed. That way we can quickly recalibrate during a match if the trim tab somehow gets moved. To calibrate before the match, we simply hit the button while the robot is on but disabled.

Hope this helps.
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com
  #3   Spotlight this post!  
Unread 29-03-2005, 21:59
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
Re: Autocalibrate function

I did it slightly differnt.

I read the joystick value at all times. If its greater then the max, or smaller then the lowest, I set either the high/low to the new value, update it in eeprom, and set the new center to (high+low)/2, after that, joystick deadbands are achieved by dividing (high-low) by 30.

I just looked through my code, and realized that I never actually used the center point. Weird, I should probably fix that.
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
Example gyro code released. Kevin Watson Programming 60 17-03-2005 18:32
a quick function question Kashi Chan Programming 3 06-03-2005 20:44
Auton + Functions ten3brousone Programming 0 27-02-2005 20:11
RoboEmu2(code simulator)--now with C! rbayer Programming 23 17-02-2005 09:17
heres the code. y this not working omega Programming 16 31-03-2004 15:18


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

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