Stall guard precision (resolution)

How important precision of Stall-Guard is to you?

Very
6
100%
Important
0
No votes
I do not intend to use Stall-Guard for homing, or any other precise positioning mode
0
No votes
 
Total votes : 6

Stall guard precision (resolution)

Postby Andrew » 04 Dec 2006, 13:55

Hello,

There's an article
http://www.trinamic.com/ttdg/viewtopic.php?t=120
It is called: Can Stallguard detect a step loss?
Bernard in response wrote: see the FAQ for the StallGuard drivers
I cannot locate that FAQ.

The question is:
what is the resolution of Stall Guard in TMCM?
With what precision can a TMCM can detect a stall, and how it reports position then?

Suppose we have a TMCM303, or TMCM110.
The questions below assume 64x microstepping.
Actually microstepping would be 16x anyway. TMCM cannot divide step more than 16 times. So, in our example we assume multiples of 4 microsteps for simplicity (64/4=16x microstepping).
But the same question would be valid just for any other microsteppipng as well, including full steps.

1.
Suppose a motor is instructed to move 192 steps.
Suppose a motor hits an obstacle at a position of 160 microsteps (multiple of 4).
With what precision will we know the missed steps? Will TMCM report a position of 160? Or will it report any other position?

2.
Suppose we instruct TMCM to move the motor in the same direction by 4 microsteps (in 64x this equals one real microstep of 16x). The obstacle is still not removed. Motor does not move. A stall occurs. What position TMCM would report? 164? 160? Or any other?

3.
What actual phases would be set in the internal TMC246 driver of TMCM?
The phases for the missed step (exerting a force on an obstacle)? Or the phases of the last successful step? Can the microprocesor of TMCM automatically adjust the phases to the last successful step, so that motor does not jump after an obstacle is removed?
What those phases can be? Only full step? Or any microstep?

Case 1. would help restore or adjust a postion. Case 2. would help perform homing.
Question 3. is self explanatory.
Andrew
 

Postby TRINAMIC_BD » 04 Dec 2006, 18:18

Comments from me:

1. Link to FAQ is added.

2. + 3. StallGuard values are generated for every fullstep. However, in a microstepping environment the actual reported value may vary, due to the time between detection of stall and the microcontroller reacting to it. This time may cover a few microsteps, depending on motor velocity and microstep resolution. However, the actual result will be within the fullstep where the stall has been detected and a few microsteps behind it.

In order to get the same position every time the axis is referenced, you could AND the position with a word masking out the microstep part of the position, i.e. hex FFFFFFF0 for 16 microstep setting (subtract / add some value to be safely outside the mechanical stop), and then MOVE to this position. Be careful not to write to the position counter before / during homing, because this will change the relationship between the position and the electrical pattern going to the motor. This will correct for the few microsteps offset due to time delay.

It depends on the mechanics (how hard and sudden does the stop occur) and on the height of the selected stall threshold, if the detected stall was a successful step or the first step which was lost. Generally, it is better to detect the last successful step, because the motor may jump back upon a step loss.

A step loss always means the jumping back of the motor by 4 full steps.

Practical results:
For a typical application (linear axis) the stall reproducablity is between 0 and 4 fullsteps, depending on the mechanical stiffness of the stall.
Last edited by TRINAMIC_BD on 05 Dec 2006, 10:55, edited 1 time in total.
User avatar
TRINAMIC_BD
Site Admin
 
Posts: 2445
Joined: 25 Jul 2006, 12:21
Location: Hamburg (Germany)

Postby Andrew » 04 Dec 2006, 19:39

Thanks Bernhard,

Deviation of 4 full steps is understandable.
It is how often a phase repeats in a bipolar motor. It repeats every 4 full steps.

However a motor does not necessarily jump back 4 steps.

If an obstacle is removed quickly enough, the motor could jump in either direction: forth to the correct position, or back. The position might differ from the count by 4 full steps. Or by a multiple of that, if Stall is not detected quickly.

However, if an obstacle persits, the motor may not jump back at all. It might press forward, and remain in the last successful microstep position. (Suppose the obstacle is static.)

You still have not explained what happens in case 2..
Suppose the load remains, and controller tries to move 1 microstep.
Or 4 microsteps, 1 by 1 very slowly.
Will a stall occur? Will it be detected?

Case 3. is also unanswered. When a stall is detected, what phases would be set by TMCM?
Last microstep? (even if unsuccessfull, as success might not be measured)
Or last successful full step?

Perhaps I already wrote another suggestion to Olav earlier.
TMC Modules cannot provide control over phases in motors ("patterns", as you referred to them).
There is a command to address the SPI chain to access TMC246 driver in a TMCM directly. So I could temporarily set the phases. But they will be overridden by subsequent motion.
So there's actually no way to mask the microstep positions off, as you suggest.

If I am wrong, then please correct me.
If I am right then please implement better control of phases.

For example you could introduce an axis parameter - an index into the wave table of the current phase.
TMC428 stores only quarter waves. So the index should indicate not only the position, but the quarter too.
In the future versions of TMC428 it is better if it stores full tables.

You might argue that TMCM always starts in full step. But there's no such suggestion in documentation.
We can reset a position count to any arbitrary value. E.g. from 0 to 1. So the fullness of step can be lost.
Of course if we know for sure that a module indeed starts in full step, we could refrain from resetting the step counter to positions differing from the current one by non full amounts.

Can you definitely tell which part of wave table TMCM starts in?

One more related suggestion is that we should be able to set the position of startup for TMCM.
For example:
Suppose we turn the module off in position of 7 microsteps.
Upon startup it should jump back to 7 microsteps. Not to 0.
Of course when power is off, a motor might jump to half step position. But that's another matter. Usually mechanics prevents the jump, when necessary.

Perhaps this is solved by introduction of an index as described above. E.g. if the index axis parameter is in EEPROM, then it is the startup index into the wave table.
Andrew
 

Postby TRINAMIC_BD » 05 Dec 2006, 10:50

As always I tried to explain in a generic way :wink:. I ment to say: The motor load value is only checked once per fullstep, and there are no other actions taken automatically, except stopping the motor (if enabled). All other actions can be done by the user in TMCL. Actual behavior (jumping back or not) mainly depend on the mechanics and stall threshold setting.
Upon power on, the microstep counter starts at table position 0 for phase A.
User avatar
TRINAMIC_BD
Site Admin
 
Posts: 2445
Joined: 25 Jul 2006, 12:21
Location: Hamburg (Germany)


Return to Modules / StallGuard issues

Who is online

Users browsing this forum: No registered users and 1 guest