Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Setup/Calibrations OFFSET Parameter for Left and Right TCs are Too Course #232

Open
borland1 opened this issue Aug 31, 2022 · 2 comments · May be fixed by #235
Open

For Setup/Calibrations OFFSET Parameter for Left and Right TCs are Too Course #232

borland1 opened this issue Aug 31, 2022 · 2 comments · May be fixed by #235

Comments

@borland1
Copy link

borland1 commented Aug 31, 2022

The Calibration OFFSET’s need a smaller increment amount to provide more accurate calibration.
In Setup Menu, both Left and Right TC OFFSET parameter only adjusts in 0.25C increments.

Suggest that both OFFSET parameters provide for increments of 0.10C.

Also, when OFFSET values are greater than 3 significant digits, the firmware rounds down the parameter value to only 3 digits ( e.g., 9.50, 9.75, 10.0, 10.2, 10.5, 10.7, 11.0, etc. ). So, decreasing the increment to 0.1C would also fix this problem.

Code snippet from file setup.c, lines 26 thru 33:

static setupMenuStruct setupmenu[] = {
	{"Min fan speed    %4.0f", REFLOW_MIN_FAN_SPEED, 0, 254, 0, 1.0f},
	{"Cycle done beep %4.1fs", REFLOW_BEEP_DONE_LEN, 0, 254, 0, 0.1f},
	{"Left TC gain     %1.2f", TC_LEFT_GAIN, 10, 190, 0, 0.01f}, 
	{"Left TC offset  %+1.2f", TC_LEFT_OFFSET, 0, 200, -100, 0.25f},            < ------
	{"Right TC gain    %1.2f", TC_RIGHT_GAIN, 10, 190, 0, 0.01f},
	{"Right TC offset %+1.2f", TC_RIGHT_OFFSET, 0, 200, -100, 0.25f},           < ------
};

Some Background:

I installed the latest firmware, so that calibration settings are at the defaults.
T962reflow3

However the mainboard’s 27L2C chip, a dual operational amplifier, has a significant amount of inherent offset on the oven’s left thermocouple.
T962reflow4

The K-type thermocouples that this oven uses are quite linear in the range that the oven operates at. This is as shown in the plot below
T962reflow7
Thermocouple table data is from: https://www.tc-inc.com/thermocouple-information/type-k-thermocouple-output-table.html

Pre-calibration, using the Manual/Bake Mode, I recorded data of set temperatures vs. displayed temperatures at a series of set temperatures. This data when plotted shows that the ovens displayed temperatures are quite linear. This confirms that the electronics (operational amplifier) seems to in acceptable condition before being calibrated to more precise values.
T962reflow8

Calibration for my T-962 oven was as follows:
For the calibration procedure, I used a TM-902C thermocouple temperature meter with K-type thermocouple probe. I mounted the probe tip using copper wire, such that probe tip, was at the same height and within 2mm of touching T-962 oven’s thermocouples.

T962reflow11
T962reflow12

The oven’s thermocouples are located at a height just above the tray sides. I only have one TM-902C meter, so I did this once each, for left and right oven thermocouples.

I then used the Manual/Bake Mode to record steady state data of both displayed temperatures on the oven’s LCD and the TM-902C meter.

T962reflow20

I then used an online linear regression calculator to find a best fit line for both left and right thermocouples. This provided a linear equation (shown above) which I used to calculate the slope and X-axis intercept. Using these values, then translating the line to intercept the X axis at zero degrees C ( also shown above ). The slopes (gains) and intercepts (offsets) amounts are then used to calibrate the oven in the Setup Menu.

T962reflow17

Unlike the GAINs settings, the T-962 oven’s circuit board has no provisions for adjusting operational amp’s two output OFFSET’s, which are operated in non-inverted arrangement, it only has fixed 1K ohm resistors at the op amp outputs on each channel.

I have also ordered a pin compatible precision operational amplifier chip (Analog Devices AD8552 ) which I plan to use to replace the 27L2C dual op amp chip. The AD8552 chip has sampling with very low offset and zero drift.

@borland1
Copy link
Author

borland1 commented Sep 28, 2022

I have since replaced the factory installed 27L2C dual OpAmp with a pin compatible Analog Devices AD8552 ( part number AD8552ARZ ). The AD8552 also a dual OpAmp, but with zero drift ( 0.005uV/C ), and low offset voltage (1uV),

I did de-solder the two blue trim pots (gain) to give me more room for de-soldering with a hot air rework station, but reused them. They still have the factory installed silicone rubber covering the set screws.

Here's a photo of the factory installed 27L2C dual OpAmp.
T962reflow14

And the after photo showing the AD8552 installed in its place.
T962reflow13

