Thermistor wonky when N / L are switched
So my heatbed thermistor (orange) showed weird fluctuations, sometimes random, sometimes very regular.
After a lot of troubleshooting, I noticed it went away when the 230V lines of the heater are not connected. Reconnecting them: wonky again.
I checked all cabling (no change) and then had the idea to switch the plug of the printer around (so switching neutral and live), and now its gone as you can see on the second picture.
So its fixed, but any ideas what was causing those fluctuations? Is that maybe an indication of a bad SSR or something?
Edit: Its still fluctuating, but a lot less.
Additional Infos:
- Thermistor showed same behavior on a different TH-port, while another thermistor on the normal bed port was fine.
- In the first picture the heatbed was off for an extended period, so no power should have been flowing through the bed
edit: Fixed:
See the summary of this post: https://discord.com/channels/582187371529764864/1189608411109793872/1190773155963351112
Fix: Set your heater pwm to anything but a multiple of 50 Hz. For example:
208 Replies
more screenshots of the wonky times
I've been having the same problem since forever. I haven't tried switching live and neutral yet, so I will do so when I'm home. But it makes sense, that a live bed induces a small current in the thermistor wires which influences the measured temperature slightly
Thing is once the bed is heating it is a little wonky again which is not ideal.
And I'm not sure if it does make sense, even when the ssr is switching the neutral wire theres no closed circuit and therefore no current should flow through the bed. And also I would think it should affect the thermistor more regularly or a lot faster, i.e. the 50 / 60 Hz the 230V are running at
But good to know that I'm not the only one seeing this
hmmm it happens again, but a lot less deviation compared to before.
@oskait Finally, another victim! I have been up and down discussing this with RatRig for a while, never finding a full solution. I have ended up making sure that N \ L is always connected in the same way and left it at that.
exactly the same happens for me. The oscillations do not have a constant period, sometimes the frequency of the oscillations slows down (i.e. your "wonky" times)
I can only imagine this being an induction effect, we could try shielding the thermistor wires.
The last comment I received from RR Pedro was to ensure that the Live wire was always the one going through the SSR. If those are switched, Live goes directly to the bed.
Okay so its not just my machine, that is good to know π
I still get some fluctuations with the Live wire going into the ssr, but a lot less as before. I will put the printer in the garage soon, maybe that changes something as well with less consumers running on the same circuit/ breaker
Not sure how well these PSUs filter
You are also running 230? (so not the meanwell variant of the PSU?)
I dont think its the psu, since Live / netral goes directly into the ssr / bed
nope got the normal Weho, but yea 230V (germany)
Perhaps the SSR does not fully "close"
in either case, same issue here, went up and down with RR and Keevono
I'll link them this thread
Alright then I dont have to try i guess π
At first I thought the ground was to blame, I found out my wall plugs didn't actually have a ground wire connected to the pins
Maybe one of those filtered IEC plugs might help.
uff that sounds like a hazard π
that was slightly scary to find out, but wasn't the cause
I was thinking the same, something like this (but a higher nominal power variant)
https://www.conrad.nl/nl/p/schaffner-fn9244-1-06-fn9244-1-06-netfilter-met-iec-connector-250-v-ac-1-a-l-x-b-48-mm-x-22-5-mm-1-stuk-s-554112.html#productTechData
I tested it on mine, reversing the plug (and thus live and neutral) lowers the amplitude of the wave, but not much
Mine also isn't grounded. So that might be it
oh jikes, definitely ground it - certainly the build plate
You may induce a charge on the plate otherwise
Unfortunately that isn't possible in my current situation, ground also isn't connected properly here in the utility closet of my place (shitty rental appartement)
I mean that definitely happens anyway, but unlikely to happen in an unsafe way
Ideally no, but I measured up to ~100 V on the build plate before grounding. You get a small lovetap out of it, very low energy built up on the plate. Still, not ideal
Well my buildplate is connected to the frame and the power supply, so that will automatically dissipate the energy though the air quickly enough that it's not an issue (though please don't take this as any electrical engineering advice, I got academic training in it so my solutions are definitely not for general use)
I believe I also saw higher thermistor undulations before I grounded, but I'm no electrical engineer
Grounding seems like a very likely solution
I had assumed that grounding would solve this, but unfortunately the readout undulations on the thermistor still occur after grounding the bed in the case that the live wire goes directly to the bed heater
Though I'm a bit surprised that this only shows up while the heater is off, not when it's at 100%
in that state, with SSR closed, no current should be running - so I am confused as to how that situation causes a response on the thermistor
You grounded your bed as well right?
yes, I did now
slight leakage to ground?
I'm wondering if the PSU is actually inducing a small current in its own casing, that gets transferred through the grounding into the bed
That could induce an even smaller current into the thermistor wires, but that would be enough for this
surely the PSU casing is grounded
he said without verifying
Oh it is
I checked it, it is grounded as long as you connected the ground wire to the PSU in the designated spot
And that grounding is also there to move the induced currents away from the PSU, but will also be transferred to everything else it can get into. Like the grounded bed
If it is induction, it should still happen during heating / at temperature
perhaps we don't see it due to auto-scaling of the graph
That's the thing that gets me indeed
It's also very hard to spots due to PWM
Ehh, I mean PID
We might shield the thermistor wires with a mesh of sorts
another thing though, the "wonkyness" of the thermistor output isn't constant
while sitting idle, the period of the oscillation can be seen to change dramatically
like in @oskait 's pictures above
You can see the raw numbers in the klipper log
I'll give that a look
all this being said, if more / many people observed this we would see more reports
perhaps something specific to our cases
Lots of things that could cause this, one of them could be the sampling rate is very close but not equal to a multiple of the frequency of the introduced noise
That's a good point, in that case it should repeat
never let it sit long enough to observe that
It looks like it does repeat here
hmmm
I may hook up a scope to the thermistor wires
I should get a scope at some point, but yeah I got way too much tools for my small apartment already π
I feel your pain, hobby projects go in / out of closets here when being worked on
Yeah for me it's not just hobby, in some cases it could save me trips to the lab at work
right, intentionally misconnected N/L now - letting it go for a while and grabbing a scope
Good luck! Let me know what happens
I'm curious
heh
I can see 50 Hz on the thermistor wires with the bed on L while at idle
switching N/L now
and only picking up HF noise on the thermistor when I have N/L as intended
picking ground from the PSU case @kokx.
I think we are just seeing induction from live to the thermistor wires and sampling is causing the wonkyness, as you mentioned
doesn't quite explain why it's not seen when we heat - but maybe the PWM control makes that difficult
PWM probably hides that completely
Ehh, PID
That's basically going to be several waveforms added to each other
ah yes, because it would respond to the thermistor output which is being affected by the induction
In theory if we figure out the amplitude we could probably cancel the wave out of it and make the PID more accurate with some FFF, but I think it that is an amount of work for literally no gain
It seems that your electrical engineering background is deeper than mine, would a grounded metal mesh shielding around the thermistor wires prevent the induction on the thermistor wires?
( I say deeper, i'm a mechanical engineer, it's close to zero - hah)
Potentially, but it could go worse at the same time
could shield the power wires as well
Since we also have it when live is not there, it still think that it's also induced through the PSU grounding the bed
I'm basically curious about what happens when we do not have ground the bed, but make sure that the bed is not live
(I'm currently not close to my printer, otherwise I would try it out myself)
left with N/L wrong, right with N/L right
so it's all but gone in the "correct" installation, but my bed is grounded
rather AND my bed is grounded
Then I'd say turn the plug if needed
that's what we do
but this implies that this still happens when we actually power the bed
Why go for a complicated solution if you have one that can definitely works
Certainly, just to understand the root cause
There is a way to check that, basically put a stable current (say 30%) on the bed
I'm not sure if klipper can do that though
(I wouldn't go for 100, don't want to delaminate the heater from your bed)
hmmm
could set the PID parameters to 1, 0 , 0
or hmm
maybe if klipper lets us use a bit-bang heating control
You basically don't want to set a target temperature but a target load
yes I understand, just trying to think of a way to enforce that
may require an external control on the SSR and avoid trying to do it with klipper
PID 1,0,0 would just give you oscillations if I'm correct
could wire up a microcontroller to control the SSR with a constant duty cycle
just have to keep an eye on the temperature of the bed
That would work indeed
Though yes, make sure your bed doesn't go above 100 degrees this way to be safe
indeed
though, logically, it should be there
Apparantly EMI shielding shrinkwrap is a thing
but that's typically for HF shielding, I wonder if it has any effectiveness at 50/60 Hz
easy way would be to configure the ssr as led and put it on 30% pwm.
but i would closely monitor the temperature as not to trip the thermal fuse
not sure if it is the PSU putting something on ground. during trouble shooting I had ground to the bed but the heater itself disconnected and couldn't see any fluctuations from the thermistor.
I also see a very slight fluctuation now with (i think) properly connected Live and neutral, as well as ground going to the bed. PID is fighting it but on closer look its still not as smooth as other thermistors
I wonder if that is enough. 30% duty cycle would still make it troublesome to measure. You want a 50 Hz source that is power controlled so you can leave it at 100% duty cycle for a while without risking over-heating
but anyway, getting back to the issue at hand - looks like induction from the power cables. I'll post some scope pictures later with my findings
@oskait do you see a difference in performance if you have N\L switched while heating the bed?
hmm I don't think so, but thats just a feeling. Havent measured it or anything
Some scope analysis would be nice, I only have a broken multimeter atm
Should be able to see the 50 Hz on the thermistor wires during heating while the SSR is open if it's there
Just waiting for a print to finish
could you also post some measurements of the thermistor wires with the bed not heating and not heating and N/L reversed?
maybe without the bed heater connected to anything as control as well? That would be awesome.
That is what I did yesterday, but not posted
with Live to the bed and the thermistor wire open to the air, you see the 50 Hz on the thermistor wire
with Neutral to the bed, same situation, you see only HF noise that's typically picked up by anything
I'll re-do and post some pictures later today
Ah you already did. Ok interesting.
In the end though - impact on printing performance with the N\L\Ground properly connected is probably negligible
possibly some improved stability on the bed heating I suppose
yea thats true, After I flipped N/L its not perfect but definitely acceptable for printing.
Just interesting to know the cause and maybe finding a fix like shielding would be nice
1 - N/L connected as intended. Thermistor wire open to the air. We see 50 Hz, rather low potential. Environment? @oskait
2 - N/L connected wrongly. Thermistor wire open to the air. We see 50 Hz, much higher potential. Induction from the bed wire which is now connected to live? Rather crappy sine.
3&4. Both with thermistor connected to the board while switching N/L. No difference
Well first i thought pic 1 and 2 perfectly show what we see when switching N/L, as we get fluctuations with a high and quite low amplitude, which is in line with your measurements.
But that theres no difference when the thermistor is connected to the board is weird.
Is the timescale in pic 1 and 2 the same? Cause it shows 74Hz and 50Hz
Hmm, I hadn't noticed that - checking
ah should be, says 5ms/div. But I have basically no experience on how to read an oscilloscope π
it looks like the reported value was faulty at the moment I took the picture, that is indeed 50 Hz
doing some more checks
If you don't mind, would be interesting whats on the thermistor when its plugged into the board, but the bed heater is disconnected.
Maybe the 50Hz is just the poll rate on the thermistor as well
hmmm, I would need to disconnect the bed
can do, sec
first checking what happens on the thermistor when I engage heating
yea no worries. Thank you a lot for those measurements, I find it quite interesting
maybe I need to get a scope myself π
interrestingly, nothing changes on the thermistor wires while connected to the board when enabling heating
with N/L connected as intended
nothing meaning no change
So same as pic 3/4? interesting.
Now have N\L connected wrongly
watching the temperature graph going up and down
with the scope on the thermistor
not able to see any change to the signal
thats weird, if the thermistor or board can pick up changes in resistance and therefore voltage the scope should pick that up to right?
scope measures voltage, not resistance
I was just expecting to see a change in the induced noise on the thermistor when I enable the bed heating
yea but the board measures the resistance of the thermistor via the change in voltage as far as I know
Yea true, its weird
can see the SSR getting the output from the control board
+24v from the psu is also very clean
can see the voltage over the thermistor change as the bed heats
the difference is just very small, so I missed it before
ok, with a more accurate volt meter you can see the thermistor value changing as expected. I'll wait for the bed to stabilize and then see if I can measure the undulations we see
I had an idea, maybe it works
so I thought about the cycle time of the bed heater, its set to 50Hz in ratos
I just set it to 60HZ in my printer.cfg. Looks a little better honestly
eh, the measured value on the thermistor keeps climbing as the bed cools - which is expected, no ghosts. Also means that the reported value in klipper (which is now wonky again) is not actually measured
I'll let it run a bit and see if it improves.
ok so the reported value in klipper is wonky while the measured voltage is smoothly changing without any wonky behaviour? thats weeeeeiiird
It looks like that, I would need a logging multimeter to verify that better
waiting for the bed temperature to stabilize
yea its probably very minor changes and hard to tell by looking at the value itself
it's in the 0.001V range, which can just be seen on my multimeter
the PID or power looks a a lot less spikey as well. seems like it improved
that's just the frequency of the PWM to the SSR right?
yes
strange!
super strange π
what if all this was just a measuring artifact
it probably is. I guess the inductive effect on the thermistor is not too large, but maybe because its everything is at roughly the same frequency the thermistor measures alls the high spots, then slowly goes out of sync and measures all the low spots. maybe thats how we get that oscillating temp curve
and perhaps the measurements are being done at the pwm frequency?
possible. I couldn't find anything on the poll rate or measurement frequency of thermistors in klipper, thats when i thought I'll just try the heater pwm
I jsut set the pwm back to default to double check. WIll update in a couple minutes
still waiting for it to cool down, lol
yea this stuff takes time lol
yep cycle time definitely influences it
weirdly the extruder thermistor is showing a slightly higher temp with 60Hz
I can imagine that faster switching of the heating will better stabilize the temperature
but that's quite a noticeable effect
here, it seems that the act of measuring the voltage over the thermistor gets rid of the wonkyness
red marked are measuring intervals
its getting weirder and weirder, how did you measure it?
between both leads of the thermistor while connected to the board
(thin probes can enter the plug from the back to touch the JST crimped to the wire)
were the probes only connected in the marked intervals? or were they always connected and the measurement just done there
probes were only connected during the intervals
Maybe they can "dissipate" the fluctuations...
multimeter is essentially a resistor over the pins added in parallel to the thermistor
ok I think it is very likely a frequency synchronization issue. Look:
set it from 60 back to default (50) and then to 100 Hz. when double the mains frequency we get an even stronger fluctuation
so then 120 Hz should be similar to the result at 60?
let me try
where in the world are you, what is your net frequency?
Germany. Should be 50Hz
same as me then
let's see if I can verify this, are you with N\L connected as intended?
They set 50Hz as default so not to cause flickering lights in the EU
I think so, with this orientation the fluctuations at idle were less at least
dont have exposed live connections where I could check easily
input on the PSU?
120 Hz looks similar to 60 indeed
harmonic of 60, would make sense if it's an artifact somewhere
yea true. Would need to get the multimeter tho. Ill check it later.
dont really want to put my "lΓΌgenstift" on the live terminals and risk a short in case I slip π
that's a spannungsprufer I guess?
Switched from N\L to L\N, big difference as expected
no, those screwdrivers with the led that lights up when you put it on live and your finger on the end
I kind of want to manually set the scale for those graphs to better see this, but ok
thats exactly what I got, so I'm pretty sure I'm correctly on L/n now
I think you can extract the data from the klippy log
indeed, will do so later
can indeed still see minor undulations
without power, mind you
yea same
even when powered off it seems to have an effect
is the control PWM set to 50 but the measuring somehow still at 60 because klipper is developed by an american?
heating up to 50 now
hmm... I didnt check 60Hz at idle yet.
maybe the pwm Hz just helps with fighting those undulations, so we only see that effect when the heater is on
the frequency of the oscillations does change after switching to 60 when powered off
I'm about ready to call this an artifact of measurement and consult an electrical engineer, lol
wait a bit, my oscillations changed when not touching anything
yea I think we need a proper electrician for this π
This is with the PWM set to ?
na that was from the very first post. So default pwm, idle for hours
N/L wrongly attached
that's what we've seen as well, yes
just to show that the oscillations change in frequency and from regular to random without any changes to the printer or config
sry for the confusiont
indeed, if you leave it longer it would probably return to the higher frequency oscillations
lol, 02:00 at night
This is from now. With a cycle time of 0.021 (instead of the default 0.02 or 50Hz) on the right (120 Hz on the left)
so as long as its not in sync it looks a lot better
haha possible. I had my interface set to 12h time so it could've been 14:00 but 2:00 as well. not sure anymore π
well, I'm calling this interference or an artifact - I'll talk to the EMI / Electrical guys at work after the holidays - maybe they have an insight
I lack the knowledge
Managed to extract the heater bed values. Not a lot of help but the differences are clear
Yes do that π
for now I'm happy with the pwm at not a multiple of 50Hz fix
I can't replicate that here
but I'll give it some time to stabilize
that's quite a difference for you though
You cant replicate it?
how does yours look?
Waiting for it to stabilize at 50 at the moment
will take a while
hmmm, we should probably be on the same bed PID
I have this, what do you have? I'll change to your values
ah damn, I just started a PID tune π
i stopped it.
what machine do you have?
300 mm
same
I'll switch to your values, one moment
why are they so different then π you kd value is almost twice.
then again I have no idea what those values stand for
Its for 60Β°C
maybe thats why
just for reference, thats mine with cycle_time of 0.021. Ill let it cool down and see if It gets wonky again
it's control values that are used to configure the strength of signal power (deviation from setpoint), intergral (long term fault) and dampening (short term fault)
ah, 60, ok - will do the same
why 0,021 though? 47 Hz?
wanted to see if a higher pwm frequency helps or its just the off sync that helps.
so a little lower than 50Hz showed that its indeed not the speed of the pwm but being not a multiple of 50 that helps
60 Hz (so 0.016667) looked the same tho
0.021 was just the las i tried
takes a while for things to buffer out, a moment
just switched to 0.021 now, waiting again
I stand corrected, it does seem to repeat here
Let me grab the logfile and see
what do you mean repeats there?
it does look a little smoother after the red line
I mean that i can replicate your observations π
it's better with 0.021
ah yes
@kokx. : If you don't want to read everything,
we improved it by setting the cycle time of the heater to something other than a multiple of 50Hz:
0.016667 (60HZ) as well as 0.021 (47Hz) worked quite well as you can see above in @Steef post and here in mine: https://discord.com/channels/582187371529764864/1189608411109793872/1190273952644354170
just so that he doesn't have to read through all of it π
It must be some sort of artifact
The bed doesn't switch temperatures like that so fast
yea true.
ok so now we have kinda fixed it, or rather circumvented the actual issue π
Have to say was fun figuring it out, give an update when you talk to your electrical engineer π
I have to go read some papers. Thanks for measuring and figuring this out with me
fun times, I think we found a way around the graph being wonky
I wonder if it affected the PID control loop at all
in any case, if I gain further insights I'll drop a line
time for some actual work here as well...
maybe ill condense our post into a pdf or something and then tag someone with more experience on V-cores, maybe mikl or helge...
yea I'm quite happy with that π
The power setpoint in the graph is also affected, does seem to have an impact on the pid loop... but that could also just be another artifact
This deep down the rabbit hole is where dragons are, calling it good for now. Measurement artifact.
(with maybe some induction going on when the power wire to the bed is live)
haha, exactly - enjoy the papers
won't... thats why Im still here. but thanks π
@blacksmithforlife πΊπΈ we spammed a lot, but concluded things here https://discordapp.com/channels/582187371529764864/1189608411109793872/1190291265296805999
Damn, you guys did great work! Very nice to see this
@oskait definitely seems to have improved my bed temperature stability. Well, as reported in the graph anyway π
very nice. yea mines very smooth as well at 60Β°C now
helge said "who cares, a little pid and its fine" https://discord.com/channels/582187371529764864/851109908849491968/1190766337778257920
guess we went a little overboard here haha
Of course we did. It worked before. But i think there's nothing wrong with figuring out what is going on π
Guess we wont need this summary then π¦
yes i was bored
Avoiding reading papers i see
got me
I think it's great to have this resource available for the next guy that is also bothered by wonky lines
Probably in 5 years from now we will find an equally disturbed nutcase
IF he reads through all of our messages haha
π€£
I sent 10 mails up and down with rat rig at the time
I'm sure the poor customer service guy was also wondering why the fuck i didn't let it go
You can see the power set to the bed being different as well though
I sort want to attach a power logger and see if the consumed power is different over time
poor guy
I sent him this topics link, i formally apologize
Uni is important, go read those papers. I'm going to attach a power logger to feed the crazy a little more
hmm might just be that the power changes more as PID is fighting the fluctuations.
over a set time more power would lead to a higher temp of the bed, if everything else stays the same
haha alright, give updates π
ππ»
@Oskait on recommendation from the company electrician, I connected the - of the PSU to ground. This is apparently done in industry to avoid these kind of interferences. Unfortunately, no change.
So I'm leaving it permanently connected to a wall socket with a switch and that's it
Ok thanks for trying.
I'll just leave as is, since helge and other germans have the same "problem" but dont care I think its something that can be ignored π
oh for sure, it's printing so it's fine
but it leaves a bug in the brain
the electrician was also curious so we keep looking, if we find something I will let you know @Oskait
haha yea true.
oh ok so you got him hooked as well π
nice keep me posted
Finally got time to test the fix, it definitely holds much more stable bed temperatures now! Only deviations of about +/- 0.1 degrees instead of about +/- 0.5-ish
I've been tinkering with my Ender 3 and rewired my tool head. Was just testing the thermistor and noticed very similar behavior. Reading about 50Hz and grounding I was thinking if this could be because I thought I was clever and used shielded twisted pair as the wire runs for some length and is tucked together with VCC etc. The shield wire I connected to earth ground to properly shield it, but this was exactly what caused the weird wobbly temperature line. I disconnected my earth ground and a nice flat line. I hope this helps someone else on here too.