Is it possible to use two Jaguars to control one motor each where both motors are coupled to the same shaft and both Jaguars are controlled using the CAN interface and use feedback from the same encoder? Would we may a Y-cable and connect the encoder outputs to both Jaguars?
Our team is using a PID loop on the cRIO and C++, so we made a class for the output of the PIDController that just contains two Jaguars and sets them both to the same power. Our class just implements the PIDOutput and the SpeedController classes.
Splitting the encoder’s gnd and signal pins to both jaguars may work as well, although I’d be worried about the loops running at slightly different rates or something and then somehow getting off and ruining the motors and/or shafts. If you decide to do this, make sure you don’t connect the power for the encoder to each jaguar, just connect it to one. The gnd and the two signals should go to both though.
Although we are not driving the same shaft, our shooter design is a two-wheel shooter and we are using CAN and one jaguar’s PID to control the speed of both wheels (motors) using the following method:
- Set up the “speed” jaguar to speed mode and enable it.
- Plug encoder into the “speed” jaguar.
- Set up the other jaguar to be in voltage mode.
- Set other jaguar to be set to the “opposite” (i.e. put a negative sign) of the output voltage of the “speed” jaguar
- Complete the PID settings for that jaguar/motor.
Of course, I don’t know how well this will work for you since your motors are connected to same shaft and you would have to use only one motor to set PID, but it definitely works for our shooter (still need to fine tune PID if possible–but that’s another thread).