Go to Post Legos rock! - Kyle Love [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 24-02-2012, 22:40
Brandon_L Brandon_L is offline
Someone told me there was food here
AKA: Brandon Liatys
FRC #2180 (Zero Gravity)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Newark, NJ
Posts: 1,200
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
 


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 11:15.

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