Go to Post "When you lose you don't say anything. When you win you say even less." - Clinton Bolinger [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 Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 25-06-2015, 11:26
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Using PID on Talon SRX with Gyro for feedback

Quote:
Originally Posted by GeeTwo View Post
gyroscopes don't give you an output of what direction you're heading, but what your rate of rotation is.
True, but the WPILib Gyro class uses the FPGA to integrate the gyro's rate to give the robot's angular orientation... which is used by many teams for field-centric control and driving straight.

Code:
/**
 * Use a rate gyro to return the robots heading relative to a starting position.
 * The Gyro class tracks the robots heading based on the starting position. As
 * the robot rotates the new heading is computed by integrating the rate of
 * rotation returned by the sensor. When the class is instantiated, it does a
 * short calibration routine where it samples the gyro while at rest to
 * determine the default offset. This is subtracted from each sample to
 * determine the heading.
 */
Reply With Quote
  #2   Spotlight this post!  
Unread 25-06-2015, 12:41
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,594
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Using PID on Talon SRX with Gyro for feedback

Quote:
Originally Posted by Ether View Post
True, but the WPILib Gyro class uses the FPGA to integrate the gyro's rate to give the robot's angular orientation... which is used by many teams for field-centric control and driving straight.
I was focusing on the feasibility of using the internal SRX controls (or rather lack thereof).

I absolutely agree that once you bring the roboRIO or other external processor and a programming library into the mix, it becomes much more straightforward. Once we installed a working gyroscope, we were able to get our 2014 mecanum robot smoothly driving in field coordinates in a couple of hours. Driving a tank in a straight line should be about the same level of difficulty.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #3   Spotlight this post!  
Unread 25-06-2015, 14:56
tdbroun tdbroun is offline
Registered User
AKA: Tim Brounscheidel
FRC #1507 (Warlocks)
Team Role: Mentor
 
Join Date: May 2013
Rookie Year: 2013
Location: Lockport NY
Posts: 16
tdbroun is an unknown quantity at this point
Re: Using PID on Talon SRX with Gyro for feedback

Thank you for your replies. I didn't know that the gyro signal was not a directional heading. Without that, I don't see how what I proposed could be feasible. We'll continue with our tried and true code to drive straight for a specific distance...
Reply With Quote
  #4   Spotlight this post!  
Unread 25-06-2015, 15:20
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,594
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Using PID on Talon SRX with Gyro for feedback

Quote:
Originally Posted by tdbroun View Post
Thank you for your replies. I didn't know that the gyro signal was not a directional heading. Without that, I don't see how what I proposed could be feasible. We'll continue with our tried and true code to drive straight for a specific distance...
If you're looking for an autonomous solution (that is, a few seconds worth), the SRX internals can be the solution, just not with a gyroscope. Put encoders on both gearboxes, and give them controls to drive at the same speed for the same duration, or to both drive to the same position (that is, the same number of encoder clicks). The first might result in you not pointing the correct direction at the end, and the second might result in a curvature that's corrected at the end. You could probably combine the two (start out with speed, and switch to position when you're about 3/4 of the way there) to get the best of both. If you calculate how many "excess clicks" correspond to a turn of a given angle, you can even use this to follow a more complex path.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-06-2015, 15:53
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Using PID on Talon SRX with Gyro for feedback

Quote:
Originally Posted by GeeTwo View Post
You could probably combine the two (start out with speed, and switch to position when you're about 3/4 of the way there) to get the best of both.
Or better yet, you could create a sinusoidal accel profile and do this for each side.


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 10:29.

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