Welcome! Log In Create A New Profile

Advanced

Dither Stepping - avoiding midspeed resonance

Posted by GeertB 
Dither Stepping - avoiding midspeed resonance
March 24, 2009 04:17PM
My Keling stepper motor / RRRF Stepper Motor Driver v1.2 combo tends to resonate a lot in my test setup at around 200-300 steps per second. I documented my method for avoiding this through an alternative stepping method in my new blog at [web.mac.com]

-Geert
Re: Dither Stepping - avoiding midspeed resonance
March 24, 2009 05:10PM
Hi GeertB,
I am interested in your technique but I don't understand what the sequence labelled "dither step transition" represents. Please could you explain a little more.

Also I can play the video, is it Mac only?

Another technique I have read about for avoiding resonance is simply to switch from half step to full step at a critical step rate. The resonant frequency is different for each so you can skip over the problem by switching it the right point, IIRC.

Edited 1 time(s). Last edit at 03/24/2009 05:10PM by nophead.


[www.hydraraptor.blogspot.com]
Re: Dither Stepping - avoiding midspeed resonance
March 24, 2009 05:55PM
OK, I'm indeed missing an explanation there!

When stepping from a state 0 to a state 1, this transition is divided up in 12 ministeps.

I guess you mean you can't view the video, it's H.264 format to keep size down. QuickTime plays it as well as other players. I'll reformat it. Switching to full step at low speeds will make things only worse as the objective is to avoid the start-stop behavior at low speeds. At higher speeds, I plan to switch to full stepping (with two windings on at a time) o see if that'll help absolute max. speeds.

-Geert
Re: Dither Stepping - avoiding midspeed resonance
March 24, 2009 06:10PM
I see so you are sort of adding PWM in s/w to make the transition gradually as microstepping does.

Sorry typo, yes I can't play it. Quicktime says it needs a new codec and there isn't one available on the web.

Yes half stepping is better at low speeds and full step at high speeds. As you approach resonance at half step you can switch to full step, which drops the frequency by half, avoiding the resonance until you approach twice the frequency. At which point I suppose you scan switch to half step again. I have never tried it but I read somewhere it was a technique.


[www.hydraraptor.blogspot.com]
Re: Dither Stepping - avoiding midspeed resonance
March 25, 2009 01:09AM
Indeed. The speed at which I have most resonance at the moment, 200-300 half steps per second, is really quite slow. I'll try switching to full steps, but I would expect it to get worse. The point is that the speed is still low enough that the motor starts and stops. When the motor stops, it will oscillate back and forth until it has been sufficiently damped.

It really should move slower so that we obtain continuous motion. While we might be able to avoid some resonance through full stepping, I think the "unevenness" of the motion will become worse. As I can easily simulate full-stepping using two step commands with a few microseconds wait in between, I'll do the experiment.

Assume the continuous function p(t) gives the position at time t. Then what we are doing is essentially sampling this signal into a series of discrete steps. In audio processing, you'd add noise with a triangular probability density function (TPDF) before quantization to avoid distortion: it is much less objectionable to have sampling noise spread over the entire audio spectrum than to have an error signal that is a function of the input.

My hope is that we can use a similar approach for driving steppers, including using a fixed sample (step) rate. This would greatly simplify the control logic, as a single interrupt handler at 4 KHz or so could handle all 3 axis, as well as the heater. Note that your control method is very similar to the one I'm considering for the steppers. In your case noise is added by the electronics before quantization of the error signal.

I'm planning to first add some current measurement (using the sense resistor) and maybe a software adjustable Vref for the chopper, so I can get a better picture of what is going on.

As I don't have a scope, I though I might use the Arduino's ADC to measure the voltage over the sense resistor Rs. However, I'm somewhat conflicted on how to get a good ground reference and how to avoid too much noise in my signal, as I expect the ground on the Stepper Motor Driver (SMD) to be somewhat noisy. Shall I add some thick wire to connect the grounded side of Rs to the Arduino logic ground and Agnd, or would this only make matters worse? To dampen things out a little bit, I to maybe put a 4k7 ohm resistor and 1nF capacitor close to the ADC input as follows:



Also, would you maybe know if I can use a PWM output of the Arduino with some RC network to get a crude DAC for setting Vref? It would only have to respond slowly.

-Geert
Re: Dither Stepping - avoiding midspeed resonance
March 25, 2009 06:09AM
Geert,
I think we are talking about two different aspects of resonance.

I was considering resonance a problem when the oscillation builds up until the motor skips steps. That is the effect switching step modes avoids.

