View Full Version : Analog Increasing/Decreasing Question
ddnnis
January 18th, 2012, 09:32 AM
I have a servo linear actuator that has a stroke of 0 to 6”. The position feedback from the servo control is 0-10V which corresponds to the 0 to 6” stroke. I want to read this feedback in my PLC and turn outputs on or off based on the position feedback. I’ll be using a Micrologix PLC with an analog input card. I need to be able to turn the outputs on at different points in the extend and retract of the stroke. The problem is on the stroke extend the position feedback is 0-10V and on the stroke retract the position feedback goes the opposite direction 10V– 0. I need absolute position feedback throughout the entire actuator extend and retract. Does anyone know of a way to combine the increasing 0-10V and the decreasing 0-10V so they correspond to 0 - 32768. I have no problem doing the scaling; I’m stuck on how to combine the positive going signal and the negative going signal. I’m not sure if this is feasible or I need to look at an alternative solution. Any help or thoughts would be greatly appreciated.
“Thanks”
bce123
January 18th, 2012, 09:36 AM
0 is 0 and 5 is 3 and 10 is 6 going either way?
ddnnis
January 18th, 2012, 09:45 AM
0 is 0 and 5 is 5 and 10 is 10 going out.
9 is 11 and 8 is 12.... coming in. Hopefully this makes sense.
Tom Jenkins
January 18th, 2012, 09:59 AM
I think you are creating a problem that doesn't really exist.
Position is position. 3" extension is mid way on stroke and the 5 VDC is right no matter which way the travel is going. Direction of travel is an entirley different and independent variable.
If you are controlling the servo then you should be able to indicate direction of travel because you know which way it is going.
If you aren't controlling the servo all is not lost. Just before the end of each scan or time delay (depending on rate of travel) compare the feedback voltage from the last interval to the new value. If the new value is greater than the old then you are extending. If the new value is less than the old then you are retracting. At the end of the scan or time interval store the current feedback voltage for use in the next teration.
ddnnis
January 18th, 2012, 10:26 AM
Hey Tom,
First and foremost thanks for the help. I get what your saying, I believe the servo ctrl does have a direction bit available. I was hoping to keep it somewhat simple in the PLC program. The thing is where setting PLC output windows thru an HMI based on the 0-10V feedback and I was hoping to just use a Limit instruction. I guess I'll have to work the direction bit into the program. Thanks again.
MichaelG
January 18th, 2012, 05:43 PM
I am confused
- + ve values as you extend the ram - ve values as you retract the ram - that seems to be speed
Please draw a single line diagram of the RAM position and the Voltage levels
eg in Excel
ddnnis
January 18th, 2012, 08:36 PM
The servo controller sends back a ram position signal of 0-10VDC. The is proportional to the ram stroke of 0 to 6".
MichaelG
January 20th, 2012, 11:41 PM
The problem is on the stroke extend the position feedback is 0-10V and on the stroke retract the position feedback goes the opposite direction 10V– 0.
Hmm - This is confusing - Maybe Tom worked out what you are trying to do
You are telling us that the position is as below
Position 0" 6"
Voltage 0 10V
IF you Stop at 4" on the way out then you have 6.7 V
If you Stop at 4" on the way back in then you also have 6.7V
IS What you are trying to do is have ONE set of comparisons to use on the way out and Different set on the way back?
EG
Extending
when moving from 0" to 6" only turn on a Bit1 as you move from 1" to 2"
Retracting
The next Ram move is from 6" to 0" ONLY Turn on bit2 as you move from 4" to 3"
???
gryskop
January 21st, 2012, 12:37 AM
Subtract your position feedback signal from a fixed value of 10 (or to whatever your A/D converts the 0..10V signal to?) You mentioned 32768?
Example1. Fixed value: 10. Raw value 0. Result: 10-0 = 10
Example2. Fixed value: 10. Raw value 2. Result: 10-2 = 8
Example3. Fixed value: 10. Raw value 8. Result: 10-8 = 2
Example4. Fixed value: 10. Raw value 10. Result: 10-10 = 0
Martin Nielsen
January 21st, 2012, 04:23 AM
If this are what you want Tom has a good point.
-> 0 1 2 3 4 5 6 extend
<- 12 11 10 9 8 7 6 retract
Make the scale to Inch before or after, I think I prefere before (Both has Benefits so what ever you like)
Make the direction bit as Tom suggest each scan or on a certain time interval.
You only need 1 or 2 compare function and 1 Move function to make the direction detection. And maybee a timer if it's a slow movement.
If direction -> then move your scaled position to your "virtuel" position.
If direction <- use calc.: ("virtuel" position) = 6 - (scaled position) + 6
This can be shorten to ("virtuel" position) = 12 - (scaled position)
ddnnis
January 21st, 2012, 07:54 AM
Thanks Gentlemen,
I did exactly has you stated, captured the direction change and then did the math, it works great.
.