Welcome! Log In Create A New Profile

Advanced

Reducing microstepping options

Posted by martinprice2004 
Reducing microstepping options
December 31, 2011 09:42PM
My prusa runs a Ramps 1.2 board and when I first ran it up I assumed it was 16x microstepping, but quickly found it was printing twice the size, so set my firmware to 1600 steps per rev. (200 x 8)

To cut a long story short my machine runs really well 8x microstepping, very quiet and the pololu driver heatsinks are cold enough to touch by hand when printing as they are effectively doing only half the switching.

I found this setup really by accident, so If some of you are struggling with firmware cycle times, missed steps, very hot electrics etc. perhaps you might consider this an option as it works very well.

Its just a five minute job to switch over the board jumper pins and alter the firmware variables.
Re: Reducing microstepping options
January 01, 2012 04:33AM
Reducing the microstepping does not make the drivers run cooler. They are switching constantly at a high frequency, even when the motor is stationary because they are chopping to regulate the current.

Switching from 16x to 8x will just make the machine a bit noisier, the torque and heat will be the same.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 01, 2012 05:09PM
nophead Wrote:
-------------------------------------------------------
> Reducing the microstepping does not make the
> drivers run cooler. They are switching constantly
> at a high frequency, even when the motor is
> stationary because they are chopping to regulate
> the current.
>
> Switching from 16x to 8x will just make the
> machine a bit noisier, the torque and heat will be
> the same.

My main thrust of the argument was really to state that just because 16x microstepping is available on a reprap, it does not necesarily mean it is the one to go for. I put this up hoping that others would give it a try and feedback their findings on what I am seeing.

Unfortunately for the second time recently you have come back immediately trying to trounce any suggestion that there may be benefit. I find this unfortunate as I often read you comments and blog and have gained considerable knowledge from them.

The effect can depend on what motors you have and loading, but Increasing the microstepping frequency can have a great infuence on torque. As the step time reduces, the circuit current has less time to reach and remain at peak before bieng reduced. This is why when microstepping there comes a point where torque reduces and the motor stalls even though the mechanical parts are moving at the same rate. I am also aware of how sine waves are generated electronically.

16X microstepping may be quieter, but on my machine the 8X is extremely quiet. In fact so quiet the noisiest bit of my machine is actually the power supply fan, not the stepper motors, so I wouldn't use this as an argument not to give it a go.

There are additional problems associated with high rates of microstepping such as overstepping where the motor has to compensate for going past the next position and tries to reverse until sufficient torque is generated. This requires more current (heat?). It is sometimes the case that you have to wind the pot up on pololu drivers a little when microstepping. Furthermore there are cases where microstepping actually reduces accuracy. Reading the posts of others here, some are struggling with very hot pololu drivers and when I look at my machine it runs really very cold electronically. My setup is similar to many other machines and this seems to be the most likely difference that could account for my observations.

These findings are mirrored in many places on the web should you wish to take a look. eg wiki page on stepper motors for example and many CNC machine websites. Here is one example. These confirm that torque, current and heat can change with high microstepping rates.

All I was suggesting is that it might be worth taking a look at.
Re: Reducing microstepping options
January 01, 2012 07:04PM
Well it seems we totally disagree again. That article you linked is nonsense. The torque is proportional to displacement from the target position. How finely that target position is defined has no relevance at all. Yes if you change the target position a small amount you only get a small torque but if the rotor doesn't keep up the torque increases on the next step to what it would be if you stepped twice as far. If you took it to its logical conclusion and applied a pure sine, cosine drive current you then have infinite microstepping and that article would imply you had no torque at all, when in fact you get just as much torque as full stepping but much smoother. Yes a very small microstep may not overcome static friction but that doesn't mean it reduces the accuracy it just means it may not increase it as much as you expect and eventually not at all.

Most stuff on the Web about microstepping is plain wrong.

At high speeds the torque falls off because the current never builds up to the target value. It doesn't matter whether you are microstepping or not, as soon as it lags below the target the transistors switch on an stay on. Whether the target then increases in small steps or large ones is irrelevant, the current simply follows the curve given by the voltage and the inductance.

