|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
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? |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|