Hello,
I have a resistive fuel level gauge going into an analog input for the PV780. I see there is a 400 ohm pull-up resistor on this input, and an area for 'scaling curves.'
I have 2 questions:
How does the pull up resistor affect the raw data, i.e. IO.Analog Input 1? Fuel sender is standard 240 - 33 ohms.
How does the 'scaling curve' feature work? I was just going to use the raw data and upon change do a calculation event to get %, seems easy enough, but if there is a standard curve I can load and be done, even better!
PS - Not sure if this matters, but I am starting from imported PV750 program to preserve the graphics.
Thanks,
Phil
PV780 Analog input scaling curve
- drphil69
- Posts: 139
- Joined: Wed Mar 02, 2011 5:59 pm
- jpratt
- Enovation Controls Development
- Posts: 222
- Joined: Mon Jun 21, 2010 11:18 am
Re: PV780 Analog input scaling curve
The scaling feature is a way of defining a non-linear (or linear) calculation to be applied to the voltage of the analog input prior to it being written to the variable value. My understanding of the Analog is that we normally write the raw voltage (I believe after any resistance etc) to the variable. The scaling feature lets you convert this to a value you want without having to do extended programming. For example, you might have a temperature sensor that has a non-linear voltage. Curves allow you to define a curve to translate from the volts to the Celsius/Fahrenheit value directly before its written to the database.
Jake Pratt
Software Development Manager
Software Development Manager
- drphil69
- Posts: 139
- Joined: Wed Mar 02, 2011 5:59 pm
Re: PV780 Analog input scaling curve
I am providing this in case someone else needs the solution or needs to understand how the inputs to color displays work.
The color displays provide the data in "counts," i.e., IO.Input1 is in units of counts.
Counts are a scaling, 0 - 5 volts = 0 - 1023 counts.
Volts measured at input pin = counts * 5/1023, call this Vm.
Pull-up voltage is 5.00 volts.
Pull-up resistor is listed when you choose resistive input, not sure if it is always 400 ohms, call this Rp.
Resistance at input pin is Rp*5/(5-Vm) - Rp, call this Rm.
For fuel sender, 240 - 33 ohms (240 = 0%, 33 = 100%):
% lvl = 115.94 - (100/207)*Rm. (This is just linear conversion of ohms to fuel level.)
To write the code in 2.6, I chose the easy way.
Upon change of IO.FuelLevel (renamed from input 1),
Calculate Vm = IO.FuelLevel*5/1023. (this is voltage at input pin)
Upon change of Vm,
Calculate Rm = 400*5/(5 – V) – 400 (400 ohms is pull-up to 5 volts).
Upon change of Rm,
Calculate %FL = 115.94 –((100/207)*Rm). (Converts 240-33 ohm sender to 0 – 100% for gauge)
This case is exact for Murphy 100 fuel or pressure senders.
Phil
The color displays provide the data in "counts," i.e., IO.Input1 is in units of counts.
Counts are a scaling, 0 - 5 volts = 0 - 1023 counts.
Volts measured at input pin = counts * 5/1023, call this Vm.
Pull-up voltage is 5.00 volts.
Pull-up resistor is listed when you choose resistive input, not sure if it is always 400 ohms, call this Rp.
Resistance at input pin is Rp*5/(5-Vm) - Rp, call this Rm.
For fuel sender, 240 - 33 ohms (240 = 0%, 33 = 100%):
% lvl = 115.94 - (100/207)*Rm. (This is just linear conversion of ohms to fuel level.)
To write the code in 2.6, I chose the easy way.
Upon change of IO.FuelLevel (renamed from input 1),
Calculate Vm = IO.FuelLevel*5/1023. (this is voltage at input pin)
Upon change of Vm,
Calculate Rm = 400*5/(5 – V) – 400 (400 ohms is pull-up to 5 volts).
Upon change of Rm,
Calculate %FL = 115.94 –((100/207)*Rm). (Converts 240-33 ohm sender to 0 – 100% for gauge)
This case is exact for Murphy 100 fuel or pressure senders.
Phil