MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.16k stars 19.21k forks source link

[FR] Interfacing with closed loop stepper #12496

Open alexxy opened 5 years ago

alexxy commented 5 years ago

What is the best way to interface with closed loop stepper motor?

Currently I working on simple design for closed loop stepper comntroller that can be very cheap but will its work. So basicaly it is stm32 mcu with tmc motor driver and magnetic encoder. So the main question is interface between control board and comntroller. Ideas?

comps commented 5 years ago

See #11772 and the discussion in it.

alexxy commented 5 years ago

Good point. But idea is to make motor controller board to all of position control thing.

paukstelis commented 5 years ago

There have been some discussion. https://github.com/MarlinFirmware/Marlin/issues/11113

alexxy commented 5 years ago

Its not user support question. I'm developing board similar to nano zero or machaduino. So I rise question about interfacing with Marlin.

So possibilityes are:

Or any other suggestions? I think in case of using closed-loop drives marlin need some kind of feedback to know if movement finished or not, or it get an error.

I tested encoder resolution and stability: its ~0.02 degree (for example for 200 steps/rev stepper with 16 microstep we need ~0.1125 degree, so resolution is enough for 64-128 microsteps... )

alexxy commented 5 years ago

I now implementing interface in that way

  1. closed-loop board exposes step, dir, enable pins that are translated into step dir enable of driver
  2. closed-loop board exposes additional two pins: ready and error that are used for reporting status
  3. closed-loop board exposes spi for driver configuration (as well as uart)
crazyp1g commented 5 years ago

@alexxy
Why not consider like that TMC 4361 and TMC5160

InsanityAutomation commented 5 years ago

No, there is still plenty to be done around closed loop steppers. I just got a couple in 2 days ago to start playing with. The TMC motion controllers above would be hugely beneficial as well.