topic_unsolved Help with non standard temperature sensor config
Pete_A last edited by Pete_A
I am interfacing a Duet expansion connector to pre-existing printer hardware and need some help with the temperature sensors.
Specifically, the hardware uses thermocouples and has its own signal conditioning which presents the Duet temperature pin with 6.6mV / degree C.
I'm not sure how to set up the G code to make it work. I also need to figure out how to reassign the temperature pins from the expansion connector to be read as E0, E1 and bed temperature sensors.
I am currently running RRF3 firmware.
Any help greatly appreciated.
Specifically, the hardware uses thermocouples and has its own signal conditioning which presents the Duet temperature pin with 6.6mV / degree C
The easiest way will probably to use the themocouple daughter-board:
In RRF 3 you would reference the pins as described here:
M308 S2 P"spi.cs1" Y"thermocouple-max31856"; define temperature sensor number 2 as a default, K Type thermocouple on the first port of a temperature daugher board plugged into the Duet 2.
Alternatively you might be able to get get away with the "linear-analog sensor type with the existing thermocouple interface, I have never tried that.
@T3P3Tony Thanks Tony, I appreciate your taking the time.
I had started looking a the analog-linear G-Code and I suspect this is the way I will need to go.
Achieving a direct connection between the existing thermocouples and the Duet thermocouple daughter board isn't going to be achievable; one of my design constraints is I must be plug compatible with the existing chassis and I can not make any permanent modifications.
Once I assign a non standard ADC pin as a particular temperature input, do I need to 'un-assign' the default input pin for that input somehow ? Or does the firmware accept only the most recently assigned input pin ?
I will report back on any success using analog-linear
TL:DR success using analog-linear.
I have one (of three) thermocouples working using analog-linear, so the software handles the ADC correctly. The other two thermocouples have a different signal path and I need to figure out what is different in how the chassis handles them.
I also need to work out the exact scaling factor for the thermocouple I can read but that should just be a case of looking at the configuration around the signal conditioning IC (ran out of time today).
On further digging, I'm having issues getting the calibration factors configured correctly.
My signal source is configured for 10mV / degree C.
I have spent a heap of time iterating the zero and max cal figures with the most useful setting being a zero of 70 and a max at 260 (from memory). These figures get me close to correct indications between 190 and 220C. The description for Analog Linear temperature sensor
Biggest issue currently is that my readings top out at 229C indicated by the Duet but actual hotend temperature continues to climb.
I know I need to go back through the OEM signal path and figure out exactly what is happening. This probably isn't helping my interpretation of the sensor description; the sensor test point does do 10mV/C as expected but it is going wonky somewhere downstream from there.
One idea I am thinking about is changing ADVREF from 3v3 to 5v. This way I can remove the 3v3 zener clamp from the signal path.
I'm also starting to consider building a replacement signal conditioning board to convert the TC's to SPI signalling.
One idea I am thinking about is changing ADVREF from 3v3 to 5v.
If you are talking about ADVREF on the Duet, you will blow the microcontroller if you do that.
You could use a voltage divider to reduce the output from 10mV/C to around 6.6mV/C. If you are using a standard thermistor input on the Duet you must also allow for the 4K7 or 2K2 resistor between the input and ADVREF. For example, 1K between your thermocouple amplifier output and the thermistor input, and 2K from thermistor input to ground.
Note, using an analog input to read a thermistor makes the accuracy and stability of the reading dependent on several components in the amplifier and on the stability of ADVREF. That's why our daughter board uses a MAX31856 chip instead.