Traumflug / Teacup_Firmware

Firmware for RepRap and other 3D printers
http://forums.reprap.org/read.php?147
GNU General Public License v2.0
310 stars 198 forks source link

PID loop not running at full power #315

Closed thomaskilian closed 5 years ago

thomaskilian commented 5 years ago

When I watched the signal LEDs for the bed/extruder I found that they are not working at maximum power, but only at 50%. My board runs at 24V and when measuring with a volt meter it reads 12V only (I could pul in my scope but for sure it will just show a 50% duty cycle for the PWM). Why is that so?

My heater settings are

DEFINE_HEATER(extruder, DIO10, 1, 1, 100) DEFINE_HEATER(bed, DIO7, 1, 1, 100) DEFINE_HEATER(fan, DIO9, 0, 1, 50)

Also, for the fan I noticed that it's not completely turned off but the LED is glowing very dimly. It's harder to measure but clear to see and, more important, clearly to hear by the fan making quite some noise in stand by.

Wurstnase commented 5 years ago

https://github.com/Traumflug/Teacup_Firmware/issues/311#issuecomment-441387158

I rather figured out how the heating PWM works. I'm using DIO7, 9 and 10 for bed, extruder and fan.

So this is now working and we could close this issue? Could you describe what you changed and why it doesn't work before?

thomaskilian commented 5 years ago

No, it's not really working. I hooked up a scope and noticed that the bed gets sort of saw-tooth (it's raising like sine) signal with (IIRC) 4us wave length when it should have full power. The extruder however seems to work with fine PWM.

Wurstnase commented 5 years ago

Do you have a picture?

thomaskilian commented 5 years ago

Set to 5us per cm which means PW = 20us Bed heating was just turned on and should run at expected constant high value. The extruder does that in contrast.

cimg0512

Wurstnase commented 5 years ago

Are you sure, that you don't have any electrical issues? I wouldn't expect any issues with pwm. Probably some wrong pullups or pulldowns.

thomaskilian commented 5 years ago

It "might" be, but why do I see that frequency once I start heating and I don't see it at the extruder? Both are configured with the DEFINE_HEATER macro (see top). I'll cross check the cables, though.

AnHardt commented 5 years ago

Is that pin really configured as an output, or is just the internal pullup working against the gates capacity?

thomaskilian commented 5 years ago

Both run a MOSFET in the same way. It's a MKS GEN V1. I'll try switching the outputs just to see whether the behavior will switch with the attached heat sources.

thomaskilian commented 5 years ago

Never mind, that was an electrical issue. The PWM sends a short off (inverted logic) signal every 20us. The bed draws so much current that the power supply shortly breaks down so the strange pulse appears on the scope. Well, good to know at least :-)

You can close this.

Wurstnase commented 5 years ago

You can close issue by yourself :)

thomaskilian commented 5 years ago

Obviously I'm not much used to that. Will do next time.