grbl 1.1g with servo for Mana SE
Many versions of third party software (LightBurn, LaserWeb etc) require a more recent version of grbl to run on your EleksMaker Mana SE, if you want to get full capability (or in some cases use them at all).
The Mana SE is simply an ATmega 328p based CNC/Laser control board with Stepper Motor Control (step, direction & enable) on the standard Arduino CNC pins and Servo PWM/Laser PWM driven by D11 (standard hardware PWM pin), which can be easily updated to the latest version of grbl (NOTE: the bootloader will need to be reflashed to optiboot to create sufficient space for the latest grbl version). There are lots of instructional videos and on-line articles on how to reflash the bootloader on the supplied Arduino Nano clone that is part of the Mana SE (using another Nano or Uno) and on how to upload the latest version of grbl using the Arduino IDE (HINT: google is your friend).
You might also benefit from using better software and I would heartily recommend LightBurn (https://lightburnsoftware.com/pages/trial-version-try-before-you-buy) which provides a fully functional 30 day trial, and is very reasonably priced if you choose to buy. There are many benefits of using LightBurn software . . . the tools/features/functions are great . . . but most important is the seamless integration of CAD/CAM with direct control of your CNC/Laser machine which makes it very efficient and easy to use. This means that you can design with vectors, add text, import SVG and/or images (converted to vectors, if required) and burn or draw them on your EleksMaker machine all from within a single piece of software (and there are lots of tutorials on YouTube to help you learn how to use it) . . . gone are the days of struggling with converting objects or text to paths in InkScape (and no longer being able to edit them), multiple crashes in EleksCAM, exporting things to G-Code files and then transferring them with G-Code senders.
There are many reasons to upgrade to the latest version of grbl (compatibility with other software, performance, removed bugs etc), but for laser users the most relevant will be dynamic Laser Power / CNC Head Speed compensation (provided you have a laser with PWM/TTL control capability). This will significantly improve the quality of laser engraving and get rid of the dark areas/lines at the end of each move.
However, the standard version of grbl 1.1g does not support RC Servo functionality required for EleksDraw to support PEN UP/DOWN. Accordingly, I have created a modified ‘spindle_control.c’ for grbl 1.1 based on the current grbl 1.1g version, which provides full support for an RC Servo on Arduino Pin D11 (https://github.com/DWiskow/grbl1-1g-Servo).
To use this, download the latest version of grbl (1.1g) from github and replace ‘spindle_control.c’ with the version provided in the above link. You will also need to select/modify SPINDLE_TCCRB_INIT_MASK in ‘cpu_map.h’ to select the appropriate (61Hz) servo frequency rate and, of course, select/modify VARIABLE_SPINDLE in ‘config.h’ (not forgetting to set coreXY if you have an EleksDraw) . . . all other required #define(s) are contained with the modified ‘spindle_control.c’. All lines of code that have been added to ‘spindle_control.c’ are marked with a comment in column 100 of their respective lines. Apart from these 31 new lines of code (and an additional SPINDLE_TCCRB_INIT_MASK in ‘cpu_map.h’), the rest of the grbl 1.1g source is unchanged.
The #define RC_SERVO_SHORT (15) and RC_SERVO_LONG (31), in the modified ‘spindle_control.c’, set the PWM duty cycle for the RC Servo to 1.03ms and 2.05ms respectively (these are recommended values for standard RC Servos). There is also a #define that allows the servo to be inverted if movement of the arm is in the wrong direction.
NOTE: the added RC Servo functionality will only operate in ‘non laser’ ($32=0) mode and will be ignored if you have $32 set to 1 (however, the frequency SPINDLE_TCCRB_INIT_MASK set ‘cpu_map.h’ will still be 61Hz rather than the default 0.98kHz used by most diode laser PWM/TTL inputs). To use this functionality use G-Code M3 to turn on the RC Servo and G-Code M5 to turn off the servo. The amount the RC Servo moves is controlled with G-Code S commands in the range 0-255.
M3 S255 (turn servo full on) M5 (turn servo off) M3 S125 (turn servo half way) M3 S0 (turn servo on full off - similar to M5)