Thread: PID help
View Single Post
  #1   Spotlight this post!  
Unread 03-07-2015, 03:50 PM
Omnicide Omnicide is offline
Registered User
FRC #1086
 
Join Date: Mar 2015
Location: Richmond, VA
Posts: 2
Omnicide is an unknown quantity at this point
PID help

I've been trying to get a PID working for our elevator and I've gotten no feedback at all (No error either)
My code for the PID is as follows:
Elevatorpid1 = new PIDController(1,1,1,potOne,elevating_motor1);
Elevatorpid1->SetInputRange(19,50);
Elevatorpid1->SetOutputRange(1,-1);
//Range is 1 to -1 because motor is inverted
Elevatorpid1->SetSetpoint(35);
Elevatorpid2 = new PIDController(1,1,1,potOne,elevating_motor2);
Elevatorpid2->SetInputRange(19,50);
Elevatorpid2->SetOutputRange(-1,1);
Elevatorpid2->SetSetpoint(35);

I use 2 different motors for the elevator, so I'm using 2 PIDControllers, which may be the wrong way. potOne is an AnalogInput (uses a potentiometer)
Later on in the code, I enable it with this:
Elevatorpid1->Enable();
Elevatorpid2->Enable();


the method Elevatorpid1->Get() always returns 0.000.
Where did I go wrong?
Reply With Quote