0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Anycubic MEGA-S レベリング対応環境下でのフィラメント切れ誤動作対応

Posted at

前提

Marlinのバージョンは以下のものです

Anycubic i3 Mega Marlin (BLTouch) 1.1.9 by davidramiro & MNieddu91

現象

  • フィラメント切れ検出センサーにフィラメントを通してある
  • こんな感じでgcodeのやり取りがされている
TerminalのLog

        Send: N1084472 G1 X96.28 Y112.265 E505.45491*101
        Recv: echo:enqueueing "M600"     <<<<< 🔴 これ!!
        Recv: ok
        Send: N1084473 G1 X96.757 Y111.815 E505.46582*85
        Recv:  T:188.61 /190.00 B:59.97 /60.00 @:113 B@:48
        Recv: echo:busy: processing
        
        <中略>
        
        Recv:  T:193.68 /190.00 B:60.00 /60.00 @:37 B@:41
        Communication timeout while printing, trying to trigger response from printer. Configure long running commands or increase communication timeout if that happens regularly on specific commands or long moves.
        Send: N1084474 M105*45
        Communication timeout while printing, trying to trigger response from printer. Configure long running commands or increase communication timeout if that happens regularly on specific commands or long moves.
        Send: N1084475 M105*44
        Recv: echo:busy: processing
        Recv:  T:189.63 /190.00 B:60.06 /60.00 @:94 B@:24
        
        <中略>
        
        Recv: echo:busy: processing
        Recv:  T:190.39 /190.00 B:60.00 /60.00 @:76 B@:40
        Recv: echo:Insert filament and press button (or M108)     <<<<< 🔴 これ!!
        Recv: echo:busy: paused for user
        Recv:  T:190.72 /190.00 B:60.03 /60.00 @:74 B@:30
        Recv: echo:busy: paused for user
        Recv:  T:190.79 /190.00 B:60.01 /60.00 @:75 B@:36

  • ENDSTOP_NOISE_FILTERは有効にしたくない
Configuration.h
/**
 * Endstop Noise Filter
 *
 * Enable this option if endstops falsely trigger due to noise.
 * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
 * will end up at a slightly different position on each G28. This will also
 * reduce accuracy of some bed probes.
 * For mechanical switches, the better approach to reduce noise is to install
 * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
 * essentially noise-proof without sacrificing accuracy.
 * This option also increases MCU load when endstops or the probe are enabled.
 * So this is not recommended. USE AT YOUR OWN RISK.
 * (This feature is not required for common micro-switches mounted on PCBs
 * based on the Makerbot design, since they already include the 100nF capacitor.)
 */
//#define ENDSTOP_NOISE_FILTER  <<<<< 🔴 これ!!
  • そもそもフィラメント切れてないし・・・。

修正への流れ

今時この機種を使用されている方はかなり減ってきていると思いますが・・・
これを買ってから触る機会がなく、ようやっと最近いじるようになりました。
2~3日でレベリング対応を済ませ、パラメータチューニングのために、テストランを継続しているのですが、昨日あたりからこの現象が出ており、ちょっと調べたところ、まさかのフィラメント切れ多発。
数時間に1回の頻度で発生して、その度にM108で復帰させるという・・・。
気が気じゃない・・・。

多分リトラクションの値が影響していると思われますが、もぐらたたきじゃないんだから、あそこたたいたら、こっちがはみ出る的のはダメでしょう・・・。
このスイッチをちゃんとしたものに買い替え、もしくは電気的に0.1uFをスイッチの両端に入れればいいと思うのですが、ちょっとその前にソフト対応してしまおうかと思った次第。

ENDSTOP_NOISE_FILTERについては、副作用が多く、
・ ホーミング位置に±0.2mmの誤差が発生します。
・ ベッドプローブの精度も低下します。
・ MCUの負荷も増加します。
とあります。
やりたくないですね・・・非推奨です。

修正内容

フィラメント切れセンサーだけチャタリング防止を入れます。

この宣言をこっそり入れます。

Configuration_adv.h
/**
 * Filament Runout Sensor Debounce
 * Add a delay to debounce the filament runout sensor signal.
 * This helps prevent false triggers caused by noise or mechanical issues.
 */
#define FILAMENT_RUNOUT_DEBOUNCE_MS 500  // デバウンス時間 (ミリ秒)

正直、1000でもいいくらいだと思います。

次に、チャタリング防止の処理をmainに入れます。

Marlin_main.cpp
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
  #include "runout.h"
  static millis_t last_runout_time = 0;  // 最後にセンサーがトリガーされた時間

  void filament_runout_sensor_update() {
    static bool last_state = false;
    const bool current_state = READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_INVERTING;

    if (current_state != last_state) {
      // 状態が変化した場合、デバウンス時間を確認
      if (ELAPSED(millis(), last_runout_time + FILAMENT_RUNOUT_DEBOUNCE_MS)) {
        last_state = current_state;
        last_runout_time = millis();

        if (current_state) {
          // フィラメント切れを検出
          enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
        }
      }
    }
  }
#endif

フィラメンセンサー(といってもただのスイッチ)は他のセンサーとは異なり、
動作中フィラメントが動く部分なのであんまりスイッチはよくないと思うのですが、
さすが中華製ですねそういうところ無問題・・・。日本製だときっと非接触センサーを使用するでしょうね。(知らんけど・・・)

動作結果

現在問題なく動作しています。
印刷中止まることなく、ストレスフリーになりました。

動作環境

・ VSC+PlatformIO
・ Anycubic i3 Mega Marlin (BLTouch) 1.1.9 by davidramiro & MNieddu91
  https://github.com/MNieddu91/Marlin-AI3M-BLTouch

・ UltiMaker Cura
・ Octoprint + Raspberry Pi 3B (使われずに寝ていたものを発掘w)
・ TP-LINK Tapo P110M

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?