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.

 

M117 message command

The result of a M117 G-code command. In the Posts you can read that in the Marlin firmware, I have named my Laser Engraver ‘My Laser’. A message ‘My Laser ready’ on the bottom line of the display. I have noticed that the GRBL-driven laser engravers don’t like these M117 commands, so in the GUI of the converter there is an option the disable generation of these messages. Also a Prusa I3 with an Ramp 1.4 controller is working on 250000 baud (yes, a strange value), the Banggood laser engravers are working on 9600 baud.

The base – a Prusa I3

Used a Prusa I3 as base for this laser engraver. With a RAMPS 1.4 controller.
Moved in pins.h the fan from D9 to D8
Made a separate power for the laser with a step-down 12 -> 5 Volt
If you check the schematics of the RAMPS 1.4 you will see the heatbed is seperate powered. Heatbed mosfet is now laser controller.
Replaced M106 and M107 in the Marlin firmware by M03 and M05.
M03 is PWM based. It turns now the laser on. M05 turns laser off.

Details about these modification follows.