Sensorless Dual Endstops and Stall Detection – Trinamics

New Home Forum LowRider Advice – LowRider Sensorless Dual Endstops and Stall Detection – Trinamics

This topic contains 12 replies, has 8 voices, and was last updated by  Greg 1 week, 5 days ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #105095

    Colton McCormack
    Participant

    Has anyone considered using the Trinamic drivers to do sensorless dual endstops? For those who aren’t aware, some of the stepper drivers produced by Trinamic can sense the feedback from the force being exerted on a stepper (like running into something).

    Sensorless Endstops?

    In 3D printing, this is usually used to allow the printer to do it’s homing without mechanical endstops (it can detect when it bumps into the frame). I’m wondering about the feasibility of doing this with the Lowrider/MPCNC. First, the accuracy of the stall detection is good to 1 stop at best and 4 at worst. Assuming the worst case scenario of 4 stops, that’s 1/50mm at our current 200 steps/mm X/Y settings, or less than one thou. This is actually quite a bit worse than mechanical endstops, but I suspect still way smaller than a laundry list of other factors that could affect accuracy. Of note: The additional cost of the drivers is more than just adding physical endstops, but would be simpler to set up (I think).

    Stall Detection?

    Currently, Marlin only uses the stall feedback for sensorless homing, but one interesting safety consideration is the detection of stalls. If the router got “hung up” on something due to being too deep, hitting a clamp, etc. then the router could theoretically detect the event and shut down the operation, potentially preventing a fire. This wouldn’t be trivial. The loads present in a CNC are way higher than something like a 3D printer. I suspect they’re pretty dynamic too. DOC, speed, etc. would all change the range of force which would be considered “normal”. I do wonder, however, if you could measure the feedback for the first X inches of cut, use it to set a baseline, and then use that baseline in concert with an acceptable buffer amount and perhaps a bit of hysteresis to detect problems. This definitely depends on just how dynamic the cutting forces are though, which is something I’m currently ignorant to. You could absolutely start passively measuring feedback throughout normal usage, though, and find out how feasible this is. If your spindle is relay controlled then you could pretty easily turn it off. If not then you could just raise it to ZMax.

    The recently released TMC2209 can handle the full current of our steppers, as can the older TMC5160. I snagged 5 of them as well as an SKR Pro board which should let me do dual endstops, laser cutting/etching, and digitally controlled air assist. I won’t have it for 4-6 weeks though so I’ll probably do my initial build with my spare SKR 1.3 and DRV8825s. I’m a programmer by trade and maintain some Trinamic Marlin firmware for the Ender 3 so I think I can handle the code side.

    Thoughts?

    #105102

    Mike Atencio
    Participant

    I like the idea of it. Sounds straightforward. Would really like to see it in action and costs.

     

    #105115

    Jeffeb3
    Participant

    When doing sensorless endstops, it reduces the sensitivity only while homing on the affected driver, so you’ll need to make sure that works with X2 and Y2. Marlin hasn’t been great in the past at being right when you combine corner cases like that, but sensorless homing and dual endstops have been out long enough, maybe it will work.

    You’ll also need more IO. Each driver needs a CS pin if using 2130s. IDK how the uart ones deconflict.

    As for the stall detection sensitivity, you don’t really care what the threshold is. If it skips, you’re done. If it doesn’t, then chive on. Doesn’t the prusa 3 have this concept? If it was just a snagged cable, you could continue. If your CAM was wrong, you’d need to be pretty clever to recover and you might as well start again, even if you’re cutting some air.

    #105120

    Colton McCormack
    Participant

    When doing sensorless endstops, it reduces the sensitivity only while homing on the affected driver, so you’ll need to make sure that works with X2 and Y2. Marlin hasn’t been great in the past at being right when you combine corner cases like that, but sensorless homing and dual endstops have been out long enough, maybe it will work.

    You’ll also need more IO. Each driver needs a CS pin if using 2130s. IDK how the uart ones deconflict.

    As for the stall detection sensitivity, you don’t really care what the threshold is. If it skips, you’re done. If it doesn’t, then chive on. Doesn’t the prusa 3 have this concept? If it was just a snagged cable, you could continue. If your CAM was wrong, you’d need to be pretty clever to recover and you might as well start again, even if you’re cutting some air.

    Good point about the edge case.  If it isn’t implemented I’ll write a PR for it.

    The boards I mentioned have the IO and even implement the connections via a jumper on the board itself rather than needing to modify the driver pins or add jumper wires. The TMC2209s further expand this with slave addressing in UART allowing multiple to be used per port.

    You’re probably right about the threshold. I didn’t really consider that a skipped step will probably register under any sensitivity. That makes that much simpler. Seems like it might be something handy to have enabled should you really screw something up.

    #105143

    Aaron
    Participant

    Maybe take a look at the prusa fork for marlin. They use the einsy Rambo board and sensorless homing

    #105596

    Ned van Geffen
    Participant

    I should probably get in on this chat 🙂

    YES

    I have a SKR 1.3 with TMC2130’s and dual endstops on Y and Z and sensorless homing on all axis. I havent tried stall detection yet though.

    With the LR2, there are a couple things to watch out for before you ruin your CNC, as it’s not designed for sensorless homing (or homing in general)

    1. sensorless Z with lead screws is generally considered to not be a thing you should try. It works, but you need to watch out! Prusa does it on Z Max so that they can drive the carriage up, and the coupler will be in compression when it hits the limit. To do that, you will need to put some clamps on your Z tubes to create a hard stop on the Z axis.
      OR
      you need to put a few spacers on your Z rods BETWEEN your coupler and stepper. I found 2 of the wheel bearing spacers to work well. Then you need to adjust your rod and coupler to take up the slack, so that when you home Z, there is no slack between the coupler and the spacers and the Z nut. I did this this way:
      – loosening ALL the coupler grub screws,
      – lower Z to home,
      – clamp the gantry down so it wont move
      – bring the lead screw UP until it makes contact with the stepper
      – lower the coupler as far as it will go so there is no gap beween it, the spacers and the nut
      – tighten the coupler to the lead screw and the motor.
    2. Now you can home Z and it works great… EXCEPT if you have just homed X, as when X is homed, you cant home Z as the x gantry hits the top bearing mounts on the Y plate! and when you do that, it will stretch the shit out of your coupler, to the point of having to replace it (ask me how i know grrr!)

      so, some solutions…
      – dont home all axis with G28 command and home manually
      – change the homing custom command in marlin to do G28 X, G1 X20, G28 Y Z (or whatever the right codes are) but that wont help if you press ‘home all’ on repetier or something.
      – Put a spacer onto the x rails so it homes 10-20mm away from the mount but lose some work area
      – home Z higher, so it clears the mount (just add a spacer or 2 to the lead screw?
      – modify the marlin code to move X 20mm away from the home position after homing X and before homing Z
      – i think there might be room to cut away part of the X plate to allow it to home all the way?

    Thats what i found anyway… hope that helps? The wiring is a WHOLE LOT neater though without end stops!

    1 user thanked author for this post.
    #105614

    Greg
    Participant

    That’s really neat!  I imagine that will be the way everything is done in the future.

    Marlin has a firmware definition to tell it where to do the Z homing.. I think it’s SAFE_HOMING or something like that

     

    #105666

    Colton McCormack
    Participant

    Now, that’s what I’m talking about!

    I wasn’t really looking for Z homing as I just assumed that the leverage from the Z screw mixed with a very pointy bit would inevitably mean that the cutting edge sinks into the material a tiny amount before it registers, leaving a mark and potentially throwing off measurements. Gotta run power to the spindle anyway so I don’t mind having an extra wire for a touch plate there too much. The idea that it’s possible seems quite intriguing.

    #105670

    Tim
    Participant

    Now, that’s what I’m talking about!

    I wasn’t really looking for Z homing as I just assumed that the leverage from the Z screw mixed with a very pointy bit would inevitably mean that the cutting edge sinks into the material a tiny amount before it registers, leaving a mark and potentially throwing off measurements. Gotta run power to the spindle anyway so I don’t mind having an extra wire for a touch plate there too much. The idea that it’s possible seems quite intriguing.

    Soooo you’re totally gonna write the firmware for everyone and get a parts list going right? 🙂

    #105671

    Jeffeb3
    Participant

    Ideally you could home to make the Z square (possibly at Zmax) and then probe to get the workspace Z=0.

    #105672

    Barry
    Participant

    Just don’t try homing z with a v bit endmill.  I did that once, and it buried it up to the collet.  Didn’t even slow down.  This was in half inch plywood.  MDF might have broken the endmill.

    #105686

    Colton McCormack
    Participant

    Now, that’s what I’m talking about!

    I wasn’t really looking for Z homing as I just assumed that the leverage from the Z screw mixed with a very pointy bit would inevitably mean that the cutting edge sinks into the material a tiny amount before it registers, leaving a mark and potentially throwing off measurements. Gotta run power to the spindle anyway so I don’t mind having an extra wire for a touch plate there too much. The idea that it’s possible seems quite intriguing.

    Soooo you’re totally gonna write the firmware for everyone and get a parts list going right? 🙂

    Sure thing. I’ll take Ryan’s firmware, merge in the latest Marlin version, then create firmware for a couple boards and post it.

    1 user thanked author for this post.
    #105701

    Greg
    Participant

    Just don’t try homing z with a v bit endmill. I did that once, and it buried it up to the collet. Didn’t even slow down. This was in half inch plywood. MDF might have broken the endmill.

    I have a Z homing setup with a pressure disc and an aluminum plate on top. Could probably do the same thing with this setup but just with a soft metal plate and maybe one of those cnc lead screw couplers that isn’t so springy. Not sure how hard the triaminic would be on the tip of the mill though.

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.