Notifications
Clear all

How does the missed step detection work?  

  RSS
mikael.l6
(@mikael-l6)
Active Member
How does the missed step detection work?

Hi!

I have just ordered a Mk3 and waiting with anticipation until it arrives! Can't wait!

One of the features that I'm really impressed by is the missed step detection. The one that is shown in this video:

https://prusaclone.wordpress.com/2018/03/01/missed-step-detection-with-mk2clone-r2/

I'm interested in robotics, and I would love to know how that missed step detection actually works. I'm thinking it can be done in 3 ways:

[*] This is done using standard stepper motors and stepper motor drivers, the detection is done entirely in software.
[*] This is done using standard stepper motors, but requires some extra circuitry as well as software.
[*] This is done with special stepper motors and other components and special software.

And given which method that is used, where can I actually find the details on it? Are there any papers published by Prusa that explains it? Or do I need to dive into the blueprints and source code?

I know that Prusa is committed to open source, which is great, so the answer is out there somewhere on the Internet. I have googled around a bit, and I haven't found anything yet though. Trying to browse through the source code on GitHub seems a bit overwhelming, so thought I could ask here first.

Thanks in advance!

Posted : 10/05/2018 11:46 am
stahlfabrik
(@stahlfabrik)
Honorable Member
Re: How does the missed step detection work?

The stepper drivers measure the amps they send to the motors. If the motor stalls and then skips, that is registered. No special motors, no extra hardware.

Posted : 10/05/2018 12:34 pm
reid.b
(@reid-b)
Reputable Member
Re: How does the missed step detection work?

"Missed step detection" really isn't a proper way to describe what Prusa implemented. It's more like crash detection or "high amp draw detection".

Posted : 10/05/2018 4:08 pm
Kwaad2
(@kwaad2)
Honorable Member
Re: How does the missed step detection work?

My understanding of how it works, is what Stahlfabrik said... In simple terms. It really monitors back EMF. Every step the motor makes, is like ringing a bell, electrically. The TMC driver, listens to this, and can tell accurately how much it microsteps.

Technically, the system is designed for increasing power when needed. (Which I think is configured wrong on the mk3, which is why it runs so hot)

Anyway, crash detection basically looks for a sudden spike, vs a steady ramp up, like acceleration does.

Hi, I'm Sean. I used to work on CNC machines.
I try to not make mistakes, but the decision is YOURS.
Please feel free to donate to my filament/maintance fund.

Posted : 10/05/2018 5:23 pm
mikael.l6
(@mikael-l6)
Active Member
Topic starter answered:
Re: How does the missed step detection work?


The stepper drivers measure the amps they send to the motors. If the motor stalls and then skips, that is registered. No special motors, no extra hardware.

Thanks!

Hm... But how do I set this up in practice? The limited experience I have with stepper motors is using this library:

https://github.com/laurb9/StepperDriver

And then one of the stepper drivers it supports. I'm not 100% sure which one, but for the discussion let's say that it was the DRV8834 driver that is used in the example on the page. (I.e. in the README.md file that is shown directly when visiting the link and scrolling down).

You write "stepper drivers measure the amps they send to the motors". Do all stepper drivers do this, including the DRV8834? I assume that the schematics used in the README.md file is not set up to be able to do missed step detection, am I right? If so, how do I need to extend it so that it does? And how do I interact with this on the software side?

Posted : 11/05/2018 12:27 am
mikael.l6
(@mikael-l6)
Active Member
Topic starter answered:
Re: How does the missed step detection work?


My understanding of how it works, is what Stahlfabrik said... In simple terms. It really monitors back EMF. Every step the motor makes, is like ringing a bell, electrically. The TMC driver, listens to this, and can tell accurately how much it microsteps.

Technically, the system is designed for increasing power when needed. (Which I think is configured wrong on the mk3, which is why it runs so hot)

Anyway, crash detection basically looks for a sudden spike, vs a steady ramp up, like acceleration does.

Thanks! Hm... I guess the information I'm really looking for is how to actually go about implementing this in my own robotic builds. So let me phrase the question like this. Given the example and schematics found on this page:

https://github.com/laurb9/StepperDriver

How do I "level up" from there, so I can do missed step detection? Can I find a tutorial on this somewhere?

Posted : 11/05/2018 12:31 am
Kwaad2
(@kwaad2)
Honorable Member
Re: How does the missed step detection work?


Thanks! Hm... I guess the information I'm really looking for is how to actually go about implementing this in my own robotic builds. So let me phrase the question like this. Given the example and schematics found on this page:

https://github.com/laurb9/StepperDriver

How do I "level up" from there, so I can do missed step detection? Can I find a tutorial on this somewhere?

Debbie downer here.
https://shop.prusa3d.com/forum/hardware-firmware-and-software-help-f64/sensorless-homing-with-third-party-motors-doesn-t--t17528.html

This is the leading edge of what you want. The original poster is the guy to ask those questions to. As far as I know, short of attempting to get in contact with a Prusa dev, he's one of your best bets.

Hi, I'm Sean. I used to work on CNC machines.
I try to not make mistakes, but the decision is YOURS.
Please feel free to donate to my filament/maintance fund.

Posted : 11/05/2018 12:59 am
Dreide
(@dreide)
Trusted Member
Re: How does the missed step detection work?

And given which method that is used, where can I actually find the details on it? Are there any papers published by Prusa that explains it? Or do I need to dive into the blueprints and source code?

The magic is in the motor drivers, in case of the MK3 the TMC2130. A good starting point for your own Arduino project is this library: https://github.com/teemuatlut/TMC2130Stepper . Be warned, the TMC2130 is not necessarily the simplest motor driver out there: https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf

Posted : 11/05/2018 6:54 pm
mikael.l6
(@mikael-l6)
Active Member
Topic starter answered:
Re: How does the missed step detection work?

Thanks guys! So yeah... I understand that this would require a more advanced motor driver. I also asked the question here, so including it for reference:

https://github.com/laurb9/StepperDriver/issues/55

And I was also recommended the TMC2130.

Thinking out loud here, in case someone reads this thread later who is facing the same decision as I am... I think... I will first try to use rotary encoders in my build. It will be a bit more expensive I think, but easier to implement...

Posted : 12/05/2018 12:43 am
Share: