|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||||
|
|||||
|
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. |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
Re: Gyros in place of potentiometers?/Gyro intergration with jaguars
Quote:
|
|
#5
|
|||
|
|||
|
Re: Gyros in place of potentiometers?/Gyro intergration with jaguars
Quote:
|
|
#6
|
|||||
|
|||||
|
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. |
|
#7
|
|||
|
|||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|