Motion86 Library

Motion86 Library

86Diuno IDE has added this library since Coding version 318, enabling 86Duino to become a simple multi-axis motion controller. Motion control is a part of automation technology. Industrial automation can increase production speed, reduce production cost, improve production quality, and enhance market competitiveness, so motion control is often used in packaging, printing, textile, semiconductor device manufacturing, and Production lines.

The Motion86 library enables the 86Duino to become an easy-to-develop motion controller with Arduino-friendly features for automation applications, speeding up controller development and reducing development costs.

The main features of the Motion86 library are as follows:

  • Up to 9 axes of stepper and servo motor motion control with up to 10MHz pulse output.
  • Up to 3 independent axis groups.
  • G-Code support.
  • Multi-axis linear, circular, and spiral interpolation with 0.5ms fine interpolation cycle.
  • Support JOG function.
  • Support handwheel (MPG).
  • Speed Look Ahead program pre-reads 1024 sessions.
  • Feedrate Override for immediate response.
  • Shaft follows function with electronic gear ratio setting.

Wiring instructions and examples

The Motion86 library supports up to three-axis groups, Machine0, Machine1, and Machine2, each of which can be connected to control an XYZ 3-axis right-angle coordinate system machine – for example, a 3-axis CNC engraving machine from SABLE CNC Studio.

Each Motion86 axis group provides six pins, X-DIR/X-Pulse, Y-DIR/Y-Pulse, and Z-DIR/Z-Pulse, which are connected to the X, Y, and Z-axis servo motors for direction and pulse input respectively. The pulse output of each axis provides three pulse modes, Pulse/DIR, CW/CCW, and A/B Pulse, which can be configured at the initialization stage by the config_PulseMode() function. The following is the pin mapping table for each axis group on different models of 86Duino development boards.

Axis Group No.Axis Group pin86Duino Zero86Duino One86Duino EduCake
1X-DIRNot Support1818
1X-PulseNot Support1313
1Y-DIRNot Support1919
1Y-PulseNot Support1111
1Z-DIRNot Support2020
1Z-PulseNot Support1010
2X-DIRNot Support33Not Support
2X-PulseNot Support29Not Support
2Y-DIRNot Support34Not Support
2Y-PulseNot Support30Not Support
2Z-DIRNot Support35Not Support
2Z-PulseNot Support31Not Support

The following is an example of the A4988 stepper motor drive commonly used by Maker for 3D printers and CNC engraving machines, and provides an example of the wiring of each axis group on different models of 86Duino development boards:

86Duino ZeroZero_Stepper
86Duino OneOne_Stepper
86Duino EduCakeEduCake_Stepper

Machine Class

This category provides methods for configuration and control of XYZ machine axes groups and adds more advanced functions for more flexible and versatile motion control.

Basic Method

Basic Control

Write configuration

Read configuration

JOG / MPG Control

Speed Reset Function

Axis follow function

Assistance with calculation tools

Usage restrictions

The TimerWDT library and the AIServo86 library also use the timer. To avoid conflicts between the libraries, these libraries cannot be used simultaneously.

Demo Video

Libraries Reference Home

The text of the 86Duino reference is a modification of the Arduino reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

Leave a Comment

Your email address will not be published. Required fields are marked *