Quote:
Originally Posted by Nunez4296
Could someone please explain how to utilize the encoders in our code to set the outputs of our motors?
|
If your encoders are connected to roboRIO:
You take the 4 outputs of the mecanum inverse kinematic computation (the desired wheel speed outputs) and you use those as the setpoint input to 4 corresponding closed-loop controllers (most teams use PID).
You use the encoder speed signals (suitably scaled) as the process_variable input to the corresponding closed-loop controllers.
You use the output from the 4 closed-loop controllers to command the 4 corresponding motor controllers.
OR...
If you are using TalonSRX motor controllers with CAN bus, and your encoders are connected directly to the Talons:
You setup the Talons for speed_control mode and send the desired wheel speeds (suitably scaled from the mec inverse kinematic computation) to the Talons.