PT100 better wiring and software M305 settings



  • Hi,
    regarding having a PT100 on the daughterboard and using it with M305 (https://duet3d.dozuki.com/Wiki/Connecting_PT100_temperature_sensors#) I would like to start a discussion what could be done to have the most satisfying experience (stable values) here!

    Small research shows you can get probs when starting with not ideal wiring e.g.:
    https://forum.duet3d.com/topic/366/pt100-wiring/5
    https://forum.duet3d.com/topic/2702/problem-with-pt100/9
    https://forum.duet3d.com/topic/4915/pt100-fault/8
    -> It seems "twisted pair"+shielding (to mains-earth?) seems to be the right way to go?
    -> Also 4wire seem to give more stable values then 2-wire (with the twisted pairs c for cable and db for daughterboard like c1-db1 c2-db4 & c3-db2 c4-db3, so the inner 2 and outer 2 terminals of the daughterboard each get one twisted pair?)

    Checked the web and there are a lot of very good quality "shielded twisted pair ethernet cables" out there even with 2*2 twisted pair and up to 1mm^2! Will try one of these?

    Regarding M305 -> Rumors are the 4wire-setup will cancel out the cableresistance if 4 wires are (in an ideal world) separated until soldered together as close to the actual sensor as possible? Just to learn: Can somebody jump in here and explain?

    In a 2wire setup if there the resistance is not canceled out, can I handover the calced/measured cableresistance in M305 for a PT100 to "re-calibrate" it out of the way?

    Frequency is mains-frequency? E.g. Germany 230V/50Hz, so I put the 50 there?

    Thankfull for everyone that helps me understand this topic!



  • Maybe i am just the lucky one or...isnt that all so complicated, anyway my example:
    Duet PT100 daughterboard, E3D PT100 temperature sensor, 2-wire connection with bunch of other wires (2 fans, probe, heater, endstop) and in config.g just M305 P1 X200. No any problems whatsoever.


  • administrators

    @lb said in PT100 better wiring and software M305 settings:

    -> It seems "twisted pair"+shielding (to mains-earth?) seems to be the right way to go?

    That's the ideal, although in many situations it would be overkill. If the PT100 cable will run parallel to a stepper motor cable for a significant distance, then you may need to use this type of cable.

    -> Also 4wire seem to give more stable values then 2-wire (with the twisted pairs c for cable and db for daughterboard like c1-db1 c2-db4 & c3-db2 c4-db3, so the inner 2 and outer 2 terminals of the daughterboard each get one twisted pair?)

    I'm not sure that 4 wire would be more stable than 2 wire; but if you do use 4 wire, then yes one pair for the inner 2 and one pair for the outer 2 connections.

    Regarding M305 -> Rumors are the 4wire-setup will cancel out the cableresistance if 4 wires are (in an ideal world) separated until soldered together as close to the actual sensor as possible?

    That's correct. See https://en.wikipedia.org/wiki/Four-terminal_sensing.

    In a 2wire setup if there the resistance is not canceled out, can I handover the calced/measured cable resistance in M305 for a PT100 to "re-calibrate" it out of the way?

    M305 does not allow you to calibrate out the cable resistance. If you use the R parameter to cancel it at room temperature, then you will introduce errors at higher temperatures.

    Frequency is mains-frequency? E.g. Germany 230V/50Hz, so I put the 50 there?

    Yes.



  • @dc42 said in PT100 better wiring and software M305 settings:

    @lb said in PT100 better wiring and software M305 settings:

    -> It seems "twisted pair"+shielding (to mains-earth?) seems to be the right way to go?

    That's the ideal, although in many situations it would be overkill. If the PT100 cable will run parallel to a stepper motor cable for a significant distance, then you may need to use this type of cable.

    -> Also 4wire seem to give more stable values then 2-wire (with the twisted pairs c for cable and db for daughterboard like c1-db1 c2-db4 & c3-db2 c4-db3, so the inner 2 and outer 2 terminals of the daughterboard each get one twisted pair?)

    I'm not sure that 4 wire would be more stable than 2 wire; but if you do use 4 wire, then yes one pair for the inner 2 and one pair for the outer 2 connections.

    Regarding M305 -> Rumors are the 4wire-setup will cancel out the cableresistance if 4 wires are (in an ideal world) separated until soldered together as close to the actual sensor as possible?

    That's correct. See https://en.wikipedia.org/wiki/Four-terminal_sensing.

    In a 2wire setup if there the resistance is not canceled out, can I handover the calced/measured cable resistance in M305 for a PT100 to "re-calibrate" it out of the way?

    M305 does not allow you to calibrate out the cable resistance. If you use the R parameter to cancel ti at room temperature, then you will introduce errors at higher temperatures.

    Frequency is mains-frequency? E.g. Germany 230V/50Hz, so I put the 50 there?

    Yes.

    Thanks so much ! - asked this after I tried with a simple cable but with my 3meters and more because of the huge build, I got reading-deviations of more then +-2.5ยฐC even at room temp which is not stable at all and was causing to stop/cancel the calibration-sequence for the heater... Will go with a 2(2)c)c twisted pair of ethernet-cable with shield to see if that will eliminate the "noise-floor"



  • @dc42
    O.K. so I installed a "TP" (twisted-pair) shielded cable (2x(2x0,25))C in 4-wire-configuration and the cross-talk/influnce from the extruder-motor and fans is completely gone! (Shielding was first not so good with shield only hooked up on one side of the cable to mains-earth and got really good with both sides hooked up to GND) Yeah! Can finally do the calibration successfully...
    BUT...
    I have some strange ocassional HUGE spikes independent of fans, extruder, heater, etc. . I have a screenshot attached that shows it.
    Does anybody have a clue what that could be?

    0_1551901837124_spikes_auto_calibration.JPG


  • administrators

    If you are running recent firmware then you can send M305 P1 to get the most recent error report for heater 1. That may give a clue.



  • @lb said in PT100 better wiring and software M305 settings:

    ...(Shielding was first not so good with shield only hooked up on one side of the cable to mains-earth and got really good with both sides hooked up to GND)...

    Shielding earth connection is normally recommended for one side of the cable only. Usually that is the end near the processor. There is a risk that the shielding could be used as a conductor if the heater cartridge shorted to the hotend.

    Before you did that your hotend would have been at a floating voltage unless already grounded. Try adding a seperate ground wire from the hotend (cool end of heatsink maybe ok) to the earth point and while you're at it ground the body of the stepper to the same earth point.

    If you already had earthed the hotend then go about your business and ignore me! ๐Ÿ˜„

    Edit: Select earth wires of a suitable rating safely to take the full current of the heater in the event of a short fault.



  • @dc42 said in PT100 better wiring and software M305 settings:

    M305 P1

    Thanks!
    throws back:
    "Heater 1 uses PT100 (MAX31865) sensor channel 200, 2/4 wires, reject 50Hz, reference resistor 400 ohms"

    -> wires "2/4" correct in config.g (?):
    (https://duet3d.dozuki.com/Wiki/Connecting_PT100_temperature_sensors#Section_Troubleshooting)
    โ€œTo connect a 4-wire PT100 sensor:
    [...]
    in the config.g the code M305, variable โ€œWn Configure number of wires used to connect PT100 sensor. Should be [2..4]. โ€œ

    Currently in config.g there is: "M305 P1 X200 F50 W4" (duet2-ethernet FW2.02), is that correct?

    EDIT: In the "Version 2.03beta2" I saw there is something changed about the temperature-calculation ("Increased temperature sampling rate from 2 to 4 samples/sec") -> Could this be a basis for "software-smoothing" with high-pass/low-pass & median-values, etc.... but for sure something like this is already implemented but maybe a factor between 0-1 (firmware-wishlit) for value-smoothing could be introduced to try to iron-out some hardware bugs (in this case from me I know... ๐Ÿ™‚ ) and of course the more vals get median(ed) (I do not like averaging) the less responsive the heater getยดs...



  • @doctrucker

    ๐Ÿ™‚ Thanks! Every idea helps me, I have no clue where those spikes "charge off"...

    The motor is now (when reading your post) already "grounded"/"earthed" since it was the major problem since "very unscientifically" i swapped the pt100-cable and did the motor-housing ground in one workload I would have to try out what had most impact...
    Grounding the heatsink is not a bad idea, since it is like a small antenna near the pt100... hm... hm... hm... well... well... well... that I could try... ;-()
    also the spikes... really curious, looks like a thunderstroke but today was sunny weather (but cold) here AND I installed a "class1" mains-inlet-(230VAC/50Hz)-filter extra to avoid having other machines (fridges etc.) in the building "influencing" the sine-waves ๐Ÿ™‚ Will try some things and report back ๐Ÿ™‚



  • This post is deleted!

  • administrators

    @lb said in PT100 better wiring and software M305 settings:

    @dc42 said in PT100 better wiring and software M305 settings:

    M305 P1

    Thanks!
    throws back:
    "Heater 1 uses PT100 (MAX31865) sensor channel 200, 2/4 wires, reject 50Hz, reference resistor 400 ohms"

    I guess you need to install more recent firmware to get the last error type included in that response. Try 2.02beta2.


  • administrators

    @lb said in PT100 better wiring and software M305 settings:

    @dc42
    This might be a stupid andor very naive thing to ask, because I assume there is much more and better already in place but because of my "spike-problem" I wanted to ask:
    (I am not really good at programming, just did from time to time a small arduino-project, and put together some code I threw always in when I had problems with my wiring, since I am even worse in electrical-wiring (:-( but could you tell me if for people like me something like this is already in or could be thrown into the code for the heater and made accessible although I am aware this would slow down responsivness:

    Smoothing is good when there is noise in a reading, but no good when the sensor reports failure to get a reading. The firmware already allows a few consecutive reading failures before it reports error and returns 2000C. So you are getting a lot more errors than you are seeing in the graph.



  • @dc42 said in PT100 better wiring and software M305 settings:

    @lb said in PT100 better wiring and software M305 settings:

    @dc42
    This might be a stupid andor very naive thing to ask, because I assume there is much more and better already in place but because of my "spike-problem" I wanted to ask:
    (I am not really good at programming, just did from time to time a small arduino-project, and put together some code I threw always in when I had problems with my wiring, since I am even worse in electrical-wiring (:-( but could you tell me if for people like me something like this is already in or could be thrown into the code for the heater and made accessible although I am aware this would slow down responsivness:

    Smoothing is good when there is noise in a reading, but no good when the sensor reports failure to get a reading. The firmware already allows a few consecutive reading failures before it reports error and returns 2000C. So you are getting a lot more errors than you are seeing in the graph.

    Outch! O.K. Sorry - already assumed there is - just had to ask... hmhmhm what can I do next? Funny thing is with Ohmmeter I cannot find anything - will check for loose contacts as next that might only be revealed when the printer is moving because I saw almost no spikes when it stands still but a lot when it moves...

    (Just because of interest: Could you give me a hint to better software-smoothing-algorithms that are more sophisticated then what I posted but not as sophisticated as a "Kalman filter" or so)



  • @dc42 said in PT100 better wiring and software M305 settings:

    @lb said in PT100 better wiring and software M305 settings:

    @dc42 said in PT100 better wiring and software M305 settings:

    M305 P1

    Thanks!
    throws back:
    "Heater 1 uses PT100 (MAX31865) sensor channel 200, 2/4 wires, reject 50Hz, reference resistor 400 ohms"

    I guess you need to install more recent firmware to get the last error type included in that response. Try 2.02beta2.

    With 2.03beta2:

    Heater 1 uses PT100 (MAX31865) sensor channel 200, last error: sensor hardware error, 2/4 wires, reject 50Hz, reference resistor 400 ohms

    Is that something bad: I have noticed that the stack-up-board in my case wiggles quite some bit - should I fix it with some (nonconductive/electronicsspecd) hotglue on the pinrow to avoid that chance of wiggeling?

    Question: As a non-native-english and non-native-coding and non-native-electronics I do not fully understand the 2/4 wires, since in config.g there is the definition as 4-wire-solution?

    UPDATE: IT IS WITH THE MOTORS!!! As long as I reboot completly and all motors have not moved and external motors are still in "ALARM/FAULT" state (that is before first STP/DIR/EN signals) there is no fault with the pt100-sensor no matter how fast /slow and which of the 3 fans is on or off and no matter how much temp 0-280ยฐC the heater has... YUHUU
    I have a feeling that those JMC-motors might smudge and smear the GND which in my case is the shield...


  • administrators

    1. Can you confirm that you are using external drivers with optically-isolated inputs?
    2. How close to the PT100 cable do the stepper motor cables run?
    3. What sort of stepper motor cables are they?
    4. How are you providing power to the external drivers?
    5. Have you grounded VIN-, the hot end metalwork, and the frame of the printer? If not, the stepper motor bodies can pick up noise from the windings, and that noise may be transmitted through metal mechanical parts to the PT100 cartridge case.

 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.