Try measuring the temperatures and then change nothing but the micro step size. I am confident you will see no difference. The sound will be half the frequency and twice the amplitude though with 8x. I have 8x on my Mendel and 16x on my Prusa.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 02, 2012 02:44AM
nophead Wrote:
-------------------------------------------------------
> That article you linked is nonsense.
> Most stuff on the Web about microstepping is plain wrong.
>

So what your saying is an article in a respected machine tool design magazine by an engineer who designs them for a living is talking nonsense. As well as all the other articles I refered to.

In addition the collective knowledge of the world is nothing compared to what you know about the subject?

Are you seriously that arrogant or are you just winding us all up?
Re: Reducing microstepping options
January 02, 2012 03:23AM
>In addition the collective knowledge of the world is nothing compared to what you know about the subject?

No but random Web articles are not representative of collective knowledge of the World. That is generally to be found in peer reviewed technical papers.

>Are you seriously that arrogant or are you just winding us all up?

No I put forward a reasoned argument why increasing microstepping resolution does not reduce accuracy and why it does not reduce torque or increase temperature. If you can find fault in my reasoning then maybe I am wrong. If you think about it though it would be totally strange if any of those things were true, especially when you consider to case of infinite microstepping resolution which is pure sinewave drive. According to your reasoning the motor would be very inaccurate, zero torque and get very hot, but exactly the opposite is true.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 02, 2012 03:50AM
The heat generated in the motor is mainly due to the RMS power, which doesn't change when you microstep, and losses due to the high speed chopping, which again does not change when you microstep. All you are doing is changing the target current more often in smaller steps. That is pretty irrelevant to the chopper which is switching many times faster.

A lot of places on the web state microstepping reduces torque but they are comparing apples with pears because when microstepping the current for two coils on is 70% to each, so you should compare with full stepping at 70% current or microstep at 1.4 times the rated current. These cases give the same power dissipation and the same torque.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 02, 2012 03:56AM
Another argument: When running at 16 steps half the positions are exactly the same as when running at 8 step, how can it be less accurate?

The positions you can stop on with 8 step will be exactly the same with 16 step. But with 16 step you have the choice of stopping half way between. It might not be exactly half way between, and if you had a lot of static friction it may not move at all, but it is never worse than 8 step.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 02, 2012 06:05AM
Now you are confusing resolution with accuracy.
Re: Reducing microstepping options
January 02, 2012 06:27AM
Neither get worse when you increase microstepping. You can hit all the same stopping points you could do with 8x with 16x with the same accuracy as on those positions the coil currents are exactly the same.

In addition you can hit points halfway between with the same accuracy. So you have doubled the resolution, the accuracy is about the same as it depends on the motor. There is nothing special about the 8th step positions (except the ones corresponding to one coil on), it will hit the 16th step ones just as accurately.

Edited 3 time(s). Last edit at 01/02/2012 06:42AM by nophead.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 02, 2012 08:26AM
martinprice2004 Wrote:
> So what your saying is an article in a respected
> machine tool design magazine by an engineer who
> designs them for a living is talking nonsense. As
> well as all the other articles I refered to.

I have no dog in this hunt but... the type of articles which you refer to are basically written as PR pieces for the writer's company. I know this from personal experience. A lot of these articles are basically fluff, usually containing little substance or are largely spurious, if not plain misleading.

> In addition the collective knowledge of the world
> is nothing compared to what you know about the
> subject?

Unfortunately, the collective knowledge is often based on anecdote and folklore, and is frequently wrong, so it would not surprise me.

> Are you seriously that arrogant or are you just
> winding us all up?

To be fair, he presents a reasoned argument which seemed quite logical, rather than appealing to authority.

Sure, it's not nice to get rebutted, but if you what you say is wrong, people are entitled to state their opinion. If you don't like that, just ignore them.
Re: Reducing microstepping options
January 02, 2012 09:12AM
If this can help, there is a very clear discussion of this particular topic by one Mariss Freimanis in this forum:

[www.cnczone.com]
Re: Reducing microstepping options
January 03, 2012 04:10AM
Thank you for the links it was very informative.

It does appear that motor torque is sometimes unaffected by microstepping and at other times does get affected. It states that this is dependant on a few factors the major one seems to be the speed of the motor if I understand it correctly.

It also appears that there are two components to torque. The drive torque (The torque available to do work on the machine) and holding torque (the torque which holds the step position and influences how likely the stepper is to reach the correct position when decelerating ie the accuracy of the machine). The second of which is affected more readily by changes in microstepping. Again please feel free to correct me if I didn't understand that.

A further thing to note was that these guys experiment with microstepping / full step / half step and have a wide range of results depending on what machine loads, what speed and what motors they are using, nothing is fixed and they dont just pick the maximum microstepping available as it makes no difference (Except for levels of noise)

Taking this all on board this may explain why my electronics seem to run cooler when 8x. Holding torque on 8x may be slightly higher than 16x and it is also more suited to high speed applications (16x is more suitable for lower speed high precision) It may be that I am able to run the drivers on a lower current setting (pot is adjusted lower on the boards). Its a difficult one to know for sure as like most I set up the machine and then gradually increased the post settings until good stepping was established.

I am also curious as to what effect only having to supply half the number of pulses the front end of the drivers has and also the implications in firmware cycle time.
Re: Reducing microstepping options
January 03, 2012 06:01AM
martinprice2004 Wrote:
-------------------------------------------------------
> Thank you for the links it was very informative.
>
> It does appear that motor torque is sometimes
> unaffected by microstepping and at other times
> does get affected. It states that this is
> dependant on a few factors the major one seems to
> be the speed of the motor if I understand it
> correctly.

As the speed increases the first thing that happens is the current can't keep up with just the fast rising parts of the sine wave but the chopper still limits it on the slower parts, so you do get a lower average current and a loss of torque. At higher speeds it permanently lags, so the chopper is always on and you get the equivalent of full stepping. So yes you can get more torque at some speeds by reverting to full stepping.

Generally, with belt drive, the XY motors are not going very fast. 100mm/s is only the equivalent of 1000 half steps / second. Most motor data sheets go up to 10 times that. People in the CNC world are running screw drives much faster. I doubt you would notice any improvement reverting to full step on a reprap and certainly the difference in torque at high speed between 8 and 16 step would be marginal.

>
> It also appears that there are two components to
> torque. The drive torque (The torque available to
> do work on the machine) and holding torque (the
> torque which holds the step position and
> influences how likely the stepper is to reach the
> correct position when decelerating ie the accuracy
> of the machine). The second of which is affected
> more readily by changes in microstepping. Again
> please feel free to correct me if I didn't
> understand that.

No the motor only provides torque when the load displaces the shaft from where it wants to be, moving or stationary. It makes no difference whether it is on a full step position, one of the 8th step positions or a 16th step position, the torque is the same for the same displacement.

There is a limit where the microstep size is so small the displacement of one step does not generate enough torque to overcome stiction, so it does not actually move. That is a special case though, if you are moving several steps then when you come to stop it doesn't matter whether you stop on a full step position, or a /256 step position, you will stop with the same accuracy. The accuracy does not get worse. For that to happen stopping on a 16th step would have to be not between the two 8th steps either side of it. Why would that happen? There is nothing special about the positions or what the driver does, it just uses current settings in between the 8th step values so the rotor should stop somewhere in between the 8th step positions.

>
> A further thing to note was that these guys
> experiment with microstepping / full step / half
> step and have a wide range of results depending on
> what machine loads, what speed and what motors
> they are using, nothing is fixed and they dont
> just pick the maximum microstepping available as
> it makes no difference (Except for levels of
> noise)
>
> Taking this all on board this may explain why my
> electronics seem to run cooler when 8x. Holding
> torque on 8x may be slightly higher than 16x and

No it is the same. Half the positions are exactly the same, why would the torque be less in the positions in between? It is proportional to the vector sum of the coil currents and they are sine and cosine, so the sum is a constant.

