如何为CNC制作平滑曲线?

时间:2014-08-05 15:15:31

标签: svg arduino cnc

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

A picture of my setup.

像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)
}

这会太慢吗?

1 个答案:

答案 0 :(得分:1)

走下这条路并且浪费了很多时间,我强烈建议您只需花费15到20美元即可获得Easy Drivers几个。并使用GRBL继续您的项目。这是一个很棒的图书馆,有一个很好的基于Java的开源激光切割机前端项目,名为Visicut。 Visicut可以处理SVG文件或gcode。

如果您必须使用您拥有的芯片,Connecting Grbl页面会列出此网站Driving stepper motor using ULN2003,但请注意:“它已过时且使用了Grbl v0 0.7“。

(但严重的是,硬件选择,因为“这就是人们所拥有的”,而不是可能更容易实现的东西,这真的可以让你从一个有趣的黑客项目中获得乐趣)