Big Mosfets and High Performance Heating Elements for Pyrogravure

Dear Makers,

I am attempting to install a 7Volt, 7Amp heating element capable of achieving 1600 degrees Celsius, and control it via PID PWM over one of smoothieboard’s big MOSFETs.

I want to be able to control it’s temperature sort of like the spindle speed on a CNC machine is controlled under load. ’

I am building a CNC pyrogravure machine for some experiments.

Does anyone know if this is even possible? If it is, what are the probable caveats I am going to run into using the Big MOSFET to control such a heating element?

I also want to be able to create an output graph of the heating element temperature and power consumption in real time for analysis purposes when writing to various materials.

Any assistance will be greatly appreciated. I have lots of pictures and information I can provide if you need more information. I am sure I have missed some key details.

Moved to the #controllers:smoothie category where expertise in the capabilities of the “big MOSFETs” on the smoothieboard is most likely to be found. @Arthur_Wolf I’m guessing that there’s information on the specs of the big MOSFET in the smoothie docs?

Can you tell us more about the configuration of the machine:
What does it do exactly? Automated Phyrography?
Who operates it, is it cnc-like controlled or manual?
Does the controller do something other than control the heating element?

Controlling a heater with PWM is pretty straightforward and 7 amps are well within a MOSFETs capability.

Are you using a smoothie because you need to controls other devices or movement??

If this is a CNC-like pyrography machine you could model it just like a laser or CNC router.
In this configuration, you would set the smoothie up something like:

  • x-y stepper drive for axis
  • need a Z axis for positioning the pen? Then this looks more like a router
  • Instead of a laser/spindle you have a heated head. A laser/router is typically controlled using a PWM controlled MOSFET. You would just pick one on the board that can handle the current for your pyrography pen.

Thanks for the assist. I did not know exactly where it fit. :slight_smile:

1 Like

the smoothie board also control the X-Y and Z axis. the x and y are just standard belt driven steppers while the Z axis is a lead screw and linear rail setup with a powder bed.
It is the Open SLS design exactly, where the laser has been replaced with the heating element I have.
The heating element is not mobile in the Z axis, only in the X-Y. The powder bed moves up and down in the Z, and is fed by a similar powder bed right next to it along the x axis.
The system is fully CNC controlled and accepts g code commands through pronter face.

I want to use the built in smoothie board PID and PWM to control the heating element and while in motion over the powder bed, monitor the temperature/ ground side current from the heating element to perform scanning calorimetry on the material and control the temperature of the element in real time to drive the sintering process with closed loop thermal control.

Basically the process would look, from 40000 ft, like,

  1. heating element (whose TCR I know with 4 decimal precision) draws power from the big MOSFET

  2. current sensor on the ground lead of the heating element monitors the current and provides a setpoint so I can set the temperature by setting the “spindle speed” of the CNC module.

3.the element reaches its set point temperature and begins moving over the powder bed. This heating
process is controlled via the built in PID

  1. As it moves over the bed, the bed heats up and begins to melt(an endothermic process) under the element and that changes the element temperature, which also effects the ground side current.

5.I monitor this current and use it to tell the smoothieboard how much current to push through the heating element to maintain its temperature, and extract the temperature change curve over time which I then export to some plotting software for analysis.

I am using the smoothieboard, because its what I had on hand, and I wanted integrated control of all the aspects of the system on a single device.

The system is a automated pyrography system that works in various powders and such.

1 Like

I would connect over at the smoothie and 3D print topic areas because this application feels similar to a 3D print head thermal control.
@Arthur_Wolf can tell you if the current Smoothie code will do what you want for controlling temperature.

Well, I moved this here because the first question was about details of the smoothieboard.

The big mosfets are 12.5A capable.

All the rest of the questions are I think about whether smoothieware supports those capabilities, so I think that this is a great place for this discussion.


Do you know if the big mosfets start from 0 Volts and have PWM values up to 12 volts, or are they mapped by default to 0-24 volts?

On the page I linked to:

Big MOSFET pair : Their outputs are labelled P2_7 and P2_5 on the schematic, the input connector for them is found between them. They are found on the 4X and 5X boards. To power those MOSFETs, you need to provide them with power by wiring their power input to the power supply.

Contrary to other boards, Smoothieboard does not have a single power input, but multiple power inputs.
This allows you to use different voltages for different things if you want, and makes it easier to use more current as the current is shared between more connectors. It does mean wiring one or two more connectors though.

The MOSFETs are nMOSFETs which are “low-side” switches; they sit between the negative side of the powered item and ground.

Please do read through the mosfets page I linked to and then ask questions with reference to that page.

I don’t even own a smoothieboard, and I’m not a smoothie expert; I just did a google search, found the page, and read it. :slight_smile:

So I read the link you provided.
Thanks for the pointer in the right direction.
as it turns out, using the spindle control module to control the heating element through direct PWM is working very well. :slight_smile:

So, to recap,

A heating element, whose maximum voltage and current characteristics I know very well, can be connected directly to the big mosfet circuits of the smoothie board, and used as if it where a CNC spindle.

Basically, by setting the maximum PWM to lower than the value corresponding to the maximum tolerable voltage my element can take, I have a hard limit to prevent burning out the element.
Judging by the output response and the documentation, I would say the smoothie board outputs from 0 to 24 volts on the big MOSFETS PWM signal. I can use up to about 60% duty cycle and stay within the safe range of my element. which is about 15 Volts.

Now…if I could only figure out how to monitor the current…my current sensor is an ACS723 from sparkfun.
It samples at random times during the PWM cycle, so I dont get coherent output from it.
does the smoothie board have some way to synchronize PWM cycles and the sensor sampling rate?

This may be suited for a separate thread… Thanks again for the help!

1 Like

So this means you are happy running the head at 24V? Here’s the deal: MOSFETs fail on. This means that if you depend on PWM to reduce the 24V supply to your pyrograving head, when the MOSFET fails you’ll provide a continuous 24V to the head, with no way to turn it off short of physically disconnecting power to your machine. If that’s a fire risk, you have a dangerous design.

If you know that the head is safe at 15V always on, then provide 15V to the independent “big MOSFET” supply on the smoothieboard, instead of 24V. This will also give you more PWM control; you’ll be able to use the full range of PWM values instead of only 60% of them.

To monitor average current through PWM, you need a substantially higher sampling rate than the PWM base frequency (so you probably need a different current sensor), and then to average that in software (the digital route). Alternatively, you want an integrator circuit (the analog route).

If this were my own project, I’d probably go the analog route. You need to measure voltage drop across a shunt resistor. You want to buffer that voltage, and probably amplify it for measurement. This is a good application for an op amp (for high input impedance). Then I would use an RC integrator and buffer its output with another op amp (for the same reason) before sampling the voltage with a A/D converter. I’d set up adjustable gain on the first stage so that the full range of PWM inputs to the head result in output values that are accurately read by the A/D converter. I don’t know whether you have any background in circuit design; if you have, this probably sounds easy; if you don’t, it’s probably not a best first project. :wink:

Alternatively, if you can measure the temperature of the head, say with the ubiquitous K-type thermocouple and a thermocouple driver (which you probably want to mount on the head so the wires don’t flex), and you can characterize resistance as a function of temperature, you don’t actually have to measure current at all. The MAX31855 thermocouple driver supports K-type thermocouples, so probably that would work. But that goes only to 1350°C, and the MAX31855 from adafruit it looks like only supports K-type, even though the MAX31855 supports S-type as well so you should be able to find other breakouts that do support S-type. An S-type thermocouple can read to 1600°C but it certainly costs more than a K-type!

I would expect in any case for this project that you’ll be writing custom code. :slight_smile:

I hope that’s useful!


Never heard of that rule? I have had many MOSFET fail open especially in high current circuits?
In any case I would safety fuse this circuit or as noted below measure the temp vs the current.

Measuring current:
There are a number of I2C A/D devices that contain the signal conditioning and gain control you may need. Below are just some of them. You have to choose based on the current resolution and the shunt you used.

INA219** (shunt built in)

There are also a group of hall effect devices that are easy to use. You have to pick one that matches your current and resolution needs.

You should sample at a min of 2x the PWM 10x would be better. Depends on the accuracy you need.
Of course with an A/D measuring PWM you need to integrate to get other than instantaneous current.

Measure temperature
An overall better way may be, as suggested above, to just measure the temperature. That is unless you has a special reason to know the current. I would use a separate circuit/controller for this so that isolation and safety concerns can be addressed. You can monitor the temp and at overtemp you need to remove the power, usually with a relay.

You can just purchase one of these controllers and make it easy on yourself :slight_smile:
12V Digital Temperature Controller**

** As an Amazon Associate I earn from qualifying purchases


1000% agreed on fusing.

In addition, a thermal-cut-off fuse (TCO) sounds like a really good idea, though choosing the right value and location might be tricky. If the tip overheats, where would heat flow? Would a low-value TCO at a thermal boundary be enough? I use TCOs for my printer heated beds. (I would use then with MOSFET-switched DC but they are both AC and SSRs even more characteristically fail short.)

I didn’t mean they only fail on, but it’s a common failure mode.

The answer is yes — both

A common failure mode under near-normal operation is short from degrading the semiconductor. The common cause of failing open is heating to the point of desoldering, which can of course happen after failing short. I guess that MOSFETs might have an unreliable internal TCO fuse? :slight_smile:

For a 1R head, 24V across a 12.5A big MOSFET would pull approximately double the rated current, right? So if you are lucky if fails open; if it fails closed even on the way to failing open it will probably also kill the board by putting 24V onto the gate and killing the driver or the processor. A software or configuration error could cause that. That’s why I would use only the max safe sustained voltage for that head, not 24V. I don’t know the resistance curve for the head, but whatever voltage will pull a max of 12.5A at steady state would be the max voltage i would apply in this scenario, if I understand the problem correctly.

Note that thermocouples themselves must be isolated anyway; if they are grounded anyway it degrades the thermoelectric effect measurement and makes them inaccurate, which would completely miss the point here. :wink:


This is a block of very helpful advice! Thank you!
First, how would you propose I only provide 15 volts to the mosfet? would I need some very large pulldown resistor or resistor network? I would very much like to have the full range of PWM control, as additional granularity is useful for my application, and yes, I would prefer to avoid a fire, though the head itself is quite cheap to replace, and my lab has a fire suppression system.

Could I not just turn down the PWM frequency in the config file, to a value lower than the sampling rate of the current sensor I am using to improve the sampling quality? I have done this but it does not seem to work.

I am certainly no electrical engineer. I am a physicist by training, so basic digital systems, is about where I step off. :stuck_out_tongue:

I cannot reliably measure the temperature of the head via an external thermocouple because adding additional thermal mass will interfere with my scanning calorimetry measurements. Basically very sensitive measurement of the energy absorbed by the endothermic reaction at the surface being burned/melted.

I am currently writing custom code for the scanning calorimetry component and feedback control of the head as you say. I am however, a terrible software engineer. lol

My element has a room temperature resistance of about 1 ohm, and a resistance of 1.15 Ohm at its maximum temperature (1600C) TCR is 5 PPM/C ± 2% from 25 to 1600 C.

At 1600C the head uses about 65 Watts of power, at 15 V, ~4.2 A. I believe this should be safe to use on the MOSFETS as designed?

I would prefer the head to be operated in as safe a manner as possible, though it is quite small. The hot zone itself is about 2mm diameter and 6mm long.

I really do need the simplest possible to implement solution in terms of hardware, that will allow reliable measurement of the current passing from the heating element to ground with a resolution of at least 400 mv/A.

I have considered fusing, but have not yet implemented any due to not knowing where it should be placed. :slight_smile:

Thanks again for all the sage advice!

I would use a separate power supply, or a buck converter capable of handling the necessary current. (It’s not that conceptually different from PWM plus an integrator, but it’s typically running at 100Khz-1Mhz.)

Me neither. I’m a programmer and manager and dabbler in electroncis. I’ve done analog voltage control for the charging system for my electric tractor, so I’ve done circuit design in this area, but I’m 100% an auto-didact here. @donkjr by contrast actually knows what he’s talking about.

If you turn down the PWM frequency, you’ll reduce uncertainty that is due to the shannon limit, but you’ll still have to integrate in software. That’s why I like the idea of increasing the frequency, measuring with a precision shunt, and integrating with an RC circuit; the higher the frequency, the smaller the C needed in the analog integrator, and opamps to effectively eliminate loading from the measurement are only slightly more than a dime a dozen. But if the parts @donkjr found can solve the measurement problem without having to design that circuit, that’s way better.

For the integrator, you’ll probably want to sample the current from a timer so that you have a stable time base, and you’ll need to sample it at a rate substantially higher than the PWM rate if you are trying to read it independently. Alternatively, if you can use the PWM clock as an interrupt source, and have a good time base, you can read current when it’s on, assume there’s no current when it’s off, and divide by the PWM duty cycle to integrate.

OK, where am I going wrong?

15V/1.15Ω = 13A
15V² / 1.15Ω = 194W

I picked a hall effect sensor for ease of implementation, and the sparkfun item in particular, due to its current rating being high enough for what I need and its resolution being the minimum I can accept.

Thanks for the pointer on PWM sampling rate considerations. I had not realized there was such a high frequency demand when selecting a current sensor.

I actually need to be able to control the temperature, measure the current, and use the measured current to maintain a stable temperature with probably single degree C precision around a set point.
While monitoring the changes in power consumption associated with the changes in temperature the PID has to fight to maintain the head temperature. This is the basis of my scanning calorimetry concept, though I am open to wise suggestions on how to do it better. :slight_smile:

To get that, you might need more than to accurately read the current, you might need to account for the slew rate of the power MOSFETs. Small signal MOSFETs can have extremely fast slew rates, but power MOSFETs typically slew more slowly, and you may need to account for that.

@Arthur_Wolf can say if this is out of date, but the schematics I find don’t show a gate driver for the power MOSFETs that I notice:

So I’d think that looking at the datasheet for the MOSFET you are using would be potentially useful. It should show characteristic curves. If you start reading the current immediately after the PWM source starts turning on the MOSFET, your reading will include the transition region where current is partially limited by high resistance in the MOSFET as it transitions to saturation.

1 Like

Considering the accuracy you are trying to achieve 1 deg C I think I would approach this differently.

Partially to more easily prototype the controller portion and partly to avoid writing Smoothie code.
You can always come back after this approach is working and reprogram the smoothie.

I would put the thermal controller outside the Smoothie and use the smoothie to tell it what the temperature setpoint needs to be by reading its PWM. The external controller is stand alone and closed loop. With this design approach, you can more easily change and synchronize the PWM and it frequency with the current measurement cycle. You can also control the current via analog vs PWM as that may be needed for accuracy.


Smoothie’s mosfets switch based on a pwm signal, so it’s not really 0-12 or 0-24, it’s more 0-100%

It does sound like what you are trying to do is too much for this type of controller, you probably want to develop a custom temperature control board that does what you want, and have smoothieboard just tell it to turn on/off ( or even give it a temperature to go to via a pwm signa ).

You can try doing this within smoothie, but hearing you want to synchronize the pwm with the temp sensor makes it sound this is orders of magnitude more advanced than the board/firmware was designed for/is capable of. Sometimes when you’re doing something new, you need a new tool for at least part of it.