![]() |
Confused on how to use Encoder
We're trying to use the encoder to make the robot travel a specific distance and trying to figure out how to use a PID controller to keep the both sides of the robot travel at the same speed. Any help or guidance would be much appreciated. We use CANTalon SRX's as our speed controllers for the motors and an SRX Magnetic Encoder.
|
Re: Confused on how to use Encoder
Quote:
Specific to running any loop through TalonSRX's the first steps would be ensuring the Talon drives the correct direction and that the encoder is wired correctly and returning values. Code:
talon.setFeedbackDevice(CANTalon.FeedbackDevice.CtreMagEncoder_Relative)To run a closed-loop position loop you must set the Talons to position mode, set PID constants, and then set a setpoint. Code:
talon.changeControlMode(CANTalon.TalonControlMode.Position) |
| All times are GMT -5. The time now is 00:13. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi