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 pin | 86Duino Zero | 86Duino One | 86Duino EduCake |
---|---|---|---|---|
0 | X-DIR | 42 | 42 | 42 |
0 | X-Pulse | 9 | 9 | 9 |
0 | Y-DIR | 43 | 43 | 43 |
0 | Y-Pulse | 6 | 6 | 6 |
0 | Z-DIR | 44 | 44 | 44 |
0 | Z-Pulse | 5 | 5 | 5 |
1 | X-DIR | Not Support | 18 | 18 |
1 | X-Pulse | Not Support | 13 | 13 |
1 | Y-DIR | Not Support | 19 | 19 |
1 | Y-Pulse | Not Support | 11 | 11 |
1 | Z-DIR | Not Support | 20 | 20 |
1 | Z-Pulse | Not Support | 10 | 10 |
2 | X-DIR | Not Support | 33 | Not Support |
2 | X-Pulse | Not Support | 29 | Not Support |
2 | Y-DIR | Not Support | 34 | Not Support |
2 | Y-Pulse | Not Support | 30 | Not Support |
2 | Z-DIR | Not Support | 35 | Not Support |
2 | Z-Pulse | Not Support | 31 | Not 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:
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
- line()
- arcXY()
- arcXZ()
- arcYZ()
- arcXY_Theta()
- arcXZ_Theta()
- arcYZ_Theta()
- circleXY()
- circleXZ()
- circleYZ()
- helicalXY()
- helicalXZ()
- helicalYZ()
Write configuration
- config_MaxVelocity()
- config_MaxAcc()
- config_PosLimit()
- config_PPU()
- config_ReverseDirection()
- config_MaxPulseSpeed()
- config_PulseMode()
- config_HomePins()
- setDefaultFeedrate()
- setHomeSpeed()
- setRelative()
- setAbsolute()
- enableSoftLimit()
- disableSoftLimit()
Read configuration
- getMaxVelocity()
- getMaxAcc()
- getPPU()
- getActualPos()
- getPulseMode()
- getCmdCount()
- getFreeCmdCount()
- isDirectionReversed()
- isMoving()
- isValid()
- isCmdBufferFull()
JOG / MPG Control
- beginJog()
- endJog()
- setJogSpeed()
- setJogOffset()
- beginMpg()
- endMpg()
- setMpgSpeed()
- setMpgAxis()
- setMpgRatio()
- getJogPos()
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.