This is the before Setup and Manual/Bake LCD screens
T962reflow3

T962reflow4

And the after screens...
T962reflow15

T962reflow16

The trim pot settings (gains) are still at the factory settings. Notice from the photo above, that the displayed left and right TC temperatures are much closer now, Not sure how each gain is now set, but I will find out after re-taking oven calibration data like I showed in prior post.

Here's the recalibration data for the oven with the new dual Op-Amp. Calibration method, same as prior post.

T962reflow22

T962reflow21

T962reflow18

T962reflow19

@CoryCharlton CoryCharlton linked a pull request Oct 31, 2022 that will close this issue
@borland1
Copy link
Author

borland1 commented Sep 10, 2023

There are limits to how fine the LCD Setup Menu adjustments can be easily made. This is because the settings are saved to limited EEPROM space and the fact that the associated variables 'minval', 'maxval', and 'offset' are saved in EEPROM space as 8-bit integers.

See in header file setup.h:

typedef struct {
	const char* formatstr;
	const NVItem_t nvval;
	const uint8_t minval;
	const uint8_t maxval;
	const int8_t offset;
	const float multiplier;
} setupMenuStruct;

As an example, uint8_t is 1-byte unsigned with range of only 0 to 255, while int8_t is 1-byte signed with range of only -128 to 127.

Here are some acceptable changes that increase the resolution of LEFT and RIGHT TC's, for both GAIN and OFFSET values, configured in the LCD Setup Menu, with the following changes made to file setup.c.

static setupMenuStruct setupmenu[] = {
	{"Min fan speed    %4.0f", REFLOW_MIN_FAN_SPEED, 0, 254, 0, 1.0f},
	{"Cycle done beep %4.1fs", REFLOW_BEEP_DONE_LEN, 0, 254, 0, 0.1f},
	{"Left TC gain    %1.3f", TC_LEFT_GAIN , 150, 250, 50, 0.004f},    //  <-------
	{"Left TC offset  %+1.1f", TC_LEFT_OFFSET, 0, 250, -125, 0.20f},   //  <-------
	{"Right TC gain   %1.3f", TC_RIGHT_GAIN, 150, 250, 50, 0.004f},    //  <-------
	{"Right TC offset %+1.1f", TC_RIGHT_OFFSET, 0, 250, -125, 0.20f},  //  <-------
};

Note the blank spacing changes in the text labels, before the "%", as this changes the position of the displayed text on the LCD Setup menu. Changes also corrects for the current inverse texting artifact at the far right of the display, when LEFT or RIGHT TC OFFSET values are too negative (compare the two images shown below).

The above changes will allow setting:
Left and Right TC Gains in range of values between 0.800 and 1.200 in increments of 0.004, and
Left and Right TC Offsets in range of values between -25.0 and +25.0 in increments of 0.2 degrees C.

Setup Menu with above changes...
T962SetupMenu

For comparison, Setup Menu with stock firmware V.0.5.2...
T962reflow18

To get the above changes to work with the oven TC sensors, some additional changes are needed in files setup.c, setup.h, and sensor.c. Similar to what's done in the setup code file, the sensor code file also converts RAW data values read from EEPROM memory, into real data values (i.e., the Left and Right TC Gain and TC Offset ) shown on the LCD display Setup/Calibration Menu, using the data conversion parameters (i.e., offset and multiplier). The conversion parameters were hard coded in the sensor code file too, so rather than manually editing the hard coding in two separate files, the following changes eliminate the need for that.

Specifically, in file setup.c,
image

change line 26, as follows..

    const setupMenuStruct setupmenu[] = {

In file setup.h,

image

add a new line, after line 12, as follows..

    const setupMenuStruct setupmenu[6];

In file sensor.c,
image

add a new line, after line 11, as follows..

    #include "setup.h"

Also in file sensor.c,
image

change the following lines,

line 44, as follows..

   adcgainadj[0] = ((float)temp + setupmenu[TC_LEFT_GAIN].offset) *
						setupmenu[TC_LEFT_GAIN].multiplier;

line 51, as follows..

   adcgainadj[1] = ((float)temp + setupmenu[TC_RIGHT_GAIN].offset) *
						setupmenu[TC_RIGHT_GAIN].multiplier;

line 58, as follows..

   adcoffsetadj[0] = ((float)temp + setupmenu[TC_LEFT_OFFSET].offset ) *
						setupmenu[TC_LEFT_OFFSET].multiplier;

line 65, as follows..

   adcoffsetadj[1] = ((float)temp + setupmenu[TC_RIGHT_OFFSET].offset ) *
						setupmenu[TC_RIGHT_OFFSET].multiplier;

That is all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant