add m-codes

Hi,
as i want to use repetier fw also for milling i think about adding m-codes like M3 , M5  for spindle on/off an a couple of other commands

is there something special i hav to take care of?

i want to add the on/off commands similar to the power on off.

just adding the m3 / m5 like this:

        case 3: // M3 - Spindle On
#if SPINDLE_ON_PIN>-1
            Commands::waitUntilEndOfAllMoves();
            previousMillisCmd = HAL::timeInMilliseconds();
            SET_OUTPUT(PS_ON_PIN); //GND
            WRITE(SPINDLE_ON_PIN, (POWER_INVERTING ? HIGH : LOW));
#endif
            break;
        case 5: // M5 - Spindle Off
#if PS_ON_PIN>-1
            Commands::waitUntilEndOfAllMoves();
            SET_OUTPUT(PS_ON_PIN); //GND
            WRITE(SPINDLE_ON_PIN,(POWER_INVERTING ? LOW : HIGH));
#endif
            break;


has anybody some ideas how to realize other "mill-specific" codes like tool length measurement etc?

thanks for any thoughts

Comments

  • Except that PS_ON_PIN is for the PSU and not spindle this is ok (also neglecting the spindle direction).

    For tool measurement I'd add a z-probe( which is in this case a switching plate pointing up like usual in cnc) and would place it at a defined position. Then you could measure z height at that defined position and get the correct height. Just like G29 does but only at one point. You could even rewrite G29 to use only the first point.
  • OK, thanks for the info and pointing at my mismatch !
    I´ll also implement the G0 as written in the "G0rapidmove" discussion


Sign In or Register to comment.