|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Encoders With Motor Speeds
Hello, my team is programming the drive train for this years robot and all the gear boxes move at different speeds. We are trying to figure out a way to get a value from the encoders for inches per second per say, and then send readings to our talons making all the wheels spin at the same speed.
|
|
#2
|
|||||
|
|||||
|
Re: Encoders With Motor Speeds
Quote:
|
|
#3
|
|||
|
|||
|
Re: Encoders With Motor Speeds
We're using the old ones.
|
|
#4
|
|||||
|
|||||
|
Re: Encoders With Motor Speeds
What programming structure are you using? Iterative, Sample, or Command?
|
|
#5
|
|||
|
|||
|
Re: Encoders With Motor Speeds
We're using an iterative structure
|
|
#6
|
|||||
|
|||||
|
Re: Encoders With Motor Speeds
What you'll want to do is look at the Encoder class and make sure to configure the distancePerPulse. Then you will pass that encoder into a PIDController along with the motor you want to control with it.
Code:
PIDController leftFrontWheel = new PIDController(p, i, d, leftFrontEncoder, leftFrontTalon); |
|
#7
|
|||
|
|||
|
Re: Encoders With Motor Speeds
Great thank you! Is there any way that you could help and explain how a PID controller actually works in layman's terms?
|
|
#8
|
||||
|
||||
|
Re: Encoders With Motor Speeds
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|