Welcome! Log In Create A New Profile

Advanced

[Gen7] Teacup: how fast will it PWM?

Posted by Cyberwizzard 
[Gen7] Teacup: how fast will it PWM?
May 10, 2012 05:57PM
I'm adding a MOSFET driver to see if I can keep the MOSFET cool when its being driven with 12V instead of 5.

Now I have 2 questions:
- Without looking at the code, I assume inverting the PWM is a simple flag somewhere, right?
- How fast does Teacup drive the PWM? Because the MOSFET stays the coolest when its either on or off, I need to have a small RC time, but depending on the required speed I might need to buy different resistors. So 1kHz? 10kHz? 100kHz? 1MHz?
Re: [Gen7] Teacup: how fast will it PWM?
May 11, 2012 05:37AM
Quote

- Without looking at the code, I assume inverting the PWM is a simple flag somewhere, right?

FAST_PWM in config.h. It's described there.

Quote

- How fast does Teacup drive the PWM?

62 kHz on a 16 MHz electronics, 78 MHz on a 20 MHz electronics, both with FAST_PWM. Without FAST_PWM, that's 61/76 Hz, which is the slowest an ATmega can do without resorting to software PWM. See Teacup's mendel.c, around line 200.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: [Gen7] Teacup: how fast will it PWM?
May 11, 2012 05:41AM
Traumflug Wrote:
-------------------------------------------------------
> 62 kHz on a 16 MHz electronics, 78 MHz on a 20 MHz
> electronics, both with FAST_PWM. Without FAST_PWM,
> that's 61/76 Hz, which is the slowest an ATmega

I assume thats 62/78 kHz and not MHz :-)

Cheers for clarifying and I'm glad I asked since I was aiming for 25kHz...
Re: [Gen7] Teacup: how fast will it PWM?
May 12, 2012 06:31AM
Quote

I assume thats 62/78 kHz and not MHz :-)

Yes.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: [Gen7] Teacup: how fast will it PWM?
May 17, 2012 05:01PM
I finally got to building my driver board.

But I can't find the feature I was looking for: I need to invert the PWM signal as my NPN-MOSFET circuit inverts the signal from the Arduino. I found the switch to go to lower PWM speeds, but at the moment my main issue is that the bed turns off when it should turn on and vice versa.

Is it possible to add something like that? Or should I hack it into the firmware somewhere?
Re: [Gen7] Teacup: how fast will it PWM?
May 18, 2012 05:58PM
I'm pretty sure an ATmega can switch it's PWM on the other flange, too. Likely you get away with a different PWM setup in mendel.c.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: [Gen7] Teacup: how fast will it PWM?
May 19, 2012 04:36PM
Isn't it sufficient to add another parameter to the heater settings to mark which output should be inverted? In heater.c, the uint8_t that controls the PWM can simply be modified with (255 - pwm_value) for all inverted outputs. I tried this for all heaters (after disconnecting the extruder) and it looked like the bed was being properly controlled.

Of course, if I'd do it only for my setup, I can simply check if the heater pin is the pin for the bed and invert that value...
Re: [Gen7] Teacup: how fast will it PWM?
June 03, 2012 10:42PM
Cyberwizzard Wrote:
-------------------------------------------------------
> I'm adding a MOSFET driver to see if I can keep
> the MOSFET cool when its being driven with 12V
> instead of 5.
>
> Now I have 2 questions:
> - Without looking at the code, I assume inverting
> the PWM is a simple flag somewhere, right?
> - How fast does Teacup drive the PWM? Because the
> MOSFET stays the coolest when its either on or
> off, I need to have a small RC time, but depending
> on the required speed I might need to buy
> different resistors. So 1kHz? 10kHz? 100kHz? 1MHz?

Be a little careful. 5V is typically plenty to drive a mosfet. What is really preventing the speed is the switching time and that is a function of the current output of your driver feeding the gate capacitance of the mosfet. What you need most for higher frequency is more current not more voltage.


Marcus Engineering, LLC Electronics, Instrumentation, Automation
Solarsculptures.com Interactive Solar Power Art
Re: [Gen7] Teacup: how fast will it PWM?
June 04, 2012 03:56AM
5V isn't plenty. It is barely enough. The gate threshold of an IRFZ 44N is 4V worst case and at the voltage the current is only 0.25ma. So at 5V it could be barely on. The only reason it works at all is that most people will not get the worst case, just a few unlucky ones.

Most MOSFETs will give a lower RDSon at 10V, even ones designed for logic drive.


[www.hydraraptor.blogspot.com]
Sorry, only registered users may post in this forum.

Click here to login