Closed-loop controller for stepper motors

Closed-loop stepper motor controller that dynamically checks the shaft position and prevents step losses in 3D printing, CNC machines and so on

SKU 7100-MOTORFISHEAN 8219671106887Item type: Assembled

Description

Closed-loop controller for stepper motors that dynamically verifies shaft positioning and prevents lost steps in 3D printing, CNC, etc. It mounts directly on NEMA17 motors.

All controller management is handled by the programmed microcontroller PIC32MX250F256HI/PT from Microchip; while the DRV8843 driver from Texas Instruments, driven directly by PWM pulses, allows stepper motor control even with very fine microstepping. The AM4096 magnetic encoder, with a resolution of 12 bits (4096 steps/revolution), is able to detect the motor shaft position and transmit it to the controller.

It can be controlled via USB interface, I2C port, or SPI port.

It also features the classic EN/DIR/STEP inputs typical of traditional controllers, making it possible to replace your driver with MotorFish.

It also includes a reset button, status LED, a 4-pole terminal block for the two motor windings, and a terminal block for power supply (from 8.5 to 45 VDC).

Some usage examples

Who has never launched a complex and long 3D print, maybe a job of hours or tens of hours, stepped away, and discovered that, almost finished, the printer motors lost some steps, resulting in a ruined object, printed badly with layers not aligned with each other? Unfortunately it is frequent, and the surprising (or irritating…) thing is that it happens almost always towards the end of the print, causing significant waste of material and time.

Since the vast majority of 3D printers on the market use stepper motors controlled in open loop, this is inevitable because the controller has no way to ascertain whether the command given is correctly executed by the motor, i.e., whether for each pulse sent the rotor actually advances by one step. With this controller, you can instead use the motor in closed-loop mode.

Open-loop control:
The controller sends a command to the motor without confirmation of the actual movement; if the motor for any reason is unable to move (for example, if the print head encountered an obstacle or if the requested movement speed is too high), the error is maintained and accumulates with any subsequent errors.

Closed-loop control:
A movement command is given to the motor, but in this case a position sensor on the motor is able to provide a “confirmation” of the movement that occurred or an error signal if it is impossible. The controller can then decide whether to stop everything, retry, or continue trying to correct the problem later.
This type of control has several advantages over open-loop control; first of all, the movement no longer depends on the type of motor, but only on the resolution of the movement sensor (an encoder, usually). So we will no longer be forced to work in discrete steps or microsteps, but we can have continuous motor operation, with less mechanical vibration.
Not being at risk of losing position, we can “push” the motor to the maximum without worrying about anything or almost; if the motor cannot follow the commands, the electronics notice it and are able to remedy it, both by reducing speed and/or acceleration and by correcting errors.
Another advantage is reduced current consumption. In an open-loop stepper motor, we are in fact forced to maintain a high current in the windings even when the motor is stationary, to avoid unwanted movements due perhaps to masses in rapid deceleration or to involuntary tampering with the printer bed; in the closed-loop motor, when it is not moving, we can reduce the current in the windings to zero, sure that in case of involuntary movements the electronics will be able to immediately correct the position.

Technical specifications

  • Closed-loop control of speed or position
  • Various control interfaces:
    • USB for direct connection to PC
    • I²C for use with a microcontroller
    • SPI
    • EN/DIR/STEP inputs typical of traditional controllers, which make it possible to directly replace them with MotorFish
    • Acceleration and deceleration limiting
  • Maximum microstepping on a motor with 200 steps is 4096/200 = 20.48 microsteps/step.
  • All available I/Os are software-programmable, so nothing prevents using them for other purposes. MotorFish is programmed exactly like an Arduino (or, more precisely, like a Fishino32), with all the possibilities that entails.

Electrical schematic

Assembly plan and component list

Documentation and useful links

Technical details

Dimensions (mm) 42.2x42.2x12
weight 12.5 grams

You may also like…

About us

Open-Electronics.org is the brainchild of a world leader in hobby electronics Futura Group srl. Open-Electronics.org is devoted to support development, hacking and playing with electronics: we share exciting open projects and create amazing products!

Open-Electronics.org is not just a container of ideas: it is also a web site lead by a team of engineers and geeks who will take part in the discussions and give support.

Our mission is to become a reference Open Source hacking site with ideas and feedback aimed to enrich the community.