Reply To: MPCNC 2.8w $100 laser add-on complete

New Home Forum Mostly Printed CNC – MPCNC Your Builds – MPCNC MPCNC 2.8w $100 laser add-on complete Reply To: MPCNC 2.8w $100 laser add-on complete

#15036
Profile photo of Kalle
Kalle
Participant

Here are my modifications to duplicate the fanspeed-value to pin 44.
The modification was made with Marlin 1.1.0-RC6

Search in Pins.h to this part of the code:

#if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB)
  #define FAN_PIN           9 // (Sprinter config)

and add after the line
#define FAN PIN 9
the line #define LASER_PIN 44`
The modified code should look like this:

#if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF) || ENABLED(IS_RAMPS_EFB)
  #define FAN_PIN           9 // (Sprinter config)
  #define LASER_PIN         44 // (additional definition)
#if MB(RAMPS_14_EFF) || MB(RAMPS_13_EFF)
    #define CONTROLLERFAN_PIN  -1 // Pin used for the fan to cool controller
  #endif
#elif MB(RAMPS_14_EEF) || MB(RAMPS_14_SF) || MB(RAMPS_13_EEF) || MB(RAMPS_13_SF)
  #define FAN_PIN           8
#else
  #define FAN_PIN           4 // IO pin. Buffer needed
#endif

Second Modifikation in planner.cpp:
Search for
analogWrite(FAN_PIN, CALC_FAN_SPEED(0));
and add the line:
analogWrite(LASER_PIN, CALC_FAN_SPEED(0));
The code should now look like this:

 #if HAS_FAN0
        analogWrite(FAN_PIN, CALC_FAN_SPEED(0));
        analogWrite(LASER_PIN, CALC_FAN_SPEED(0));
    #endif

Hope i have explained it correctly.