Modifications of the Marlin firmware

Here a link to the firmware of my Prusa I3 laser engraver with Ramps 1.4 controller
Engraver_Marlin.rar

All modifications are made and I will describe them in detail here.

In Configuration.h
// This determines the communication speed of the printer
//#define BAUDRATE 250000
#define BAUDRATE 115200

Had to get a regular baud-rate, a baud-rate Visual Basic wil understand.

In Configuration.h
// 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
#define MOTHERBOARD 33

In Configuration.h
// Define this to set a custom name for your generic Mendel,
#define CUSTOM_MENDEL_NAME “My Laser”

In Configuration.h
#define TEMP_SENSOR_BED 0 // was 1

In Configuration.h
// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

In Pins.h
#if MOTHERBOARD == 33 || MOTHERBOARD == 35 || MOTHERBOARD == 67 || MOTHERBOARD == 68
#define FAN_PIN 8 // (Sprinter config)

In Pins.h
#if MOTHERBOARD == 35
#define HEATER_BED_PIN -1 // NO BED
#else
#if MOTHERBOARD == 77
#define HEATER_BED_PIN 9 // BED
#else
#define HEATER_BED_PIN 9 // BED
#endif
#endif

Pins D8 and D9 are exchanged. So the fan command will drive the MOSFET of the heatbed. On this MOSFET the laser is connected.

Now we have to change some G-code commands:

In Marlin_main.cpp

#if defined(FAN_PIN) && FAN_PIN > -1
//case 106: //M106 Fan On
case 03: //M03 Laser on
if (code_seen(‘S’)){
fanSpeed=constrain(code_value(),0,255);
}
else {
fanSpeed=255;
}
break;
//case 107: //M107 Fan Off
case 05: //M05 laser off
fanSpeed = 0;
break;
#endif //FAN_PIN

In this case fan-commands M106 and M107 are disabled and renamed to M03 and M05. M03 has still PWM control.

Here the hardware details:

To get 5 volt for the laser I have used a step-down from 12 to 5 volt.