> it is also more suited to high speed applications
> (16x is more suitable for lower speed high
> precision) It may be that I am able to run the
> drivers on a lower current setting (pot is
> adjusted lower on the boards).

That could be true with the very high speed slow acceleration of Marlin. When reprap moved from half step to microstepping the opposite was true. With microstepping the first step is smaller, so there is less jerk, so you can set the current lower.

>Its a difficult one
> to know for sure as like most I set up the machine
> and then gradually increased the post settings
> until good stepping was established.

I just set as high as I can, without the motors or the drivers getting too hot. That way I have the highest torque and so the best accuracy. The motor stops when friction equals torque. Torque is proportional to current times the sine of displacement. Higher current means lower displacement, so it stops closer to where it should be.

Also the constant off time drivers have a minimum current they can achieve. If that is lower than your first micro-step value you get a distortion. See: [hydraraptor.blogspot.com]

In that case you might find 8th step runs smoother than 16th step at lower currents, because the minimum needed for16th step to not be distorted is twice as much.

The distortion is never less accurate than 8th step, because the current is somewhere <= to the 8th step value, but it does sound rough.

>
> I am also curious as to what effect only having to
> supply half the number of pulses the front end of
> the drivers has and also the implications in
> firmware cycle time.

It makes life easier for the firmware, but it doesn't affect the drivers.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 03, 2012 07:28AM
Hang on a minute. You said changing microstepping makes no difference, only to noise levels

So now you are admiting that torque can change and you might have to revert to full stepping in some cases. You also say that there may be a small difference when stepping X8 or X16 in some cases.

In addition you also admitted about a year ago that you have to set the current up on your drivers 1.4X to achieve the same torque when microstepping Vs full step. So what value of microstep is chosen does affect what current you need to supply through the drivers? But this would make no difference to how hot the electronics run?

reprap forum

but now you are saying

"Try measuring the temperatures and then change nothing but the micro step size. I am confident you will see no difference. The sound will be half the frequency and twice the amplitude though with 8x. I have 8x on my Mendel and 16x on my Prusa."

So there COULD be some difference?

Edited 2 time(s). Last edit at 01/03/2012 07:55AM by martinprice2004.
Re: Reducing microstepping options
January 03, 2012 09:15AM
martinprice2004 Wrote:
-------------------------------------------------------
> Hang on a minute. You said changing microstepping
> makes no difference, only to noise levels
>
> So now you are admiting that torque can change and
> you might have to revert to full stepping in some
> cases. You also say that there may be a small
> difference when stepping X8 or X16 in some cases.

At the speeds a reprap runs I don't think it is significant.

>
>
> In addition you also admitted about a year ago
> that you have to set the current up on your
> drivers 1.4X to achieve the same torque when
> microstepping Vs full step. So what value of
> microstep is chosen does affect what current you
> need to supply through the drivers? But this would
> make no difference to how hot the electronics
> run?

No this is what most of the World seems to miss-understand and where the myth that microstepping has less torque comes from. Even Mariss Freimanis, who otherwise seems very knowledgeable states this wrong in that thread when he says they have the same torque for the same peak current.

Motor specifications give the torque for full step, two coils on at a specified current, say for example 1A, and with a full step driver this is both the peak and the average current.

A 1A full step driver will give this current and torque. An Allegro driver with vref set to "1A" will give 70% of that current in the two coils on state, regardless of whether you have it in full step, or x16 mode. The peak current, with one coil on will be 1A but that gives 70% torque and 50% power reduction. To compare apples with apples you set the Allegro vref to 1.4 times the two coil on current, in this example 1.4A. The torque is then the same as the full step case and the power dissipation in the motor and driver is the same.

When two coils are on the rotor is midway between them so each coil contributes I * cos(45) * K to the torque. The current in each coil is 1A so the total torque is 2 * cos(45) * 1A * K = 1.4K. The power is 2 * I^2 * R = 2R in this case.

When one coil is on the rotor is at the pole piece so it contributes full torque, cos(0) * K. So the torque is 1 * cos(0) * 1.4A * K = 1.4K. The power is 1 * (1.4)^2R = 2R.

