PID Subsystems Question

Is there any way of running multiple PID instances simultaneously from the same PID subsystem?
Let me clarify:
I want to run my drive train with a PID Subsystem but I need to set different set points for each side of the drive train. I also need to set different PID inputs. Is there any way for me to do this in one PID Subsystem? The PID constants are the same for both sides of the drive train.

PS. I know I can do this with two PID Subsystems but I think it would be better to have a single DriveTrain subsystem.

Thanks in advance.

I would simply make a new subclass of Subsystem that includes the desired functionality. You can copy as much or as little of the PIDSubsystem code as you would like.

The PIDSubsystem is just an encapsulation of a regular subsystem and a PIDController object. You can make your own Subsystem as was suggested that just has two PIDController objects in it. For common cases the PIDSubsystem works pretty well, but not always.

Brad

I actually created a pid class with that passes the kP, kI, kD in the constructor and updates the target and current.

It works pretty well, and saves me lots of writing, because programmers are lazy :smiley:

good luck!