前回に引き続き、GRBLの話です。
なんやかんやで偽DRV8825ドライバーでFLMのステッピングモーターを動かす所まで出来たのですが、どうにもこうにもホーミングが正しく動かない。
挙動がおかしい・・・
「なんでだぁぁぁ!うおぉぉぉ!
と、散々悩んで、色々試行錯誤した結果、どうやらリミットスイッチの回路のノイズが原因だとわかった。
実は公式のページにも書かれていたりする、
Capacitors for noise filtering
Even if you do use NC contacts, you still need those 104 (0.1uF) capacitors, as close to the Arduino as you can place them. You can argue all day that those caps won’t make a difference since the caps are shorted out by the switches. The explanation for this phenomenon is quite long but the first power line glitch will convince you otherwise. (Plug in your blender next to the CNC’s AC plug and turn it on. Your CNC should still behave normally despite the blender.)
Side benefit: With NC switches, the connection is broken cleanly when you hit home position, therefore no contact bounce occurs. (Contact bounce occurs only during switch closure, NOT during switch opening.)
https://github.com/gnea/grbl/wiki/Wiring-Limit-Switches#capacitors-for-noise-filtering
要するに0.1uFのコンデンサーをArduinoの近くに取り付けろと言うことらしい。
早速やってみた。
私は、数年前に買ったGRBLシールドを使っています。
コンデンサーを取り付けるとしたら、ENDSTOP端子の白いピンと黒いピンの間に取り付けます。
今回は、基板裏に突き出たピンの間にチップコンデンサーを取り付けることにしました。
写真のように、基板の裏のENDSTOPS端子に直接半田付けしました。
取り付けたコンデンサーは、容量 0.1uFでサイズは1608の物
もちろんFLMにはZ軸は無いのですが、ついでなのでZ軸用の端子にもコンデンサーを取り付けておきました。
ちなみに、このGRBLシールドは、Zのリミットピンとスピンドル用のピンが入れ替わっているので注意。
これでホーミングを試してみると、無事正常な動作となりました。
Arduino用のCNC(GRBL)シールドを買ったら、まずコンデンサーの取り付けが必須と言うことですね。
以前1号機を作った時は、ノイズ対策無しで動いていたので、今回は良い勉強になりました。