Go to Post In theory, this should work... Oops. - Eldarion [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 08-03-2008, 09:37
J30H30 J30H30 is offline
Registered User
FRC #2170
 
Join Date: Mar 2008
Location: Connecticut
Posts: 3
J30H30 is an unknown quantity at this point
How to Auto Calibrate

Hi im Joe from team 2170
i am having trouble auto calibrating our robot
can someone please tell me how i would?
  #2   Spotlight this post!  
Unread 08-03-2008, 10:58
Jimmy Cao Jimmy Cao is offline
Registered User
AKA: Jimmy Cao
no team
 
Join Date: Sep 2006
Rookie Year: 2004
Location: San Francisco, CA
Posts: 295
Jimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant future
Re: How to Auto Calibrate

Um...

What are you calibrating?

If you mean joysticks...

Plug your OI into a laptop via serial connection (Use the Dashboard port on the OI).
Then, open IFI Dasboard. Make sure your jumper is set to OI DATA (if it's on RC DATA, move it to OI DATA)

Play with the trims until p1_x, p1_y, p2_x, p2_y... etc are all set (to 127)
__________________
Jimmy Cao

Team 469 2006-2010 Student/Alumni
Team 830 2011-2012 Mentor

Last edited by Jimmy Cao : 08-03-2008 at 11:11.
  #3   Spotlight this post!  
Unread 08-03-2008, 11:04
Danny McC's Avatar
Danny McC Danny McC is offline
Taking one home in '09.
AKA: Danny McCanney
FRC #0816 (The WesTech Anomaly)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2002
Location: New Jersey
Posts: 775
Danny McC has a brilliant futureDanny McC has a brilliant futureDanny McC has a brilliant futureDanny McC has a brilliant futureDanny McC has a brilliant futureDanny McC has a brilliant futureDanny McC has a brilliant futureDanny McC has a brilliant futureDanny McC has a brilliant futureDanny McC has a brilliant futureDanny McC has a brilliant future
Send a message via AIM to Danny McC Send a message via MSN to Danny McC
Re: How to Auto Calibrate

If you are talking about joysticks we usually just put the robot up on bricks or the carts so we can see how much we have to calibrate them.
__________________

  #4   Spotlight this post!  
Unread 10-03-2008, 07:46
J30H30 J30H30 is offline
Registered User
FRC #2170
 
Join Date: Mar 2008
Location: Connecticut
Posts: 3
J30H30 is an unknown quantity at this point
Re: How to Auto Calibrate

yea i mean joysitcks...but how can i program the robot so when i hit a button it auto calibrates?
  #5   Spotlight this post!  
Unread 10-03-2008, 07:56
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,113
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: How to Auto Calibrate

I don't know what you mean. Can you give more detail about what button you are talking about, and what you want to happen when the button is pressed? Please explain it without using the words "auto calibrate".
  #6   Spotlight this post!  
Unread 10-03-2008, 08:08
Jimmy Cao Jimmy Cao is offline
Registered User
AKA: Jimmy Cao
no team
 
Join Date: Sep 2006
Rookie Year: 2004
Location: San Francisco, CA
Posts: 295
Jimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant future
Re: How to Auto Calibrate

Well, if you add code that sets the current value as the neutral (127) value, then you can "autocalibrate", or at least kinda autocalibrate.
__________________
Jimmy Cao

Team 469 2006-2010 Student/Alumni
Team 830 2011-2012 Mentor
  #7   Spotlight this post!  
Unread 10-03-2008, 08:11
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: How to Auto Calibrate

You can write a relatively simple algorithm that keeps watching for higher highs and lower lows and calculates the midpoint (average) value and watches how much displacement there is above and below this midpoint to scale whatever your joystick input is.

However, if you don't trim the joysticks, you could have a lot of meaningless joystick travel, such as the last 15 degrees of travel all being '255'.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #8   Spotlight this post!  
Unread 10-03-2008, 10:19
jamie_1930's Avatar
jamie_1930 jamie_1930 is offline
Registered User
FRC #2228 (Cougartech)
Team Role: Student
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Rush-Henrietta
Posts: 371
jamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to behold
Re: How to Auto Calibrate

I'm not sure if this is what your looking for but you could set it so that when you press the triggers it sets the joysticks to 127. Then instead of messing with the calibration wheels, you would press the triggers and it would set it to 127, 127. I'm not sure exactly how you would go about doing this but it would probably start with an if statement similiar to this

if(trig_sw==1)


I'm sorry if this isn't that much help. It's my first year in FIRST and I began programming over the summer
  #9   Spotlight this post!  
Unread 10-03-2008, 12:57
Madwolvez Madwolvez is offline
Registered User
no team
 
Join Date: Feb 2008
Location: Unknown
Posts: 13
Madwolvez is an unknown quantity at this point
Re: How to Auto Calibrate

I think i understand what you talking about:
You would need to set a code that would record ans store values given by the joysticks in a sequence:

1. you would have to get the manual trim as close as possible then make it so their is no way the manual trim can move.
2. your code would need something to trigger the code such as a switch and then have it run so the you have it scan for ranges that could be the max, min, neutral .
-max would be the highest value recorded
-min would be the lowest value recorded
-neutral would probably be what the code would read first when no one is touching the stick.

~now i don't know alot of code but i know logically it would work but since my team refuses to do it i hope someone out there will finish this.
  #10   Spotlight this post!  
Unread 12-03-2008, 08:52
jamie_1930's Avatar
jamie_1930 jamie_1930 is offline
Registered User
FRC #2228 (Cougartech)
Team Role: Student
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Rush-Henrietta
Posts: 371
jamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to behold
Re: How to Auto Calibrate

After thinking about this I think I have your code.
if(trig_sw==1)
x1==127
y1==127
x2==127
y2==127
This should be it. Although you still want to check the variables
x1,x2,y1,y2 are supposed to be the joystick direction.
  #11   Spotlight this post!  
Unread 12-03-2008, 09:42
JDM JDM is offline
programming lead; team executive;..
FRC #2199 (Robo-Lions)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Eldersburg, Maryland
Posts: 34
JDM is on a distinguished road
Re: How to Auto Calibrate

Quote:
Originally Posted by jamie_1930 View Post
After thinking about this I think I have your code.
if(trig_sw==1)
x1==127
y1==127
x2==127
y2==127
This should be it. Although you still want to check the variables
x1,x2,y1,y2 are supposed to be the joystick direction.

All this would do is set the joystick values to 127 for execution of the code loop. To have it really calibrate you need to store the offset from 127 into a variable and then have the code add/subtract it each time.
  #12   Spotlight this post!  
Unread 12-03-2008, 09:53
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,745
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: How to Auto Calibrate

Quote:
Originally Posted by jamie_1930 View Post
After thinking about this I think I have your code.
if(trig_sw==1)
x1==127
y1==127
x2==127
y2==127
This should be it. Although you still want to check the variables
x1,x2,y1,y2 are supposed to be the joystick direction.
Jamie, I don't think that's what he's talking about. If you did something like that at the beginning of you default routine, then you'd have your joysticks zeroed while you held down the trigger, but you'd never be able to move.

You could do this pretty simply with code along these lines:
Code:
//Definitions
signed char p1_x_off = 0;
signed char p1_y_off = 0;

//Code somewheres at the top of your default routine before you use p1_x, etc. for anything useful:

if (p1_top == 1)
{
    p1_x_off = 127 - p1_x;
    p1_y_off = 127 - p1_y;
}

p1_x = Limit_Mix(2000 + p1_x + p1_x_off);
p1_y = Limit_Mix(2000 + p1_y + p1_y_off);
And then you'd be able to virtually offset your joysticks back to center. Sort of. As QBranch has said, if you actually do this, then the effective range of your joystick is reduced by however wrong you were when you calibrated. for example:
Code:
Joystick center starts at:
p1_x = 147

You "calibrate" so:
p1_off = -20

Here, then are some typical joystick values
and how they'd come out in your code:
p1_x         147   127     0   20   254
p1_x + off   127   107   -20    0   234
Limit_Mix'd  127   107     0    0   234
Notice how actual values between 0 and 20 look like 0 to your code. Notice also how your code will now never see anything higher than 234. These sort of limits that come from this "calibration" are why you always see teams fiddling with trim dials as opposed to using code like this. It might be a little more time consuming and troublesome, but it just works better.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #13   Spotlight this post!  
Unread 12-03-2008, 10:43
Tim Arnold's Avatar
Tim Arnold Tim Arnold is offline
1902 UCF Mentor; 1523 MARS Alumni
FRC #1902 (Exploding Bacon)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Orlando, FL
Posts: 460
Tim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond reputeTim Arnold has a reputation beyond repute
Send a message via AIM to Tim Arnold Send a message via MSN to Tim Arnold
Re: How to Auto Calibrate

I wrote a simple calibration helper using easyC pro using the display on the OI because hooking up the laptop to dashboard between matches gets old fast.

The code is something like: if joy1 >= 230 { SetUserDisplay = joy2; } (and visa versa). Basically, you disable the robot and push the joystick you aren't calibrating all the way up. The user diplay on the OI then displays the opposite joystick's value (0-255). Adjust the trim until it gets as close as possible to 127, rinse, repeat with the other joystick, and you're good to go.
  #14   Spotlight this post!  
Unread 12-03-2008, 10:54
J30H30 J30H30 is offline
Registered User
FRC #2170
 
Join Date: Mar 2008
Location: Connecticut
Posts: 3
J30H30 is an unknown quantity at this point
Re: How to Auto Calibrate

thx for all the help and input...i will try this asap at our Hartford Regional thursday-saturday...
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
How to end an auto mode after gyro gets out of deadband kiettyyyy Programming 17 20-04-2006 07:59
How does your auto-aim work? JamesBrown Programming 36 28-03-2006 23:25
auto mode nuggetsyl General Forum 12 13-02-2006 19:45
auto Tachion FIRST Tech Challenge 3 17-11-2005 11:25
Auto run sirbleedsalot Chit-Chat 3 06-02-2005 00:17


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

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