![]() |
How to program Encoders with PID Subsystem
We need help programming our encoders with a PID subsystem because of lack of documentation. We intend to use the encoders for our drive train PID subsystem.
|
Re: How to program Encoders with PID Subsystem
Will you be hooking them up directly to your roboRIO or to a talon SRX?
|
Re: How to program Encoders with PID Subsystem
Quote:
Will you be commanding them with CAN or PWM? What part number encoder? What type of drive train? Are you trying to control wheel speed or wheel distance? Is this for autonomous, Teleop, or both? |
Re: How to program Encoders with PID Subsystem
We will be plugging them into the roboRio and we will be using Victors and controlling them with a pwm connections. We will be using a H-drive train system and we want to be able to control the wheel distance and possible the wheel speed. This is for both teleop and autonomous. We are using the am-0180 Andy Mark Encoders.
|
Re: How to program Encoders with PID Subsystem
Quote:
Do you have specific questions about PID, or do you just need some links to general information? |
Re: How to program Encoders with PID Subsystem
If we could get both general information and specific help that would be great. We have created an encoder object in our PID subsystem drive train, for testing purposes we have only created one and we are only dealing with one encoder. We are fairly lost on what our P I and ad constants should be and we have only been getting a PID output of one with our encoder.pidGet in our return statement for the returnPIDInput method. I can post a copy of the code we have done so far if it will help.
|
Re: How to program Encoders with PID Subsystem
Quote:
https://www.google.com/?gws_rd=ssl#q....com+%22PID%22 Here's an FRC-specific discussion of PID from WPILib: http://wpilib.screenstepslive.com/s/...in-pid-control Quote:
|
Re: How to program Encoders with PID Subsystem
Code:
public class DriveTrain extends PIDSubsystem { |
Re: How to program Encoders with PID Subsystem
The PID Subsystem was designed for a single sensor input and a single output. The way you're doing it will use a single sensor and send the same output value to both the left and right motors, which would allow you to drive a distance approximately straight. Is that what you want?
|
Re: How to program Encoders with PID Subsystem
Quote:
Then to control the height of the elevator or the angle of the wrist, look at the commands SetElevatorSetpoint and SetWristSetpoint. The idea is that the PIDController is embedded in the PID Subsystem and the setting of the set point is in the command. The command finishes when the mechanism actual value is at the stepping +/- the tolerance (set in the subsystem). There is also a video that describes how to write that program from scratch that's here: http://wp.wpi.edu/wpilib/2012/02/15/...-videos-posted. Hope that helps. |
| All times are GMT -5. The time now is 10:39. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi