Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Gyro Absolute Angle (http://www.chiefdelphi.com/forums/showthread.php?t=112497)

ekapalka 31-01-2013 20:54

Gyro Absolute Angle
 
Hello! Programming this year has been going pretty well, but one problem is bugging us. We would like to use the gyro to return the angle of our (alleged) Frisbee launcher and can't exactly figure out how get the absolute angle from the gyro. I read in the 2009 C++ Getting Started Guide that the gyro is good for getting the relative angle, but not the absolute angle, and the accelerometer is good for directional acceleration and absolute angle (but is "easily confused while moving"). Does anyone happen to know the best way? Thanks!

Team3266Spencer 31-01-2013 20:56

Re: Gyro Absolute Angle
 
The rotation of a turret your shooter is mounted on?

ekapalka 31-01-2013 21:17

Re: Gyro Absolute Angle
 
We'll be using it for the pitch. We'll be aligning the entire robot for the yaw either manually or using the axis camera.

Alan Anderson 31-01-2013 23:22

Re: Gyro Absolute Angle
 
The yaw rate sensor "gyro" doesn't give you absolute angle. An accelerometer can be used to measure the component of gravity pulling in a specific direction, and from that compute tilt angle.

I believe a better solution would be an absolute angular sensor that turns with your pitch angle. A potentiometer can work, or a US Digital MA3, or an Austria Micro noncontact magnetic angular sensor.

ekapalka 01-02-2013 00:35

Re: Gyro Absolute Angle
 
That looks a lot more reliable. Any idea how they are programmed?

Alan Anderson 01-02-2013 10:13

Re: Gyro Absolute Angle
 
Most absolute angle sensors produce an analog voltage. Read it using an analog input. Either use the voltage value directly, or scale it to something which represents a value that makes sense for your application.

ekapalka 04-02-2013 23:42

Re: Gyro Absolute Angle
 
Quote:

Originally Posted by Alan Anderson (Post 1225651)
I believe a better solution would be an absolute angular sensor that turns with your pitch angle. A potentiometer can work, or a US Digital MA3, or an Austria Micro noncontact magnetic angular sensor.

Sold. Any programming suggestions while we're waiting for shipping? (We chose the analog version). We're intending to mount it in the pivot point on our launcher (we'll lathe a hole in the rod to get an exact fit). Thanks, by the way!

BradAMiller 06-02-2013 16:34

Re: Gyro Absolute Angle
 
You can use a PIDController class or a PIDSubsystem (for command-based programs). The input is the potentiometer and the output is the speed controller. You need to choose PID values that scale the inputs (0-5V) to match the required motor value outputs (-1 to 1).

You can see the pot values using the SmartDashboard in test mode to help you come up with the correct values. You can also put the PIDController to the SmartDashboard so that you can tune the PID loop from the computer.

http://wpilib.screenstepslive.com/s/...smartdashboard

Brad

Jefferson 06-02-2013 17:57

Re: Gyro Absolute Angle
 
Quote:

Originally Posted by BradAMiller (Post 1228946)
The input is the potentiometer and the output is the speed controller. You need to choose PID values that scale the inputs (0-5V) to match the required motor value outputs (-1 to 1).

We've found that analog channels use averagevalue (0-1024), not averagevoltage (0-5V), in the PID loop. Your setpoints will need to be in the 0-1024 range.

Just a heads-up about the hardware: We've used a LOT of these over the years (probably 6 on this year's bot) and have broken our share of shafts in the process. Be sure to protect them from side loads across the shaft. For our swerve modules, this meant using flexible mounts for the body, and coupling the shaft with flexible tubing

Good luck.


All times are GMT -5. The time now is 12:55.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi