Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   ChangeControlMode RobotDrive CANTalon (http://www.chiefdelphi.com/forums/showthread.php?t=143292)

TimTheGreat 06-02-2016 12:34

ChangeControlMode RobotDrive CANTalon
 
We have encoders hooked up to our drivetrain CANTalons and were wondering if we can do set(EncoderPosition) to make the robot go a certain distance. I haven't found a way but I may be doing it wrong.

Ether 06-02-2016 13:08

Re: ChangeControlMode RobotDrive CANTalon
 
Quote:

Originally Posted by TimTheGreat (Post 1535971)
We have encoders hooked up to our drivetrain CANTalons and were wondering if we can do set(EncoderPosition) to make the robot go a certain distance. I haven't found a way but I may be doing it wrong.

Look at Section 10.1 in the Talon SRX Software Reference Manual.

If you want to go a certain distance while limiting max speed and max acceleration, you might want to learn about motion profiling.



Alan Anderson 06-02-2016 22:20

Re: ChangeControlMode RobotDrive CANTalon
 
The "correct" way is to put the Talon SRX in position control mode and tell it to run to the target encoder position using its internal closed-loop programming.

The easiest way might be for your own code to read the encoder position and run the motors until it reaches the desired value.


All times are GMT -5. The time now is 03:37.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi