Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

New to 3D print, not so new in stepper motors

Status
Not open for further replies.
High. I have recently purchased a Creality Ender 5 Plus 3D printer, build it and checked it works. Having dealt with stepper motors that I plan to use as winches in my sailboat model about 8 years ago, I started to wonder that the NEMA17 stepper motors used in my printer had no shield containing information about the nominal voltage and nominal current. Further, I did a study in YouTube videos about many of the elements of which a 3D printer consists, finding that the Kersley Fabrications channel had valuable information and performed the analyses of the impact when upgrading components in a very professional way. In the context of this thread, I am opening here the analysis of controller board options available for upgrading a 3D printer.

It became evident to me in my opinion, that 3D printing quality and speed was on 1 side dependent on the material used, I will limit myself for the foreseeable future to PLA filaments and otherwise a "dance" of mutually impacting parameters. Due to my background, I wanted to address the topic related to the speed of printing. One of the things I took from studying the Kersey Fabrications YouTube videos was that the ability of the controller board to process the G-Code fast enough whereas a result comes to the ability to process the G-Code fast enough for the step frequency desired. So what processing power the microcontroller being used in the controller board and the frequency at which it runs, is one limiting factor to increasing speed without deteriorating print quality. I want to emphasize this: It is just one parameter. So I decided to buy the BTT-SKR-Pro V1.2 controller board for upgrading my printer. It has an ARM Cortex M4 controller running at 168 MHz.

Another parameter for accelerating the printing speed without deteriorating the print quality is the performance of the stepper motor involved. When the stepper motor is unable to execute its steps at the frequency the stepper motor driver is wishing it to do, are a loss of steps and acoustically perceivable behavior. I started to investigate what torque the stepper motor being used might have, as no plate or other source of information from the supplier is available. When you go to eBay and to Amazon you will find that the NEMA 17 stepper motors you can find there very often do not include that kind of information. So I went to the websites of manufacturers of stepper motors and to inform me what were the nominal values for voltage and current their NEMA 17 stepper motors had and what holding torque those stepper motors have. Soon I found that the difference in holding torque of their NEMA 17 stepper motors showed a factor of 3x to 4x.

Now a short paragraph about stepper motor technical topics I consider relevant in this context. The torque a stepper motor can offer is directly related to the amount of current its coils do tolerate, and only to the amount of current. So when you have the choice between stepper motors with the same torque, choose the one that has the lowest nominal voltage value. Why? Because this means its coils do allow a higher amount of current. I was aggressively and personally attacked by community members of 3D forums that faded away as soon as I presented the section from the company Trinamic that makes the stepper motor driver ICs that spoke that stepper motors were usually get supplied voltages of up to 20x the nominal voltage value. For my sailboat model stepper motors used as winches, I build a battery pack consisting of 12 LiFePO4 batteries connected in series. This pack when fully charged supplies a voltage of about 40 VDC and when so much emptied that a recharge is required 24 VDC are being supplied.

So, if only the amount of current is relevant for the torque a stepper motor can offer and that amount of current is specified as the nominal current value of a specific stepper motor, what do we gain by supplying voltages much higher than the nominal voltage value. The stepper motors I use as winches to control the position of the sails have a nominal voltage value of 3.6 VDC and I am applying between 40 VDC and 24 VDC depending on the charge of the batteries cells in my battery pack. The answer is related to why the torque being specified for a stepper motor is the "position holding torque" value.

For a stepper motor to do a step, and here I am limiting myself exclusively to bipolar stepper motors, the voltage pattern applied to the i.e. 4 cables of the stepper motor changes according to rules that can be followed easily in modern stepper motor drivers. So what changes is the value of the applied voltage to the coils in the stepper motor whenever it makes a step. The higher the frequency of steps is the higher is the absolute value of the induced voltage in the coils of the stepper motor:

Veffective = Vapplied + (-Vinduced)

So when the stepper motor is holding its position, that the value of the induced voltage is ZERO. The result is that Veefective = V applied. So if the stepper motor is holding its position the torque is the one the motor makes available when the nominal voltage value is applied. But what happens if the stepper motor is increasing the frequency at which it does steps? The absolute value of the induced voltages gets closer and closer to the value of the applied voltage and as the equation above shows, the effective voltage gets closer and closer to ZERO and as a consequence, the current value gets closer to ZERO and as a consequence, the available torque gets down to ZERO. What stepper motor driver ICs do, is that they use a PWM and control the amount of current flowing gets limited to the nominal current value by adapting its duty cycle. So, the higher the value of the applied voltage is, the higher the step frequency can be and the induced voltage will require higher step frequencies before the torque drops sp far that it limits the available torque.

So, in the dance of mutually impacting parameters, if the applied voltage is high enough and the nominal current value is as high as possible, that the stepper performance will not be limiting the performance of the 3D printer. But, be aware of, also CNC machines, like those CNC milling machines use G-Code to control the job of milling. But CNC milling machines and 3D printers share many o the same functionality and use the same G-Code instructions, other functionality is specific for 3D printing and CNC machines.

One result of my investigation is that I am planning to do experiments and use a 3D printing controller board to get a better understanding of where the G-Code has the same functionality and where it is different and how this difference is. The Marlin operating system available for any 3D printing controller board, as of today version 2.0.7.2 claims to support both 3D printing and CNC systems but I have yet not found a source of information as to how Marlin has to be set up and which G_Code instructions are required in those applications. Marlin is an operating system that is for me in an unusual degree customizable by setting the parameters in the 2 files responsible within the code. This is due to 3D printers as nearly every printer is somehow different from another.

Another thing that has been created thanks to the need for 3D printing is the so-called "SilentStepSticks". These are boards that were developed as OpenSource projects as the result of the cooperation between Trinamic and Watterott, 2 German companies. Now you have Chinese companies like BTT offering their own makings of those boards. As of today, the most common boards are the SilentStepSticksTMC2208 and SilentStepSticksTMC2208 which use the stepper motor driver controllers TMC2208 and TMC2209 from Trinamic. As I have already written, my goal is to develop knowledge and implementations which try to influence the parameters related to the operation of stepper motors so, that they are not the limiting factor. Using the BTT-SKR-PRO V1.2 board with the Cortex ARM M4 controller running at 168MHz the Marlin OS running on that controller board will be able to support higher frequency steps by offering a higher G-Code execution performance. As stepper motor driver boards I have purchased the SilentStepSticksTMC5160hv from Watterott which as of 2021 will use the TMC516i driver ICs. The TMC5160hv is characterized to allow a current flow of up to 20A and a voltage of 60 VDC. I have purchased a Meanwell 600W 48 VDC power supply so as to be able to operate those boards and the connected stepper motors with a supply voltage of 48 VDC. The amperage of those NEMA17 stepper motors is well below 2 A. Once I get to experiment with this setup a still do be build a DIY CNC milling machine, I plan to use NEMA 34 or NEMA 42 stepper motors for the CNC milling machine. These stepper motors do need less than 4 A to 5 A, so the SilentStepsStickTMC5161 will have no problem driving these stepper motors.

Another set of functions available to control stepper motors and made available with the Trinamic stepper motor drivers would have to be presented in another contribution. If you go to my YouTube channel "Hellmut Kohlsdorf" which I used to make available videos of my experiments you can watch the video where I tried to identify up to what frequency the stepper motors that will be used as winches in my model sailboat is relatively long as I did not expect that I would be able to achieve such a high step frequency. You can see on the setup of the experiments 2 multimeters, one showing the voltage and one the amperage as I keep accelerating the stepper motor. The recording, I am an awful speaker, was done using the Spanish language, so please excuse me. One selling effect, the low noise level possible using either of the stepper motor driver boards, is extensively used by marketing in the 3D printer market. But in this video, you can see that there are step frequencies with very different levels of noise at any speed. But also functions like s-Shape for acceleration and deceleration, have important impacts that benefit 3D printing at higher speeds. As of today, the controller used on the controller cards is still pretty low processing power so that this kind of function is disabled in the setup of Marlin.

One question I will investigate at a later stage is if Marlin 2.0.x is built upon CIMSIS API. This API hides the specifics of a specific controller so that porting software from one version of an ARM Cortex M controller to another device of the same kind. If this would be the case much faster ARM Cortex M devices could be used and i.e. dual-core versions of it. The experiments of Kersey Fabrications on YouTube show that when the controller has to deal with a graphics interface the additional computing power would break the controller's ability to serve a higher step frequency. Dividing the pure G-Code processing on an M4 core and the peripheral processing to the second Arm Cortex m0+ core would fix that problem a bit.
 
I'm running my Ender 3 on Trinamic 2209 drivers and SKR 1.3 board - it makes a huge difference to both the noise, quality and speed of motion. I'm rehousing it all with extra higher current drivers so I can use the same board on both my Ender and my CNC project.
 
One point to note is that steppers are almost unheard of in larger / industrial CNCs and robotics.
Steppers are a compromise used for simplicity as they do not need a separate feedback system; industrial CNCs generally use DC (or now brushless DC) motors, and usually with separate measuring systems for position feedback, where high accuracy is needed.

For stepper motors themselves, one technique to improve the response time of an electromagnetic device such as a solenoid or stepper is to use a higher supply voltage plus a "ballast resistor" that limits the current back to the original value.
That gives a proportionally faster current rise time and so faster mechanical response.

Current-controlled drivers with a high supply voltage will give a similar effect,
 
Also, 3D printer software appears to be written in some incredibly, ludicrously inefficient way, if it cannot manage high update rates on the types of CPU presently in use.

I've been working with CNCs since the early 1980s and back then wrote a full system from scratch that was used for many major projects in some companies, from parts of the channel tunnel machines to military equipment.

It had 100Hz servo update with full 3D linear and circular interpretation and a base measurement unit of 1/320,000 inch, running from standard CNC G code programs.

Plus the operator interface, position readouts etc. (but no graphics).
On a 4MHz MC6809 CPU.

A present ARM CPU is probably thousands of times faster; how can one not be able to run three servo axes at extremely high speed??
 
Your response and the question at the end are absolutely right. By the way, I too was a fan of the MC6809 when most were focused on Z80 and 8080. I loved the memory-mapped peripherals and having a single contiguous address space. I used the operating system OS9 that used a discreet MMU realized with SRAM ICs to have up to 2Mbyte of address room. So you could store software modules in Eproms and OS9 recognized it while starting and added them.

But as I wrote, the Marlin os is targeting consumer users to configure their 3D printer upgrade modules. So to make an adaptation of Marlin and the slicer used in a way DIY consumer customers have the chance to adapt.
 
Also, 3D printer software appears to be written in some incredibly, ludicrously inefficient way, if it cannot manage high update rates on the types of CPU presently in use.

I've been working with CNCs since the early 1980s and back then wrote a full system from scratch that was used for many major projects in some companies, from parts of the channel tunnel machines to military equipment.

It had 100Hz servo update with full 3D linear and circular interpretation and a base measurement unit of 1/320,000 inch, running from standard CNC G code programs.

Plus the operator interface, position readouts etc. (but no graphics).
On a 4MHz MC6809 CPU.

A present ARM CPU is probably thousands of times faster; how can one not be able to run three servo axes at extremely high speed??

An old friend of mine wrote software for guided missiles - but (obviously) I've no idea what the actual hardware was, but as he started a LONG time ago I suspect it was pretty low spec.

His wife worked in HR for the same company - and one of her jobs was booking the hookers for the Arab customers!.

As you were using a 6809 presumably you were writing in assembler?, hence the high speed - rather than the crawling speeds generated by C/C++ compilers.

For those who can remember the Commodore Amiga?, it had some absolutely amazing games, stereo sound, great graphics, and all on an 8MHz processor and 512KB of RAM - but again they were all written in assembler - as opposed to the resource hungry (and extremely slow) modern games on multi-GHz processors.
 
As you were using a 6809 presumably you were writing in assembler?, hence the high speed - rather than the crawling speeds generated by C/C++ compilers.
Half and half; the custom interpolation maths & servo routines were in assembler as i included those in a rebuilt version of the 100Hz RTC routine.

The rest was C, running as a separate program.

The main reason it was fast is that it did not use any trig functions at all. Everything was fixed point and the only thing beyond basic four function maths in the high speed section was a square root routine I invented.

A good C compiler is no slower than assembly, if you understand it and the CPU. For the 6809 or 68000 I could pretty much predict the assembly code the compilers produced & I'd regularly check it for anything nasty.
 
Half and half; the custom interpolation maths & servo routines were in assembler as i included those in a rebuilt version of the 100Hz RTC routine.

The rest was C, running as a separate program.

The main reason it was fast is that it did not use any trig functions at all. Everything was fixed point and the only thing beyond basic four function maths in the high speed section was a square root routine I invented.

A good C compiler is no slower than assembly, if you understand it and the CPU.

The Windows compilers must be really crap then :D

But the Amiga C compiler (Lattice C) was pretty slow as well - and the OS was written using it. So much of the OS was re-written using assembler, this made the system MUCH faster and MUCH smaller.
 
Writing in assembler of the MC6809 was very simple due to the way it is implemented and the good choice of mnemonics. As to the use of a compiler on an MC6809, this was a very simple processor and so C, or Fortran, and other languages did not have the benefits modern compilers on current controllers and processors. The complexity of the hardware in those modern controllers allows a good compiler to be beneficial thanks to the smart way of implementing their functionality taking advantage of the CPU implementatios.
 
High. I have recently purchased a Creality Ender 5 Plus 3D printer, build it and checked it works. Having dealt with stepper motors that I plan to use as winches in my sailboat model about 8 years ago, I started to wonder that the NEMA17 stepper motors used in my printer had no shield containing information about the nominal voltage and nominal current. Further, I did a study in YouTube videos about many of the elements of which a 3D printer consists, finding that the Kersley Fabrications channel had valuable information and performed the analyses of the impact when upgrading components in a very professional way. In the context of this thread, I am opening here the analysis of controller board options available for upgrading a 3D printer.

It became evident to me in my opinion, that 3D printing quality and speed was on 1 side dependent on the material used, I will limit myself for the foreseeable future to PLA filaments and otherwise a "dance" of mutually impacting parameters. Due to my background, I wanted to address the topic related to the speed of printing. One of the things I took from studying the Kersey Fabrications YouTube videos was that the ability of the controller board to process the G-Code fast enough whereas a result comes to the ability to process the G-Code fast enough for the step frequency desired. So what processing power the microcontroller being used in the controller board and the frequency at which it runs, is one limiting factor to increasing speed without deteriorating print quality. I want to emphasize this: It is just one parameter. So I decided to buy the BTT-SKR-Pro V1.2 controller board for upgrading my printer. It has an ARM Cortex M4 controller running at 168 MHz.

Another parameter for accelerating the printing speed without deteriorating the print quality is the performance of the stepper motor involved. When the stepper motor is unable to execute its steps at the frequency the stepper motor driver is wishing it to do, are a loss of steps and acoustically perceivable behavior. I started to investigate what torque the stepper motor being used might have, as no plate or other source of information from the supplier is available. When you go to eBay and to Amazon you will find that the NEMA 17 stepper motors you can find there very often do not include that kind of information. So I went to the websites of manufacturers of stepper motors and to inform me what were the nominal values for voltage and current their NEMA 17 stepper motors had and what holding torque those stepper motors have. Soon I found that the difference in holding torque of their NEMA 17 stepper motors showed a factor of 3x to 4x.

Now a short paragraph about stepper motor technical topics I consider relevant in this context. The torque a stepper motor can offer is directly related to the amount of current its coils do tolerate, and only to the amount of current. So when you have the choice between stepper motors with the same torque, choose the one that has the lowest nominal voltage value. Why? Because this means its coils do allow a higher amount of current. I was aggressively and personally attacked by community members of 3D forums that faded away as soon as I presented the section from the company Trinamic that makes the stepper motor driver ICs that spoke that stepper motors were usually get supplied voltages of up to 20x the nominal voltage value. For my sailboat model stepper motors used as winches, I build a battery pack consisting of 12 LiFePO4 batteries connected in series. This pack when fully charged supplies a voltage of about 40 VDC and when so much emptied that a recharge is required 24 VDC are being supplied.

So, if only the amount of current is relevant for the torque a stepper motor can offer and that amount of current is specified as the nominal current value of a specific stepper motor, what do we gain by supplying voltages much higher than the nominal voltage value. The stepper motors I use as winches to control the position of the sails have a nominal voltage value of 3.6 VDC and I am applying between 40 VDC and 24 VDC depending on the charge of the batteries cells in my battery pack. The answer is related to why the torque being specified for a stepper motor is the "position holding torque" value.

For a stepper motor to do a step, and here I am limiting myself exclusively to bipolar stepper motors, the voltage pattern applied to the i.e. 4 cables of the stepper motor changes according to rules that can be followed easily in modern stepper motor drivers. So what changes is the value of the applied voltage to the coils in the stepper motor whenever it makes a step. The higher the frequency of steps is the higher is the absolute value of the induced voltage in the coils of the stepper motor:

Veffective = Vapplied + (-Vinduced)

So when the stepper motor is holding its position, that the value of the induced voltage is ZERO. The result is that Veefective = V applied. So if the stepper motor is holding its position the torque is the one the motor makes available when the nominal voltage value is applied. But what happens if the stepper motor is increasing the frequency at which it does steps? The absolute value of the induced voltages gets closer and closer to the value of the applied voltage and as the equation above shows, the effective voltage gets closer and closer to ZERO and as a consequence, the current value gets closer to ZERO and as a consequence, the available torque gets down to ZERO. What stepper motor driver ICs do, is that they use a PWM and control the amount of current flowing gets limited to the nominal current value by adapting its duty cycle. So, the higher the value of the applied voltage is, the higher the step frequency can be and the induced voltage will require higher step frequencies before the torque drops sp far that it limits the available torque.

So, in the dance of mutually impacting parameters, if the applied voltage is high enough and the nominal current value is as high as possible, that the stepper performance will not be limiting the performance of the 3D printer. But, be aware of, also CNC machines, like those CNC milling machines use G-Code to control the job of milling. But CNC milling machines and 3D printers share many o the same functionality and use the same G-Code instructions, other functionality is specific for 3D printing and CNC machines.

One result of my investigation is that I am planning to do experiments and use a 3D printing controller board to get a better understanding of where the G-Code has the same functionality and where it is different and how this difference is. The Marlin operating system available for any 3D printing controller board, as of today version 2.0.7.2 claims to support both 3D printing and CNC systems but I have yet not found a source of information as to how Marlin has to be set up and which G_Code instructions are required in those applications. Marlin is an operating system that is for me in an unusual degree customizable by setting the parameters in the 2 files responsible within the code. This is due to 3D printers as nearly every printer is somehow different from another.

Another thing that has been created thanks to the need for 3D printing is the so-called "SilentStepSticks". These are boards that were developed as OpenSource projects as the result of the cooperation between Trinamic and Watterott, 2 German companies. Now you have Chinese companies like BTT offering their own makings of those boards. As of today, the most common boards are the SilentStepSticksTMC2208 and SilentStepSticksTMC2208 which use the stepper motor driver controllers TMC2208 and TMC2209 from Trinamic. As I have already written, my goal is to develop knowledge and implementations which try to influence the parameters related to the operation of stepper motors so, that they are not the limiting factor. Using the BTT-SKR-PRO V1.2 board with the Cortex ARM M4 controller running at 168MHz the Marlin OS running on that controller board will be able to support higher frequency steps by offering a higher G-Code execution performance. As stepper motor driver boards I have purchased the SilentStepSticksTMC5160hv from Watterott which as of 2021 will use the TMC516i driver ICs. The TMC5160hv is characterized to allow a current flow of up to 20A and a voltage of 60 VDC. I have purchased a Meanwell 600W 48 VDC power supply so as to be able to operate those boards and the connected stepper motors with a supply voltage of 48 VDC. The amperage of those NEMA17 stepper motors is well below 2 A. Once I get to experiment with this setup a still do be build a DIY CNC milling machine, I plan to use NEMA 34 or NEMA 42 stepper motors for the CNC milling machine. These stepper motors do need less than 4 A to 5 A, so the SilentStepsStickTMC5161 will have no problem driving these stepper motors.

Another set of functions available to control stepper motors and made available with the Trinamic stepper motor drivers would have to be presented in another contribution. If you go to my YouTube channel "Hellmut Kohlsdorf" which I used to make available videos of my experiments you can watch the video where I tried to identify up to what frequency the stepper motors that will be used as winches in my model sailboat is relatively long as I did not expect that I would be able to achieve such a high step frequency. You can see on the setup of the experiments 2 multimeters, one showing the voltage and one the amperage as I keep accelerating the stepper motor. The recording, I am an awful speaker, was done using the Spanish language, so please excuse me. One selling effect, the low noise level possible using either of the stepper motor driver boards, is extensively used by marketing in the 3D printer market. But in this video, you can see that there are step frequencies with very different levels of noise at any speed. But also functions like s-Shape for acceleration and deceleration, have important impacts that benefit 3D printing at higher speeds. As of today, the controller used on the controller cards is still pretty low processing power so that this kind of function is disabled in the setup of Marlin.

One question I will investigate at a later stage is if Marlin 2.0.x is built upon CIMSIS API. This API hides the specifics of a specific controller so that porting software from one version of an ARM Cortex M controller to another device of the same kind. If this would be the case much faster ARM Cortex M devices could be used and i.e. dual-core versions of it. The experiments of Kersey Fabrications on YouTube show that when the controller has to deal with a graphics interface the additional computing power would break the controller's ability to serve a higher step frequency. Dividing the pure G-Code processing on an M4 core and the peripheral processing to the second Arm Cortex m0+ core would fix that problem a bit.
Hey. Unusual and expert approach. But how to choose the right stepper motor driver? There is a lot of info via google etc but
 
I've always found ANY mechanical system to be very slow compared to a CPU running at even 1MHz. My 3D printer uses the A4988 type modules to drive the steppers and I've no idea which processor but suspect some lowly avr or pic.

{of topic}I loved the 6809 and wrote a few games for the Dragon and TRS80 color computer. First processor I'd used that had a 16 bit accumulator. All in assembler of course. The most popular game was called Chuckie Egg and written in four colour mode.
{/of topic}

Mike.
 
I've always found ANY mechanical system to be very slow compared to a CPU running at even 1MHz. My 3D printer uses the A4988 type modules to drive the steppers and I've no idea which processor but suspect some lowly avr or pic.

Any mechanical system is VASTLY slower than the processor - and in mechanical terms even 1MHz is incredibly fast. In general most PIC/AVR etc. programs spend almost all their life waiting for something mechanical to happen :D

A lot of 3D printers seem to use Ardunio's and similar, although some do seem to brag about having faster processors than others (not for any real reason) and more memory (which is always useful). Requirements are pretty low, as most of the 'clever' stuff is done on the computer that generates the file for the printer to download.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top