|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
encoder uneven
The programming team has been recently been working on our PID loop but the encoder is not keeping it near steady at all. I will soon hopefuly post the code, can anyone give us some advice?
|
|
#2
|
||||
|
||||
|
Re: encoder uneven
Quote:
Have you looked at the output of the encoder and is it sufficiently noise free and accurate? What device is the PID controlling? Is the PID in cRIO or a Jaguar? Speed, linear position, or angle? What scaling are you using for the setpoint and process variable? What encoder part number? 4x 2x or 1x ? What are your P, I, and D gains? etc etc etc |
|
#3
|
||||
|
||||
|
Re: encoder uneven
Have you looked at the output of the encoder and is it sufficiently noise free and accurate?
it is not noise free. that is the main problem. What device is the PID controlling? shooter drive motors. two jags, connected by a splitter cable Is the PID in cRIO or a Jaguar? cRIO Speed, linear position, or angle? speed What scaling are you using for the setpoint and process variable? all parts are -1-1 What encoder part number? E4P 4x 2x or 1x ? 4x What are your P, I, and D gains? we are setting them. we varry p, while i and d remain at 0 etc etc etc anything else? |
|
#4
|
||||||
|
||||||
|
Re: encoder uneven
Quote:
Try using 1x. You don't need 4x for the high speed of a shooter wheel. If that signal isn't quiet enough, then do this: instead of using GetRate(), read the encoder counts (still using 1x) instead, subtract the previous counts [see footnote] , and divide that by the sample time. Then scale appropriately. Quote:
Quote:
Quote:
Quote:
Quote:
footnote: or do this: read the encoder counts, divide that by the sample time, then reset the encoder counts to zero. I don't know how long it takes the encoder counts to overflow Last edited by Ether : 21-02-2012 at 13:37. |
|
#5
|
||||
|
||||
|
Re: encoder uneven
that sounds good i will try that
|
|
#6
|
||||
|
||||
|
Re: encoder uneven
I edited my previous post and added some more comments and questions. Please re-read it.
|
|
#7
|
||||
|
||||
|
Re: encoder uneven
Are these identical motors, and are their outputs mechanically linked so they are at the same speed?
They are the same moters and they are both mechanically linked it is WPI library Are you integrating the output of the PID? speed+=PIDshooter.get(); leftJag.set(speed); -1-1 as from -1 to 1 |
|
#8
|
||||
|
||||
|
Re: encoder uneven
I assume that PIDshooter.get() returns the output of your PID, correct ?
I assume leftJag.set() is the method which sets the output to your motor controller, correct ? What is the range of the input that the motor controller is expecting ? Do you need to clamp that to -/+1 ? What is the speed of the device to which the encoder is attached ? (the FPGA has a counts/sec limit) Last edited by Ether : 21-02-2012 at 14:43. |
|
#9
|
||||
|
||||
|
Re: encoder uneven
the jag is expecting -1 to 1, and it is receiving that amount
|
|
#10
|
||||
|
||||
|
Re: encoder uneven
Quote:
Code:
speed+=PIDshooter.get(); leftJag.set(speed); |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|