Help - Search - Members - Calendar
Full Version: SCP scaling in PLC-5
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
technogumbo
I am really needing the SCP (scale with parameters) functionality of the SLC in a PLC-5. I have an analog input (+/- 10VDC) from an old-style LVDT transducer that goes into a FlexLogic I/O block. The literature for the PLC-5 and the FlexLogic block does not fully address scaling a bipolar analog input that is not uniform (i.e., their example assumes that the input is fully centered around the 0 axis for the +/- 10VDC input). In real life, this seldom works out this way.

Here is an example of one of the sensors...closed = 10,000 counts = 0.000"; fully stroked open = -13,652 counts = 3.125". For a +/- 10VDC input into the FlexLogic block, the scaling is +/- 32,752 counts (per Allen-Bradley).

I programmed a "calculate offset" feature tied to the HMI (operators hand measure the product, punch the "desired" into the HMI, and have the PLC calculate the offset). This works fine except it is not repeatable (i.e., when the shift to thicker or thinner product, their readings are off by 5% to 10%. I have tracked this down to the analog signal being offset from the zero axis. If the PLC-5 had a SCP function, it would be a no-brainer. Ugghhh!

In short of not replacing the analog +/- 10VDC LVDT with a model that is 4-20mA or 0-10VDC, has anyone programmed a SCP block in a PLC-5.
Ron Beaufort
Greetings technogumbo,

give us some specific addresses ... and some specific examples ... we'll be glad to help ... or even just write the code for you ...

in your examples use a format something like this:

QUOTE
when the input voltage is (-1.234) then the data at N7:54 is 1211 ... I need the value at F8:9 to be 3.125 ...

when the input voltage is (-2.134) then the data at N7:54 is 2233 ... I need the value at F8:9 to be 4.375 ...


personally I couldn't follow exactly what you meant with that part about the operator's input ... but give us some specific details AND EXAMPLES (with addresses) and we'll be glad to work that into the code too ...

basic idea: if you can adequately describe what's coming in (and where it comes in), and what you want to go out (and where you want it to go to), then whatever has to take place in the middle CAN be programmed ...

best regards,
Ron
Firetubes
I don't think there's a scaling function (SCP) in the 5's but you can use the compute (CPT) to do the same calculation:

Output = (((Input - InputMax)*(ScaleMin - ScaleMax))|(InputMin - InputMax)) - ScaleMax

If you are using one of them older orignal 5's then you will need to do a bunch of SUB, MUL, and DIV or CPT instructions (CPT will only do one subtract/multiply/divide at a time).

If you want to know how the equation above is derived, let me know.
Spedley
QUOTE (Firetubes @ Mar 9 2005, 08:39 PM)
Output = (((Input - InputMax)*(ScaleMin - ScaleMax))|(InputMin - InputMax)) - ScaleMax

Unusual to have (min-max)? I would have done it like this:

Output=(Input-InputMin) * (ScaleMax-ScaleMin)/(InputMax-InputMin) + ScaleMin

buts thats preference, it boils down to whats min and whats max so ...

Output=(Input-10000) * (0-3.125)/(-13652-10000) + 0
Output=(Input-10000) * 3.125/23652

Note: I would not calculate "3.125/23652" and use it as a constant because the number is too small and accuarcy will be lost (this may be your 5% loss), however

=(Input-10000) / (23652/3.125)
is the same as above and can be reduced to

=(Input-10000) / 7568.64
which should be good enough
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.