...I'm just a Tech. with a small company, without engineering support. ...
The topic of scaling, as some on this forum have already suffered, is a personal passion of mine.
TL;DR
@joe7514,
My dad was also "just a tech" (automtive and diesel technology, LIATI, Farmingdale, Long Island, 1952) at GE Large Steam Turbine, in Schenectady, NY ca. the early 1950s, and he was eventually known to stand equal to the best turbine test engineers in that company, and possibly in the world.
Apart from a stubborn attention to detail, much of the secret of his success, and to 90%, perhaps 95%, of engineering, wass this:
multiplying by 1.
You really need to learn this, and not just learn it, you need to know it in your bones.
The remaining 5-10% is looking up/estimating/deriving the value of 1. If you learn to do that, you may become the
de facto engineering department of your company.
Because if you are a "tech," but you apparently do not know this*, then you need to have a frank conversation with your former teachers about why they left you so unprepared.
* Otherwise you would not be asking the question in the OP of this thread, you would be explaining it to someone else.
Let's start with a simple example. If someone tells you a part is 0.57 metres (m) in length, and they want to know its length in millimetres (mm), you may already know that the answer is 570mm. You got than answer by multiplying 0.57 by 1000. But where does that factor of 1000 come from? I am glad you asked
...
We know, from school or Google or SI fanatics, that 1m in length is the equivalent to 1000mm in length. Put another way, we can say
If we treat that as an equation, we could divide both sides by [1m]:
Code:
1000mm 1m
------ ≡ --
1m 1m
We can do that because, if we have two things (quantities) that are equivalent, and we perform the same operation on each, in this case divide them both by the same thing, then the two results of that operation will also be equivalent.
Sidebar
For example, say the exchange rate from Euros to US dollars is 1.14, or
If we divide both quantities by two, we get
Code:
1.14USD 1.00EUR
------- ≡ -------
2 2
0.57USD ≡ 0.50EUR
And so we know that fifty-seven cents (US) is the equivalent of half a Euro at that exchange rate.
Returning to our length example,
Code:
1000mm 1m
------ ≡ --
1m 1m
We see that the right-hand side of the equivalence is 1m divided by itself. Anything divided by itself is 1, so let's replace that 1m/1m ratio with 1:
We can also make the division calculation using the numbers 1000 and 1, and save the unit ratio on the left:
Code:
mm
1000 -- ≡ 1
m
1 ≡ 1000 mm/m
Now we have a rationale for multiplying the length of 0.57m by 1000, because it is not merely some arbitrary value of 1000 that we blindly pulled from Google, we now understand it to be 1000
mm/m, and it is
equivalent to 1. And the multiplicative identity property states that when you multiply a quantity by 1, you get that same original quantity. In this case, we multiply 0.57m by 1 i.e. by 1000mm/m:
Code:
mm mm [COLOR=Blue][B]m[/B][/COLOR] mm
0.57 m * 1 = 0.57 m * 1000 -- = (0.57 * 1000) m * -- = 570 ----
m m [COLOR=blue][B]m[/B][/COLOR]
The blue [
m]'s in the numerator and denominator "cancel (anything divided by itself is 1),: and we are left with
570mm, which is equivalent to 0.57m, the original quantity, because although we multiplied by 1000
numerically, we were instead multiplying by 1 (=1000mm/m)
conceptually.
Carrying that concept to the query posed in the OP of this thread, see the following image:
- The top-left plot describes the relationship of the input pressure (PSI) and output current (mA) of the transducer/sensor.
- Start with a pressure on the horizontal axis, go up vertically until you hit the brown line, then go horizontally to the vertical axis to get the current (mA) corresponding to that pressure.
- The top-right plot describes the relationship of the input current (mA) and the output digital Data Number (DN) of the PLC's analog input module (with the caveat the the OP's module will not use the range 51-255DN).
- Start with a current (mA) from the top-left plot on the vertical axis, go right until you hit the blue line, the go down vertically to the horizontal axis to the the DN corresponding to that DN, and by implication the DN corresponding to the pressure from the top-left plot.
- You can also run this backwards, from DN on the horizontal axis on the top-right plot up to the blue line, then horizonatlly to mA on the vertical axis, then over to the top-left plot and the brown line, then down vertically to the horizontal axis to get PSI.
- The red line shows the conversion path for a pressure of +0.25PSI, to 16mA from the transducer and into the analog input module, and finally to 204DN inside the PLC.
- The bottom two sketches remove all of the window dressing of the plots and show the linear relationship using similar triangles: the ratios of the legs of any triangle representing the linear relationships, from PSI to mA and from mA to DN, are constant.
That is the graphical representation of the two-step process that converts an analog pressure in the range [-0.500:+0.500] PSI; the first stop converts it to an analog current in a second
equivalent range [4:20] mA, which is the signal output by the transducer/sensor; the second step converts that analog current signal to a digital Data Number (DN) in a third
equivalent range [51:255] DN value in the PLC, which digital value is the output of the A/D (Analog-to-Digital) converter of the Analog Input Module of the PLC.
Here "equivalent" means that a analog pressure of -0.500PSI input to the transducer is equivalent to a tranducer/sensor output analog current signal of 4mA, and an analog current signal of 4mA input to the PLC analog input module is equivalent to a digital DN of 51 output from that module; also equivalent are the upper limits of the ranges i.e. +0.500PSI ≡ 20mA ≡ 255DN.
A small twist was added in that the bottom of all of those ranges (-0.5PSI; 4mA; 51DN) is not zero, but that would be the same as re-phrasing our length example above by saying "an object is 0.57m past the end of a 1000mm-long stick, where the beginning of the stick is against the wall of a building; how far is the object from that wall?" Obviously the answer is 1570mm i.e. [1000mm from the wall to the end of the stick, plus (0.57m * 1000mm/m) = 570mm from the end of the stick to the object] (assuming the object is in line with the stick centerline, for those following pedantically
).
In the same way in the current thread, we solve the problem by making all of the measurement relative to the bottom of the range. An as yet unspoken assumption is that the relationships, between pressure and current and between current and DN, are
linear; this is shown in the image above by the plots of the relationships being a the brown and blue
lines.
We have two values, both equivalent to 1: 16mA/PSI; 12.75DN/mA, so we can use those to scale a pressure from PSI to mA, and then scale that mA result to DN. We can also run the conversion in the opposite direction by taking the reciprocals of those values (1 divided by 1 is still 1): 1/(16mA/PSI) ≡ 0.0625PSI/mA; 1/(12.75DN/mA) ≡ ~0.0784314mA/DN.
If we have a DN of 204 (from a pressure of +0.250PSI), we subtract the bottom of the DN range of 51 from it to get 153 DN, multiply that by 0.0784...mA/DN to get 12mA, which means the incoming analog signal was 16mA (12 + 4), then multiply that 12mA by 0.0625PSI/mA to get 0.75PSI, which is the offset from -0.500 the bottom of the pressure range, so if we add those together we get +0.250PSI i.e. the original pressure.
We can also skip the intermediate conversion to mA and convert directly from DN to PSI:
Code:
mA PSI mA PSI PSI
1 * 1 ≡ 0.784.... -- * 0.0625 --- = ~0.004902 ------ = 0.004902 ---
DN mA mA DN DN
So the value 0.004902PSI/DN is yet another "value of 1" that we can use to scale DN offsets to PSI offsets:
A DN of 204, which is offset by 153 from the base DN of 51 becomes an offset of 0.75PSI (= 153DN * 0.04902PSI/DN) from the base pressure of -0.500PSI), resulting in a final pressure of +0.250PSI (= -0.500 + 0.750).
Take your time, try to understand this: if you can multiply by 1, I understand it may be an oversimplification to say you can be an engineer, but it really not all that far from the truth.
[Update: you may or may not understand what I did here; if not, then I suggest you search this forum for words like "scaling" or "analog conversion" or "engineering units" an read some of those threads. Perhaps one of those will click with you.]