Go to Post Time flies when you're freaking out. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 23-01-2014, 21:13
wolfspell12 wolfspell12 is offline
Registered User
FRC #3244
 
Join Date: Jan 2014
Location: Minnesota
Posts: 16
wolfspell12 is an unknown quantity at this point
Gyros in place of potentiometers?/Gyro intergration with jaguars

We are looking for a sensor to measure the angle of our boom on the robot suitable for PID control. The boom was not designed for potentiometers, so we were wondering if gyros are a suitable replacement?

Secondly we are using CAN jaguars and PID controls for the first time this year. We wanted to make sure that there was no potential conflict between a drive gyro, and a CAN Jaguar system with encoders. The two won't send conflicting signals to the Cartesian mecanum drive method in Java, will they?
Reply With Quote
  #2   Spotlight this post!  
Unread 24-01-2014, 00:09
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: Gyros in place of potentiometers?/Gyro intergration with jaguars

What most people call a Gyro in the context of FRC robots is actually a yaw rate sensor. It measures how quickly it is rotating. It is not really suitable for measuring an absolute angle on a moving robot part. Depending on how precise you need to do the measurement, you might be able to use a two-axis accelerometer to compute the direction of gravity relative to the boom, though that will have dynamic errors whenever the robot itself is accelerating.

You don't need to mount a potentiometer (or other absolute angle sensor) directly to the rotating component. You can use a linkage from the component to a "follower" arm to copy the rotation of the boom to a piece that is designed for a pot.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2014, 13:10
gpetilli gpetilli is offline
Registered User
FRC #1559
 
Join Date: Jan 2009
Location: Victor, NY
Posts: 285
gpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to all
Re: Gyros in place of potentiometers?/Gyro intergration with jaguars

Regarding the Jaguars -
Assuming that you intend to do PID wheel speed control inside the Jaguar (which is a fine distributed processing architecture), the Jaguar must be connected to the cRIO via CAN (not PWM) and the encoder is connected directly to the Jaguar.

I strongly recommend doing a CD search for old threads on PID and Jaguar for more info. Velocity loops are tuned differently than position loops in that the loop must integrate the encoder error to get the control velocity. The recommend method of tuning is to start with P=0, I=small, D=0 and increase I until just before speed is unstable. Then increase P to further improve stability.

As mentioned in post 2, the gyro outputs angular velocity and I don't believe it will interface directly with the Jaguar. The standard WPI mecanum code I believe does handle the gyro for you on the cRIO, but I have never used that code. The WPI code may also assume that the encoders are hooked to the cRIO and not the Jaguars - you will need to verify that first.
Reply With Quote
  #4   Spotlight this post!  
Unread 25-01-2014, 16:28
wolfspell12 wolfspell12 is offline
Registered User
FRC #3244
 
Join Date: Jan 2014
Location: Minnesota
Posts: 16
wolfspell12 is an unknown quantity at this point
Re: Gyros in place of potentiometers?/Gyro intergration with jaguars

Quote:
Originally Posted by gpetilli View Post
Regarding the Jaguars -
Assuming that you intend to do PID wheel speed control inside the Jaguar (which is a fine distributed processing architecture), the Jaguar must be connected to the cRIO via CAN (not PWM) and the encoder is connected directly to the Jaguar.

I strongly recommend doing a CD search for old threads on PID and Jaguar for more info. Velocity loops are tuned differently than position loops in that the loop must integrate the encoder error to get the control velocity. The recommend method of tuning is to start with P=0, I=small, D=0 and increase I until just before speed is unstable. Then increase P to further improve stability.

As mentioned in post 2, the gyro outputs angular velocity and I don't believe it will interface directly with the Jaguar. The standard WPI mecanum code I believe does handle the gyro for you on the cRIO, but I have never used that code. The WPI code may also assume that the encoders are hooked to the cRIO and not the Jaguars - you will need to verify that first.
While this is becoming more of a programming question, I am a little concerned about the last thing you said. I did a little searching, but it wasn't much help. At least that verified that you could connect to the jaguars or the cRIO. I looked at the java docs, and some of the constructors use a DigitalSource object. I dont know if this object is an input on the cRIO or the jaguar. If its on the jaguar its no problem, if its on the cRIO then i need to know how to tell the robot that these are connected to the jaguars. Does someone know for certain if a digital source connects to the cRIO or jaguar? If it connects to the cRIO how do i tell the robot that it needs data from the jaguars?
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2014, 18:57
gpetilli gpetilli is offline
Registered User
FRC #1559
 
Join Date: Jan 2009
Location: Victor, NY
Posts: 285
gpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to all
Re: Gyros in place of potentiometers?/Gyro intergration with jaguars

Quote:
Originally Posted by wolfspell12 View Post
While this is becoming more of a programming question, I am a little concerned about the last thing you said. I did a little searching, but it wasn't much help. At least that verified that you could connect to the jaguars or the cRIO. I looked at the java docs, and some of the constructors use a DigitalSource object. I dont know if this object is an input on the cRIO or the jaguar. If its on the jaguar its no problem, if its on the cRIO then i need to know how to tell the robot that these are connected to the jaguars. Does someone know for certain if a digital source connects to the cRIO or jaguar? If it connects to the cRIO how do i tell the robot that it needs data from the jaguars?
Im sorry, but you are at the edge of my knowledge. I think you need to create encoder and gyro objects and pass them to the mecanum drive code. You really need someone who has done this to direct you better.
Reply With Quote
  #6   Spotlight this post!  
Unread 25-01-2014, 20:14
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,998
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Gyros in place of potentiometers?/Gyro intergration with jaguars

If you are comfortable with potentiometers:

Mount a pot to the arm, somewhere. Attach a weighted arm to the shaft, maybe 2-3 oz.. The arm will always point down (due to gravity) and send a voltage to indicate arm angle.

Easy-peasy.
__________________

I am N2IRZ - What's your callsign?
Reply With Quote
  #7   Spotlight this post!  
Unread 29-01-2014, 18:49
wolfspell12 wolfspell12 is offline
Registered User
FRC #3244
 
Join Date: Jan 2014
Location: Minnesota
Posts: 16
wolfspell12 is an unknown quantity at this point
Re: Gyros in place of potentiometers?/Gyro intergration with jaguars

We decided forego the potentiometer and PID control for the boom. The Jag question may require a programming topic in the Java section, so I think we will go there next.
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 21:54.

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