News:

  • October 01, 2025, 01:29:36 PM

Login with username, password and session length

Author Topic: Doing it correctly  (Read 2162 times)

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Doing it correctly
« on: October 17, 2018, 06:32:27 AM »
My setup: F2-04thm, Says it is a 16bit resolution (65535). I am using a J-Thermocouple range 32-1330 degrees F as per the spec sheet.
H2-DM1E. Location for the Thermocouples are WX0 thru WX3.  I take WX0 and WX1 add them and take the average. Then put that into N0. N0, being a single word.
I might be getting mixed up looking at the resolutions. I want to feed N0 into my PID block. So Raw PV is N0, Raw Min=0, Raw Max=4095 Eng min=32, Eng Max=1330.
I used the spec sheet for the thermocouples to get the 32 and 1330 numbers. Hope that is what I am suppose to do. I am worried about the Raw numbers. Am I losing resolution? Should I be using "D" memory instead of "N" memory? Then put 65535 instead of 4095?

Just to finish it out, I take the PID.output and put that into the TIMEPROP to get a bit output. I did not do the auto-tune yet until I get the PID setup correct.

brucek

  • Sr. Member
  • ****
  • Posts: 59
Re: Doing it correctly
« Reply #1 on: October 17, 2018, 07:02:31 AM »
I think you have everything right except RAW MAX. It should be 65535 if that is 16 bit resolution. N might not be the best usage as its signed so 16 bit resolution could make the sign bit go high and negate the temp. V is unsigned and R is always an option.

ADC Product Engineer

  • Hero Member
  • *****
  • Posts: 270
Re: Doing it correctly
« Reply #2 on: October 17, 2018, 08:50:42 AM »
You will still have the same resolution, just spread over a larger scale. 

Think about it.  Resolution = the number of counts that you have to work with

The thermocouple reads directly in degrees with one implied decimal point.  You take and multiply that number by 10.  It's still the same resolution.  You multiply by 1000, it's still the same resolution.  You divide by 1000, it's still the same resolution.  You haven't changed anything except the decimal places.  The counts are still the same.

So your thermocouple is 32.0 degrees (300 counts) to 1300.0 degrees (13000 counts).  That is 12680 counts (or steps if you want to think of it that way)  You can reduce the number of counts by doing integer math, but you can't get more counts by multiplying. 

32.0*2 to 1300.0*2 still has 12680 counts (or steps). You have just increased the number spread by a factor of 2.

(32.0*1000 to 1300.0*1000)/4095 still has 12680 counts (or steps).  You have increased the number spread between counts (or steps), but you haven't increased resolution.

All you have changed is the count of numbers between each step.  You haven't added any additional counts.

Now if a larger number scale will improve math resolution, then you have something.  But since PID is already doing Floating Point, I sincerely doubt this helps much.