I think you are more concerned about the noise / vibration the motor produces. That is basically down to the fact that each step accelerates and decelerates the inertia / mass of the load. A single step is not too noisy but as speed increases it gets more objectionable and can resonate whatever it is mounted on. For example HydraRaptor's z-axis resonates the MDF box it is mounted on, which is noisy but doesn't lose steps. Full stepping does indeed make it worse.

As speed increases durtehr the vibration starts to reduce because the inertia of the motor starts to smooth out the steps and it is at these sorts of speeds that you can switch to full step to get more torque / speed.

Vibration is normally fixed by microstepping or a flexible shaft coupling, but I can see your dithering having a similar smoothing effect to microstepping.

An interesting approach, as you say it is like my heater control, where random noise on the thermistor reading gives a pseudo PWM output.

I am not sure what you will achieve get by measuring the voltage across Vref. It will be noisy and it has the stepper chopping waveform on it. Khirali posted some waveforms in this thread [forums.reprap.org]

Yes it should be possible to control Vref from a PWM and a filter. I plan to try that myself to give more power during acceleration and deceleration and back off in between to keep the motors cool.


[www.hydraraptor.blogspot.com]
Re: Dither Stepping - avoiding midspeed resonance
March 26, 2009 02:46PM
Hi Geert

Can we see the code you are driving this with?

Thanks
Re: Dither Stepping - avoiding midspeed resonance
April 02, 2009 09:33PM
Yes, I'll put the code up soon (it's not on the computer I'm writing this message on). I essentially have one stepper tester program that tends to grow organically while I'm experimenting and testing things. Hope it'll be useful.

Nophead, you wrote:
<< As speed increases durtehr the vibration starts to reduce because the inertia of the motor starts to smooth out the steps and it is at these sorts of speeds that you can switch to full step to get more torque / speed. >>

I did some tests today, but I don't get any extra speed with full stepping. Initially I simulated the full stepping in software, doing two very quick steps and then a double long wait. As I didn't find any difference (making sure not to use wave drive), I desoldered the solder pad connection so I can now freely experiment. Either way I get 1600 half steps per second, or 800 full steps. I didn't have my rig setup for torque testing today, so I can't comment on torque yet. I see more experiments in my future...



From my tests today, and the basic stepping sequence, I wouldn't be surprised if the currents through the coils essentially become sinusoids, with the motor lagging 90 degrees or so, regardless of drive pattern.

-Geert


--
See [web.mac.com] for my repstrap blog with stepper tests
Re: Dither Stepping - avoiding midspeed resonance
April 03, 2009 04:10AM
Quote

1600 half steps per second, or 800 full steps

Is that the pull-in rate you are measuring, i.e. the maximum step rate that the motor will start at? That is simply limited by torque / inertia.

Where full step allows more speed is at the pull-out rate, i.e. the point where inductance limits the torque to less than the load requires, but you only get to that by using acceleration.


[www.hydraraptor.blogspot.com]
Re: Dither Stepping - avoiding midspeed resonance
April 03, 2009 11:07AM
No, I accelerate and decelerate. Right now, I start at 100 steps per second, and for 150 steps increase the speed by 10 steps per second. See the plot below of time versus speed (in steps/sec) The maximum acceleration to get to 1600 half steps per second is about 250rad/s^2.

Note that the 1600-1700 steps per second seems a kind of absolute limit. I have the current limit set to a little below the max of 2A during these experiments to keep everything reasonably cool. Earlier I did some torque tests where I still could get about 1 watt of power at 1500 steps/sec, but the motor stalled unloaded at 1700 steps/sec. I'll be away for two weeks, but need to do some more testing afterwards hoisting weights and varying max. current.

-Geert




--
See [web.mac.com] for my repstrap blog with stepper tests
Re: Dither Stepping - avoiding midspeed resonance
April 13, 2009 01:52PM
I came across a simple mechanical device which looks like it does the same job: [hydraraptor.blogspot.com].


[www.hydraraptor.blogspot.com]
Re: Dither Stepping - avoiding midspeed resonance
May 16, 2009 05:41AM
I haven't read up on stepper motor control theory recently, but this is how I understand it ?

Half step winding power up states:
a+
b+
a-
b-
(repeat)

Full step winding power up states:
a+, b+
a-, b+
a-, b-
a+, b-
(repeat)

The way I've done it before, and am doing at the moment, is interspersing them:
a+
a+,b+
b+
a-,b+
a-
a-, b-
b-
a+, b-
(repeat)

Looking at the direct drive states to the windings,it goes like this in interspersed step mode:

0001
0101
0100
0110
0010
1010
1000
1001