So with the peak current set to "1.4A" on a Allegro driver we get the same power dissipation and the same torque as a full step driver. What Mariss should have said is that for the same RMS current you get the same torque.



>
> reprap forum
>
> but now you are saying
>
> "Try measuring the temperatures and then change
> nothing but the micro step size. I am confident
> you will see no difference. The sound will be half
> the frequency and twice the amplitude though with
> 8x. I have 8x on my Mendel and 16x on my Prusa."
>
> So there COULD be some difference?

The temperature will not change unless you change the current. The temperature rise is proportional to current squared and is not affected by microstepping.

If you can set the current lower at 8x then it will run cooler, but I doubt you go fast enough to see or notice the marginal torque difference at the top end, and the jerk is twice as big when setting off so you are more likely to need slightly more current than slightly less.

Having said that, if you are running the current so low you are getting distortion at 16 steps that might explain why you can lower current more at 8x. It is easy to test. If you attach a long pointer to a motor and step it very slowly so you see each microstep, if the current is set too low you will see it not step evenly. That is another reason why you should set the current as high as possible, not as low as possible. You get better micro step linearity because the lowest current microstep becomes bigger in comparison to the ripple current. The ripple current subtract a constant offset from all the microstep levels so creates some distortion.

I haven't checked the Pololu drivers to see if they got the values right for the motors we use. It is on my list of things to do as it could easily be wrong.

Edited 3 time(s). Last edit at 01/03/2012 09:23AM by nophead.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 03, 2012 10:59AM
In fact thinking about it a bit more, 16x will have very slightly more torque than 8x at high speeds. It applies the current a bit earlier in the first step of the sinewave and subsequent odd steps. In the even steps it is exactly the same as 8x.

It is only drives that switch to a square wave at high speed to maximise the area under the curve that gain an advantage because in the slower part of the sine wave where the current can catch up it is limited but not with square wave drive.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 03, 2012 11:38AM
In summary once you switch to an approximation of sinewave drive using finer steps does not reduce torque, increase heat or reduce accuracy. At high speeds square wave drive can give more torque though.


[www.hydraraptor.blogspot.com]
Re: Reducing microstepping options
January 03, 2012 01:05PM
Lets just measure the drivers at 1/8 and 1/16 stepping so we can put this to rest already.

I've personally noticed no difference going from 1/8 to 1/16th stepping in heat dissipation, torque, or accuracy. I haven't specifically been testing those (other than accuracy) though.

The only trade-off I've experienced for reprap applications is sound output and firmware pulse per second limitations. I'm more than willing to be proven wrong.


www.Fablicator.com
Re: Reducing microstepping options
January 04, 2012 05:29AM
Yes I think this information would be useful. My original post was really intended to start a discussion on this and to see what information was out there. I also read the firmware forums here and there is a need to reduce the loading on the firmware side of things as well which reducing microstepping could offer.

The link below shows some simple setups to measure torque, holding torque etc. which may spark a few ideas.

Stepper motor investigation

The current pot settings on the pololu is an interesting one. I work from the other end and set mine to as low as possible so the stepper motor works ok plus a little more.

My prusa has a drive which gives 40mm of travel per rev at 8x microstepping this is a resolution of 0.025mm per step. Even if the steps are a little uneven this is not really an issue when I am producing parts at +/- 0.5mm at best.

If I remember rightly from my machine tool days a rule of thumb for machine design, gauge design, capability studies etc was you needed a resolution of at least 1/10 of the working tolerance and this easily achieves this. So I set the current pot as low as possible because I don't really need the extra accuracy (which is quite small) that running at high currents gives me. This way I get a machine that steps ok for what I need, and I get greater life of motors and drivers and don't need any additional cooling fans. The other main benefit is the machine is safer mechanically. The motors do less damage if there is a jam up or if you get your fingers in the way.

Edited 1 time(s). Last edit at 01/04/2012 06:28AM by martinprice2004.
Sorry, only registered users may post in this forum.

Click here to login