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.
Motion86 函式庫使 86Duino 成為一個易於開發的運動控制器,具有適用於自動化應用的 Arduino 友善功能,從而加快了控制器開發並降低了開發成本。
Motion86 函式庫的主要功能如下:
- 最多 9 軸步進和伺服馬達運動控制,脈衝輸出頻率高達 10MHz。
- 最多 3 個獨立軸組。
- 支援 G 代碼。
- 多軸線性、圓弧和螺旋插補,0.5ms 精細插補週期。
- 支援 JOG 功能。
- 支援手輪 (MPG)。
- 速度預讀程式可預讀 1024 個會話。
- 進給率倍率,可立即回應。
- 軸跟隨功能,帶電子齒輪比設定。
接線說明和範例
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 |
以下是 Maker 常用的 3D 列印機和 CNC 雕刻機的 A4988 步進馬達驅動器的範例,並提供了不同型號 86Duino 開發板上各軸組的接線範例:
Machine 類別
此類別提供 XYZ 機器軸組的配置和控制方法,並添加了更多高級功能,以實現更靈活、更通用的運動控制。
基本方法
基本控制
- line()
- arcXY()
- arcXZ()
- arcYZ()
- arcXY_Theta()
- arcXZ_Theta()
- arcYZ_Theta()
- circleXY()
- circleXZ()
- circleYZ()
- helicalXY()
- helicalXZ()
- helicalYZ()
寫入配置
- config_MaxVelocity()
- config_MaxAcc()
- config_PosLimit()
- config_PPU()
- config_ReverseDirection()
- config_MaxPulseSpeed()
- config_PulseMode()
- config_HomePins()
- setDefaultFeedrate()
- setHomeSpeed()
- setRelative()
- setAbsolute()
- enableSoftLimit()
- disableSoftLimit()
讀取配置
- getMaxVelocity()
- getMaxAcc()
- getPPU()
- getActualPos()
- getPulseMode()
- getCmdCount()
- getFreeCmdCount()
- isDirectionReversed()
- isMoving()
- isValid()
- isCmdBufferFull()
JOG / MPG 控制
- beginJog()
- endJog()
- setJogSpeed()
- setJogOffset()
- beginMpg()
- endMpg()
- setMpgSpeed()
- setMpgAxis()
- setMpgRatio()
- getJogPos()
速度重置功能
軸跟隨功能
計算工具協助
使用限制
The TimerWDT library and the AIServo86 library also use the timer. To avoid conflicts between the libraries, these libraries cannot be used simultaneously.
演示影片
函式庫參考主頁面
86Duino 參考的文本是根據 知識共享署名-相同方式分享 3.0 許可證,部分文本是從 Arduino 參考 修改的。 參考中的代碼示例已發佈到公共領域。






