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. -
@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? -
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...
-
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! -
@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.
-
@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 (...cheap noname from china...) 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... -
- Can you confirm that you are using external drivers with optically-isolated inputs?
- How close to the PT100 cable do the stepper motor cables run?
- What sort of stepper motor cables are they?
- How are you providing power to the external drivers?
- 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.
-
@dc42 said in PT100 better wiring and software M305 settings:
Can you confirm that you are using external drivers with optically-isolated inputs?
How close to the PT100 cable do the stepper motor cables run?
What sort of stepper motor cables are they?
How are you providing power to the external drivers?
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.- yes
- tried away/separated and close/allcablestogether; did not change anything as soon as motors are on
- those are "FABER EFK 300 CP" "straight-internally"(alltogether a little bit twisted)-outerbraidedshield-cables (Could twisted pair be of any benefit here? either twistedpair for the stp+/stp- & dir+/dir- & en+/en- and for the Z-axis and e-axis which are driven direct with the duet2-trinamic-drivers I could swap to twisted pair for A+/A- & B+/B-...?)
- Only one switching powersupply meanwell 24V is powering everything so far (I am thinking about changing the powersupply to a "trafo"-powersupply lower EM-Noise...), so a cable with shield is going to each motor
- I tried grounding everything to PE which was worse even when motors were off, now I have two groundings: 1st all shields of motors are connected to PE, 2nd) all other shields are connected to Vdc-(GND) of the switching supply with one big 1M-Ohm resistor before the "final" cable goes into the PSU to avoid having a short, or if having one at least not a catastrophic one...
For the rest of the printer: The frame and "outer"-Metalparts are connected to PE, the "internal" parts like hotend are connected to the same Vdc-(GND)
So far I can print if I preheat manually. Also the PID-tuning works with this setup. BUT: When printing with no manual preheating it throws an error because of course if a print gets started, the motors get started and then there is all the noise again...
As said: After thinking a while about it, maybe changing the switchingsupply to a toroidal-transformer with rectifier+capacitors (+inrush/start-limiter, etc.) could maybe be a real benefit?
Would the twisted-pair-cable-rewiring help?
Will report when I have more news...
-
Twisted pair wiring for the stepper motors may help, but you must use one pair for each motor phase. The wiring for the step/dir/en signals between the breakout board and the external drivers is not critical, assuming that the external drivers have the usual optically isolated inputs.
Is your PSU definitely adequate for those external stepper drivers plus the heaters?
-
@dc42
Thanks for coming back on this!
I have also some news:- Phoned around and found a nice company that is reseller of "daitron"-PSUs and they gave me a test unit for which they will only charge me if I keep it, put it in on the weekend and have to say: It is MUCH better then anything I have known before of... they are "bloody" expensive, but since the printer is not for me I have to bite that apple... at least it is a test-unit for which I get a discount...
- new twisted-pair-moving-application-shielded-cable for the extrudermotor that is close to the heater-sensor (...direct-drive-setup...) will arrive this week
Question:
- A friend advised me to extensivly use M84 whereever I can and this works great! BUT: I have the feeling that with the latest firmware, M84 will also kick out any homing done if it is used for X/YorZ on a cartesian... (I can only turn off E0=a.k.a. "the problem motor", all other motors (in my case of course only Z) to "1"% idle-hold which is "at least 100mA" quoted from https://duet3d.dozuki.com/Wiki/Gcode#Section_M906_Set_motor_currents) -> So could this in the next releases be able to lower it even more (at least for the extruder-motors for direct-drive-setups with noise-problems like mine), that if somebody forgets to call M84 E0 it will automatically be lowered even below 100mA...?
-
@dc42 said in PT100 better wiring and software M305 settings:
Twisted pair wiring for the stepper motors may help, but you must use one pair for each motor phase. The wiring for the step/dir/en signals between the breakout board and the external drivers is not critical, assuming that the external drivers have the usual optically isolated inputs.
Is your PSU definitely adequate for those external stepper drivers plus the heaters?
"Old" one was 1000W, new "Daitron" is 300W, so let´s calc for the new one:
- 65W heater (M84 E0 is called when heating up and no movement in x, y & z)
- 2,4A in Z = 57,6W -> But with M906 I1 it always get´s down to those 100mA...
- ca. 0,8A for E = 19,2W -> But with M906 I1...
= 141,8W so far
- fans
- duet
not more than 200W?
-> So in worst-case the external-drivers have 100W left, each 50W...
-> external steppers have also current-reduction on standstill which is "auto"(matic) and I have to find out how much it is... and how much they suck in worst case...
checking this numbers I also could have taken your expansion-board (ha!) if I only knew before I would have ended up with those 300W... -
@lb said in PT100 better wiring and software M305 settings:
A friend advised me to extensivly use M84 whereever I can and this works great!
Ignore that. It may be true for Marlin and other ancient firmwares, and for any electronics that doesn't have software-controllable stepper motor current; but it's not true for RepRapFirmware/Duet. RRF reduces the stepper motor current to the idle percentage when all motors have been idle for the idle time. The idle current and idle time default to 30% and 30 seconds, but they can be changed in the M906 command. The idle current is enough to hold the motor positions, but reduces the power consumption and heat generation. Whereas if you disable motors using M84 or M18, then when you power them up again they may jump to a new position 4 full steps from the one they were in when you powered them down. That's one of the reasons why dual Z motors get out of sync, and it's why RRF flags motors as not homed when you turn them off using M18 or M84.
Powering motors down at the end of a print is OK if you home the printer before each print, and either you don't have dual Z motors or you do but you drive them independently and level them before each print.
On delta printers it is sometimes necessary to increase the idle current to around 60% in order to maintain motor position.