ArduinoベースのXYレーザーカッターを作っています。そのためのメカニズムを構築し、基本的なモーションを完成させましたが、線と曲線をプロットするのに苦労しています。最終的には、SVG または Illustrator ファイルを Gcode に変換したり、Arduino に解釈して直接プロットさせたりしたいと考えています。
Gcode に基づく 2 ワイヤ (ステップと方向) 命令を提供する GRBL や Rstepper などのライブラリがあります。問題は、ULN2003 チップを使用して 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)
}
それは遅すぎるでしょうか?