Welcome! Log In Create A New Profile

Advanced

Problema M117 e M0 su Marlin. Sbaglio a compilare il gcode?

Posted by Aldebaran94 
Problema M117 e M0 su Marlin. Sbaglio a compilare il gcode?
October 25, 2018 11:23AM
Salve a tutti
Sto compilando un gcode personalizzato, in particolare ho notato che quando metto in pausa con l'M0 e scrivo il testo, in verità poi sul display il testo non compare ma rimane la scritta "wait for user".
Come mai? Ho provato a mettere anche l'M117 per scrivere il messaggio ma non compare niente. Dove sbaglio?

Questo è un esempio del gcode

G28
M0 Primo angolo
G0 F1000 Z10  
G0 F3000 X40 Y40 Z0.1
M0 Secondo angolo
G0 F1000 Z10 
G0 F3000 X190 Y40 Z0.1

Edited 1 time(s). Last edit at 10/25/2018 11:24AM by Aldebaran94.
Re: Problema M117 e M0 su Marlin. Sbaglio a compilare il gcode?
October 25, 2018 12:12PM
M0 è uno stop non dovrebbe stampare nulla

M117 dovrebbe stampare sul display LCD almeno come riportato sulla pagina:

RepRap Wiki GCode

* M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)

In MK4duo.ino la spiegazione dice solo che aspetta la pressione del tasto sull'LCD, non che stampa un messaggio sull'LCD

* M117 - Display a message on the controller screen
* M118 - Display a message in the host console.

Il comando M117 dovrebbe stampare sull'LCD e il M118 dovrebbe stampare sulla console (terminale seriale)

Seguendo la logica il conportamento voluto dovrebbe ottenersi con


M117 Il messaggio

M0 " qui aspetta la pressione sul tasto"

Ora non posso provare però la nota (Only if ULTRA_LCD is enabled) magari si riferisce al fatto che funzioni solo sui display non grafici visto che la linea è preceduta da questo nel Configuration_Features.h di MK4Duo, che non dovrebbe discostarsi molto dal Marlin "liscio" in questa parte di codice

//
// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD.
//
//#define ULTRA_LCD

però in: /home/carlo/3D/MK4duo/src/core/commands/gcode/lcd/m0_m1.h non viene menzionato ULTRA_LCD.

magari il Mago potrà far luce su questo aspetto


/**
 * MK4duo Firmware for 3D Printer, Laser and CNC
 *
 * Based on Marlin, Sprinter and grbl
 * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
 * Copyright (C) 2013 Alberto Cotronei @MagoKimbra
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see [www.gnu.org].
 *
 */

/**
 * mcode
 *
 * Copyright (C) 2017 Alberto Cotronei @MagoKimbra
 */

#if HAS_RESUME_CONTINUE

  #define CODE_M0
  #define CODE_M1

  /**
   * M0: Unconditional stop - Wait for user button press on LCD
   * M1: Same as M0
   */
  inline void gcode_M0_M1(void) {
    const char * const args = parser.string_arg;

    millis_t ms = 0;
    bool hasP = false, hasS = false;
    if (parser.seenval('P')) {
      ms = parser.value_millis(); // milliseconds to wait
      hasP = ms > 0;
    }
    if (parser.seenval('S')) {
      ms = parser.value_millis_from_seconds(); // seconds to wait
      hasS = ms > 0;
    }

    planner.synchronize();

    #if ENABLED(ULTIPANEL)

      if (!hasP && !hasS && args && *args)
        lcd_setstatus(args, true);
      else {
        LCD_MESSAGEPGM(MSG_USERWAIT);
        #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
          dontExpireStatus();
        #endif
      }

    #elif ENABLED(NEXTION)

      if (!hasP && !hasS && args && *args)
        lcd_yesno(4, args, "", MSG_USERWAIT);
      else
        lcd_yesno(4, MSG_USERWAIT);

    #else

      if (!hasP && !hasS && args && *args)
        SERIAL_LT(ECHO, args);

    #endif

    printer.setWaitForUser(true);
    printer.keepalive(PausedforUser);

    if (ms > 0) {
      watch_t watch(ms);
      while (!watch.elapsed() && printer.isWaitForUser()) printer.idle();
    }
    else {
      #if ENABLED(ULTIPANEL)
        if (lcd_detected())
      #endif
        while (printer.isWaitForUser()) printer.idle();
    }

    IS_SD_PRINTING ? LCD_MESSAGEPGM(MSG_RESUMING) : LCD_MESSAGEPGM(WELCOME_MSG);

    printer.setWaitForUser(false);
    printer.keepalive(InHandler);
  }

#endif // HAS_RESUME_CONTINUE



Saluti

Carlo D.

Edited 1 time(s). Last edit at 10/25/2018 12:19PM by onekk.


P3Steel - MKS GEN v1.2 e REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + Gen 7 MOSFET (HotBed) + alimentatore step-down 12V -> 5V
Firmware MK4duo 4.3.6 con ABL induttivo con LJ18A3 - Slic3R (Originale) ed ESP3D per controllare la stampante da remoto.
HotEnd Cinese V6 clone con ugello da 0.4mm.

[My Building Log]
Re: Problema M117 e M0 su Marlin. Sbaglio a compilare il gcode?
October 25, 2018 01:14PM
Quote
onekk
M0 è uno stop non dovrebbe stampare nulla

M117 dovrebbe stampare sul display LCD almeno come riportato sulla pagina:

RepRap Wiki GCode

* M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)

In MK4duo.ino la spiegazione dice solo che aspetta la pressione del tasto sull'LCD, non che stampa un messaggio sull'LCD

* M117 - Display a message on the controller screen
* M118 - Display a message in the host console.

Il comando M117 dovrebbe stampare sull'LCD e il M118 dovrebbe stampare sulla console (terminale seriale)

Seguendo la logica il conportamento voluto dovrebbe ottenersi con


M117 Il messaggio

M0 " qui aspetta la pressione sul tasto"

Ora non posso provare però la nota (Only if ULTRA_LCD is enabled) magari si riferisce al fatto che funzioni solo sui display non grafici visto che la linea è preceduta da questo nel Configuration_Features.h di MK4Duo, che non dovrebbe discostarsi molto dal Marlin "liscio" in questa parte di codice…


Saluti

Carlo D.

Ciao Carlo, ti ringrazio ancora per la disponibilità, non è il caso di scomodare il MagoKimbra. Ora ho intenzione di usare l' M226, tuttavia non capisco quale sia il pin esatto dell'encoder che clicco, perché quando provo quelli per il RepRap full graphic Smart Controller, la stampante mi va in tilt e continua a cliccare anche se non sto facendo niente.

per caso riesci a dirmi quale sia tra questi? Fai conto che qui c'è il marlin caricato sulla mia ender 3 Pinset Marlin

Edited 1 time(s). Last edit at 10/25/2018 01:15PM by Aldebaran94.
Re: Problema M117 e M0 su Marlin. Sbaglio a compilare il gcode?
October 25, 2018 06:19PM
Guarda che M0 fa quello che a te serve aspetta che tu prema il pulsante, ma non puoi cambiare la scritta perché appunto scrive wait for user, per indicare che sta aspettando che tu prema il pulsante...


COMPRA ITALIANO - sostieni le nostre aziende - sostieni la nostra gente - sostieni il tuo popolo - sosterrai te stesso.
Alberto C. felice possessore di una Kossel K2
My Blog - My Thingiverse
Sorry, only registered users may post in this forum.

Click here to login