If you follow the ones, then you can see the overlap created. This doesn't addresses resonance issues at all, or saturation, but it does provide for slightly better step resolution, and I think the average torque would be higher than with using each of the normal step modes alone.

The ARM chip I'm using has an STM application note in which the MMU is used to unload waveforms to the PWM outputs, which I will probably do in my application later, but I'm still learning some critical stuff at the moment.
Re: Dither Stepping - avoiding midspeed resonance
May 16, 2009 06:26AM
You have the terminology slightly wrong:-

a+
b+
a-
b-
Is wave mode

a+, b+
a-, b+
a-, b-
a+, b-
Is full step

a+
a+,b+
b+
a-,b+
a-
a-, b-
b-
a+, b-
Is half step

Wave isn't often used. Torque is highest in full step as there is always two coils on. Half step gives better resolution.

There are some interesting alternative half step schemes here: [www.piclist.com]


[www.hydraraptor.blogspot.com]
Re: Dither Stepping - avoiding midspeed resonance
May 16, 2009 06:40PM
nophead Wrote:

> Wave isn't often used. Torque is highest in full
> step as there is always two coils on. Half step
> gives better resolution.
>
> There are some interesting alternative half step
> schemes here:
> [www.piclist.com]
> /halfstep.htm

Interesting,
It looks like a very simple way to achieve constant current (total) drive, and therefore considerably smooth the drive.

I wonder how it affects low speed angular accuracy ?

thanks,
Graham.
Re: Dither Stepping - avoiding midspeed resonance
May 21, 2009 03:52AM
Under certain circumstances it is impossible to accelerate a steppermotor past a certain speed because of resonances. This speed is well in the region that can only be reached by acceleration (above the pull-in curve).
Where I work, we noticed these resonances can be dampened by attaching the stepper *not* directly to the frame, but via a damper-ring, which gives the housing of the motor a slight freedom of movement. In principle, this element decreases your positioning accuracy, but since the element is very stiff, this is acceptable.

These rings are hard to get on the market. NMB sells them with their hybrid steppers (i've seen them on Nema17 and Nema23 hybrids). Copiers and printer (big ones, not desktop) are full of them.

The rings are 2 steel plates, connected with a stiff rubber compound. The rubber acts as a spring-damper combination. I searched for a picture, but didn't find one. What I would suggest is to play around with the way your stepper is attached to the frame. Experiment with dampening rubber or so.

And another experience comes to mind: a not so stiff motorbracket can also cause problems. Look critically to the way your motor is attached to the fixed world.


About the resonances at low speeds: almost every hybrid stepper has nasty resonances at low speeds (150-300 fullsteps/sec). The forementioned damper don't help here. As far as I know, it is best not to operate the motor in this region.
Where I work, we accelerate quickly through that region, or start at a frequency
above that.

Edited 1 time(s). Last edit at 05/21/2009 03:56AM by TomNagel.
Re: Dither Stepping - avoiding midspeed resonance
May 22, 2009 04:27AM
Quote

About the resonances at low speeds: almost every hybrid stepper has nasty resonances at low speeds (150-300 fullsteps/sec). The forementioned damper don't help here. As far as I know, it is best not to operate the motor in this region. Where I work, we accelerate quickly through that region, or start at a frequency above that.

The problem is that the speed of each axis varies between 0 and the extrusion speed depending on the slope of the line being drawn, so some shapes are bound to hit the resonance unless you limit the extrusion speed to below resonance.


[www.hydraraptor.blogspot.com]
Re: Dither Stepping - avoiding midspeed resonance
May 22, 2009 07:11AM
It may be that the rubber is detuning mechanical resonant effects quite seperately from any capacitive/inductive effects.

In fact, I suspect the capacitances involved in the circuit are negligible, but there will be frequencies at which the motor body elements absorb large amounts of the active freqency, and mechanically resonate, with the effect that beat frequencies occur between the driven frequency and the mechanical response, such that the beat frequencies mess up the phase drive wave forms to the coils.

So, the utility of the rubber, would be to minimise the mechanical resonance, and therefore the amplitude of the beat frequencies that interfere with the phase drive.

Graham.
Re: Dither Stepping - avoiding midspeed resonance
May 22, 2009 07:34AM
Yes it is definitely mechanical resonance. The rotor has inertia and and the torque is a function of displacement so you have a classical mass on a spring type of simple harmonic motion.

The stray capacitance will resonate with the inductance to give ringing on the drive waveform, but that is far too high a freqency to affect the motion, or even interact with the chopping frequency.

The problem is when the step rate is close to the mechanical resonance frequency the oscillation can build up until steps are lost.

With very high step rates you can get beating with the chopper frequency but I don't think that is a major problem.

My guess is the way anti-resonant drives work is that they monitor the current waveform in the coil to get an indication of where the rotor is, i.e. whether it is leading or lagging where it should be. Then feedback is used to modulate the drive current anit-phase to the oscilation to cancel it out.


[www.hydraraptor.blogspot.com]
Re: Dither Stepping - avoiding midspeed resonance
May 22, 2009 08:43AM
I have the hardware on my board to pick that up, but it's a bit of a mission to do it this early on in the project.

I have 0.1 Ʊ sense resistor on each stepper motor coil, and wired traces from these to my micro. There would be smoke if the resistors came unstuck !

I realised after I'd assembled the PCB that there is a potential for negative transients to drive the sense resistor negative with respect to ground, but in practice, the minimum egative transient I'm observing is around a millivolt. I get up to about 9 mV positive on full stall at 75% PWM on a medium sized motor, I think that channel's responsible for about a .5 amp share of the total going in the 12 volt line (measures total of .9 amps DC with three motors running, biggest one stalled).

The analogue to digital convertor is supposed to be good to 12 bits resolution, so my 9mV corresponds to (0.009/3.3) x 2^12 (3.3 is analogue chip reference)
=11,
which ought to be the maximum value detected if I were reading the ADC result under these circumstances.

I will run some tests later, with some heavier duty stepper motors to see how stable the ADC conversion results are when other channels are under load.
Re: Dither Stepping - avoiding midspeed resonance
May 22, 2009 10:51AM
I am playing with Allegro drivers with built in diodes and synchronous rectification. Unfortunately that makes the sense current flows through the resistor in both directions, so it swings +- 0.5V maximum for 2A drive and 0.25R resistors. I will probably just offset it with a pair of resistors and feed it into an ADC.

9mv across 0.1R seems a bit low, only 90ma? Did you mean to have an upside down Omega, i.e. conductivity rather than resistance?


[www.hydraraptor.blogspot.com]
Re: Dither Stepping - avoiding midspeed resonance
May 28, 2009 04:29AM
nophead Wrote:
-------------------------------------------------------
> I am playing with Allegro drivers with built in
> diodes and synchronous rectification.
> Unfortunately that makes the sense current flows
> through the resistor in both directions, so it
> swings +- 0.5V maximum for 2A drive and 0.25R
> resistors. I will probably just offset it with a
> pair of resistors and feed it into an ADC.
I've considered that, next revision of my pcb perhaps...

>
> 9mv across 0.1R seems a bit low, only 90ma? Did
> you mean to have an upside down Omega, i.e.
> conductivity rather than resistance?
It is low!
I just double checked my order resistor value from Farnell, and the bag, the bag says 0R1, the order does too. the resistors are printed with R100, I don't know how one would read that as 0.1
I can meter them, my meter is calibrated to read 0.0 with the leads toucing each other, still reads 0.0 across the resistor. 0.01 might make more sense for the value...

update ! thanks nophead ! it clicked suddenly, when I was thinking about a factor of 10, my scope probe was set up wrong.
Re: Dither Stepping - avoiding midspeed resonance
May 28, 2009 04:33AM
nophead Wrote:
-------------------------------------------------------
> I am playing with Allegro drivers with built in
> diodes and synchronous rectification.
> Unfortunately that makes the sense current flows
> through the resistor in both directions, so it
> swings +- 0.5V maximum for 2A drive and 0.25R
> resistors. I will probably just offset it with a
> pair of resistors and feed it into an ADC.
I've considered that, next revision of my pcb perhaps...

>
> 9mv across 0.1R seems a bit low, only 90ma? Did
> you mean to have an upside down Omega, i.e.
> conductivity rather than resistance?
It is low!
I just double checked my order resistor value from Farnell, and the bag, the bag says 0R1, the order does too. the resistors are printed with R100, I don't know how one would read that as 0.1
I can meter them, my meter is calibrated to read 0.0 with the leads toucing each other, still reads 0.0 across the resistor. 0.01 might make more sense for the value...

update ! thanks nophead ! it clicked suddenly, when I was thinking about a factor of 10, my scope probe was set up wrong.

So my peak is up over 90mV, and the current is 0.09/0.1, which is 0.9 amps, peak.
Sound more reasonable !

I will have to watch that... haven't been scoping things much lately.


The upside down ohm symbol was the closest I could find in Ubuntu Character map.

Graham.

That will give me a lot more resolution on my ADC conversions too, I'm happy.smiling smiley

Edited 1 time(s). Last edit at 05/28/2009 04:36AM by grael.
Sorry, only registered users may post in this forum.

Click here to login