3

我制作了一个基于 Arduino 的 XY 激光切割机。我已经为它构建了机制并完成了基本运动,但我无法让它绘制直线和曲线。我最终希望能够将 SVG 或 Illustrator 文件转换为 Gcode,或者让 Arduino 直接解释和绘制它们

我的设置图片。

有像 GRBL 和 Rstepper 这样的库,它们提供基于 Gcode 的 2 线(步进和方向)指令。问题是我正在使用 ULN2003 芯片驱动两个步进电机,它使用 4 根线来步进电机的相位。

我可以让这些库中的任何一个用于 4 线控制吗?


如果没有,我将需要找到另一种方法来绘制我的设计。

我目前正在考虑如何为 SVG 或 G 代码样式指令制作函数。

//given a new position to go to and how we want to get there (i.e. curves)
for (i=0;xposition!==newx;i++) //run until x gets to the right spot
{
//get the values for X, Y, NewX, NewY, and any other parameters (e.g. for curves)
//figure out how many steps (say, +1 or -1) x should take for cycle number i
//figure out how many steps y should move given new x
//make the x stepper step the right number of steps
//make the y stepper step the right number of steps
//delay (control speed for adequate laser burning & don't make the steppers angry)
}

会不会太慢?

4

1 回答 1

1

走这条路并浪费了很多时间,我强烈建议您以 15-20 美元一个的价格购买几个Easy Drivers 。并使用 GRBL 继续您的项目。这是一个很棒的库,并且有一个不错的基于 Java 的开源激光切割机前端项目,名为Visicut。Visicut 可以处理 SVG 文件或 gcode。

如果您必须使用您拥有的芯片,Connecting Grbl页面列出了此站点使用 ULN2003 驱动步进电机,但警告:“它已过时并使用 Grbl v0.7。”

(但说真的,硬件选择,因为“这就是一个人所拥有的”而不是可能更容易实现的硬件,真的会像你这样从一个有趣的黑客项目中吸取乐趣)

于 2014-08-06T05:03:33.083 回答