LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vertical Load PID Tuning for a LIFT

Solved!
Go to solution

 

Hello, I am a mentor for a FIRST Robotics team. I was wondering if I could pick your brains about some Labview VI's

 

We have a lift on our team's robot this year. Picture if you will a fork-truck type lift. The lift is connected via a chain to a gearbox, which is turned by an electrical 12 volt motor. The gear box is 12:1 ratio. The motor has plenty of power to lift the lift up and down. The load is about 5 lbs plus the weight of the lift which is 10 lbs. So about 15 lbs total on a 12:1 ratio gear box.

 

When we energize the motor full speed (+12 volts applied) to raise the load, the speed of the lift is about 30 inches per second going UPWARD. There is no strain on the motor and the motor is rated for the load.

 

When we energize the motor full speed (-12 volts applied) to lower the load, the speed of the lift is about 60 inches per second going DOWNWARD, because it's got gravity helping it...

 

When the motor is not energize, no voltage and the lift is raised to the top, the lift will "creep" slowly downward. So it's not a "free fall" lift with no power. But the weight of the lift is back feeding the chain, to the gear box and the motor. The 12:1 ratio isn't enough to keep the lift still when the motor has no power. This is not a big deal to us in our design and not a safety concern. So it doesn't take much motor power to make the lift come down.... 5-7 volts?

 

We have a 1000 PPR encoder on the output shaft of the gear box (12:1) and a speed controller controlling a 12 VOLT motor. We are using a National Instruments cRIO controller running a Lab view app with a PID VI in position mode control.

 

Now that you have all that mechanical details.

 

I've done a few PID tunes, most have been horizontal loads. I assume and we are expecting to have a different tune for the UP direction of the lift, verses the DOWN direction of the lift.

 

While helping the programming team last night, we were able to tune the UP DIRECTION of the PID with no problems. It actually looks pretty sweet. But we struggled with the downward direction.

 

P = 0.8

I = .03

D = .002

(values I remember)

Up direction looks nice…

 

The lift is position based. We send a command of 30 inches while the lift is at 0 inches, and the lift moves up to position and hold 30 inches. When we are up at 30 inches and command a downward direction of 0 inches, the lift drops violently, no matter what kind of a tune we place in the PID. Either P only, PD or PI tune...

 

Again, we expect the up direction will have a different tune that the down direction because of the free fall load. How can we slow down the lowering? So it does not reach 60 inches per second free fall with motor assist?

 

One thing on the speed controller command output works like this:

 

-1 = -12 volts to the motor

0 = 0 volts to the motor

1 = +12 volts to the motor

 

The motor has no brake.

 

We did not try and "limit" the downward output of the speed controller, we may try this tonight.

 

 

Will this HELP in keep the lift from dropping like a dead weight to limit our output of the speed controller to say something like -0.4 (5 volts)?

 

Or do you have any other suggestions we can use for a dead weight PID tune for our downward direction?

 

Another thing I was wondering if there was a VI someone had written or built in that we can add a "gravity" constant to the PID? Or an advance PID setting somewhere that can point us in the right direction. Any helpful thoughts would be appreciated.

0 Kudos
Message 1 of 4
(3,328 Views)

Can you post the VI you are using?

 

Do you know if the position is being correctly calculated/measured/reported that feeds in to the PID VI?  That would be where I look first without seeing the code.

 

Cheers,

Karl M

0 Kudos
Message 2 of 4
(3,320 Views)
Solution
Accepted by chris_elston

Limiting the negative output from your controller will likely help prevent your motor from running faster than you'd like in the downward direction.  That's definitely the easiest solution and would be the first thing I'd try.

 

Two other, more complicated options are:

1) gain scheduling (using different PID gains depending on the direction of travel)

2) ramping the output to the lower target position.  Instead of sending a new setpoint of 0 when you are at 30, instead send 28, then a second later send 26, etc.

 

If you need help with either of these, post specific questions along with your code.  You may also find it helpful to ask on the FRC-specific forum.

0 Kudos
Message 3 of 4
(3,314 Views)

Limiting the downward motor limit. Fixed us right up. Nice PID VI labview has. Thanks for the feedback (no pun intended) guys!

0 Kudos
Message 4 of 4
(3,297 Views)