Our Logomotion robot’s drivetrain is controlled by four Jaguars - two master Jaguars and two slave Jaguars on each side. They are Black Jaguars connected by CAN, with speed PID control. We had synchronized the masters and slaves with voltage mode in the past, but we read somewhere that using current mode shares the work load more efficiently. So while using that robot to test some new code, we tried using current mode and found problems with both the getter and setter current methods.
...
jagLeftMaster.changeControlMode(CANJaguar.ControlMode.kPercentVBus);
jagRightMaster.changeControlMode(CANJaguar.ControlMode.kPercentVBus);
jagLeftMaster.changeControlMode(CANJaguar.ControlMode.kCurrent);
jagRightMaster.changeControlMode(CANJaguar.ControlMode.kCurrent);
...
jagLeftMaster.getOutputCurrent(); //both of these only return the absolute value of the current
jagRightMaster.getOutputCurrent();
...
jagLeftSlave.setX(jagLeftMaster.getOutputCurrent());
jagRightSlave.setX(jagRightMaster.getOutputCurrent()); //these don't appear to do anything at all
The getOutputCurrent method only returns the absolute value. The number itself looks accurate but is only ever positive.
The setX() method while in Current mode isn’t appearing to do anything. The LED on the Jaguar is solid amber - it is communicating via CAN but is not receiving instructions.
Has anybody had these problems before and/or know what the problem is?
Exclusively? For our purposes, it is not only impractical but also not healthy for the motors, as ideally the slaves should be running at the same speed as the masters.
If they use PID exclusively, is it not true that Current mode is more effective at distributing the work load?
They use a PID loops to get the current draw as close to the target as possible. Remember, the output is some speed from -1 to 1. The Jaguar needs the PID loop to figure out what output will get the proper current draw.
Does anyone have any experience trying to get a “slave” CIM to sync current output with a “master” CIM - specifically in the application of a 4-motor (2 per side) drivetrain?
I’m curious what ballpark PID values were used, and what your tuning methodology was.
We’re planning on using the speed control PID on the master Jags. If there is a PID loop running on the slave Jags just to match the currents, if it doesn’t react fast enough, it’ll confuse the master Jag’s speed PID loop. Sort of like trying to hit a constantly moving target.
Has anyone already implemented something similar to this?
If I had to do this, I would have the PID control on the master jaguar, then take whatever that PID loop is outputing, and set the slave to that value (no PID loop on the slave jaguars). I had to use two motors to control a fully connected crab drive last year, and this method worked well for it.
That sounds like what we were doing before - we had the slave Jaguars running in PercentVBus mode, and the master Jaguars running in PID speed control mode. We had separate PID loops on the left and right master Jaguars. To synchronize the slaves, we used: