Go to Post The teams that know how to build good robots are the same teams that know how to build good teams, and they engage the students every step of the way. - Chris is me [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-02-2012, 22:40
Brandon_L Brandon_L is offline
Back @ it again with the white vans
AKA: Brandon Liatys
FRC #2180 (Zero Gravity)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Newark, NJ
Posts: 1,207
Brandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond repute
PID for aiming automatically

I was playing with PID for aiming the robot at the target, but since I can't test it (robots bagged and tagged) I wanted to check if I did this somewhat right. I programmed in two ways to do it in a case structure with a constant input, so if one doesn't work I can switch to the other.

the first way: I looked up camera specs and found the axis 206 has 48 degrees of vision. The targets get plotted with x and y position on our image, so I took the xpos and figured if its 48* total, I could say when x=0 that would be 0 degrees, -1=-24, 1=24, ect. Basically multiplied the xpos of the target by 24. This would tell me the degrees to turn. I then converted that into rotations of my wheels by finding how far from center of the robot my wheels were, and the arc length that would turn me that many degrees. From there I did arc length divided by pi6 (circumference of the wheels) to give me number of rotations of the wheels, and then divided that by (6/13) (gearing from wheel sprocket to motors where the encoder is). Then I converted the number of rotations into degrees (divide by 360).

Then for the measured variable, I plugged in our encoders after running that through the formulas to convert it into degrees.

This plugs into two PID blocks, one for the left wheels and one for the right. The set point is divide by two and negated on one of the PID blocks, so one side will move forward and one will move backwards.

The second way:
I thought of this after doing all of the above, and thought it would even give better results. I set the setpoint to 0, and simply just plugged in the xpos from the camera. In my logic, it will just try to center the target on the image, thus aiming the robot.

If screenshots would be helpful, let me know. Would these work?
__________________
FRC 2495 - Hamilton West Robotics [2007-2014] - whats a..."hive mind"?
FRC 3929 - Atomic Dragons [2012-2013]
FRC 2180 - Zero Gravity [2017-]

Just trying to collect all the possible team colors
Reply With Quote
  #2   Spotlight this post!  
Unread 25-02-2012, 00:11
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: PID for aiming automatically

Either way would work okay if you have quick enough information from the camera. I think the simple way is likely to have problems due to delays in the vision processing, with the feedback lagging the actual robot position.
Reply With Quote
  #3   Spotlight this post!  
Unread 27-02-2012, 02:58
Brandon_L Brandon_L is offline
Back @ it again with the white vans
AKA: Brandon Liatys
FRC #2180 (Zero Gravity)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Newark, NJ
Posts: 1,207
Brandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond repute
Re: PID for aiming automatically

there wont be a problem with the first one? The way its set up, as the targets get closer to center on the image it changes the set point (which is really the xposition run through formulas to convert into wheel rotations). I thought the setpoint should be static, but I'm not sure.
__________________
FRC 2495 - Hamilton West Robotics [2007-2014] - whats a..."hive mind"?
FRC 3929 - Atomic Dragons [2012-2013]
FRC 2180 - Zero Gravity [2017-]

Just trying to collect all the possible team colors
Reply With Quote
Reply


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


All times are GMT -5. The time now is 22:07.

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