Code to raise and lower

sts2ss

Member
Join Date
May 2009
Location
Houston
Posts
20
I must be loosing it, but fr the life of me, I cant figure it out.
Im using control logix.
I have a Bul 160 drive controlled via DN. I would like to raise and lower a light rack using feedback from a ultrasonic sensor (4-20)

So I would basically enter a height and the light rack would move to the height using the ultrasonic sensor to determine the height.

Im at a loss....anyone who has some ideas, please help.:D
 
Depends on the accuracy requirement. If you can deal with some slop, a straight proportional-gain loop would suffice, but will not exactly hit the target. That is: Actuator_Command = (Setpoint - Feedback) * (SomeGainValue). Deadband is good here.
If you need more accuracy, and it's not terribly fast moving, the ladder logic "Plain Ol PID", or the drives function PI regulator would do the job. If you use a PID, and the movement is relatively slow, set the D term to zero to start, use P to get close, and I to dial it in finally.

If it moves fast, then you will probably need some derivative as well (in PID) to minimize overshoot.
 
the ladder logic "Plain Ol PID",

What does that mean? The basic pid instruction?

Yes indeed. He mentioned he was on the Control Logix platform, which has several different process control loops. As far as I remember, the simplest, is available only in Ladder logic, and is the PID instruction. The more advanced ones, including the PIDE and PI and others, are only available in Function Block Diagram, but are probably MUCH more hassle then they are worth in this application.

I run high speed dancer and position PID's fine from ladder, and reserve the PIDE and others for very specific applications.
 
Does it pay to have a clogix processor just for pid loops. we have a bunch of slc processors and the loops have a slow response in our winder apps but do okay in temp apps.

I am just in the begining stages of learning pid if these questions sound kind of simple.
 
Thanks guys

The only question is, I know a PID will get me in one direction but how about the other direction?
 
Would this work?

Sensor gives signal, say approx. 7-15ma

Light bar moves from 12" to 27"

Scale sensor 7ma output to 12" distance and 15ma output to 27".

If sensor signal does not match desired height (probably some deadband needed here), error signal drives light bar in direction to minimize error signal.
 
PID will work in both directions, but is probably overkill.

You can ramp your speed and direction according to the error with some simple ladder logic math like rdrast recommended.

I have done this with very good results in the past. Take the difference between your target and actual positions, and multiply it by a gain value. Upper Limit it to the max safe speed, and lower limit it to the minimum speed before the motor tends to stall.

You may also want to set up a position window within which the drive will be stopped.

Also, if there is noise or variation in the raw signal, be sure to filter that out first.

Paul
 
Ok the only way I got it to work was with 2 PID, one for up and one for down. I raise the light bar till 2pm and then lower it in increments. I have some destructive bit call outs for the start and stop on the drive.

If there is a easier way with some math, please post it.....


Thanks alot
 
Sorry,

Its alot of code, and I probably over did it but,
I used 2 PID, one for raise and one for lower. To enable the PID I used system time to raise and lower over the course of the day.
 

Similar Topics

Hi All, Someone at work has put a PLC system on my desk, that's just been taken off an idle production line. He said "It's an S7 PLC. We don't...
Replies
10
Views
209
hello, I'm a student and for my final grade I have to repare a sepro robot. the only problem I have for now is that i have an error code 3...
Replies
0
Views
35
I received an email from a student with the following code attached. This is supposed to control a floodgate system, and supposed to be written...
Replies
23
Views
780
I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
197
I want to set user security level based on the value of a tag in my PLC called "ActiveUser". That tag will contain the A-P code which we use for...
Replies
6
Views
214
Back
Top Bottom