El GRBL ha afegit noves funcions per al laser, amb el bCNC, he tingut algun problema, com que amb $32=1, que es mode laser activat, no va el laser. No se si es que la sortida del laser estarà a altre pin …? caldrà fer mes prove.
Aquesta es l'informació que hi ha la github. Totes aquestes funcions no hi son al Marlin o Repetier, per aixó serà millor el grbl per als lasers, que amb una impressora. De tota manera amb un control del codi G supose que tot es podrà fer.
_DISCLAIMER: Lasers are extremely dangerous devices. They can instantly cause fires and permanently damage your vision. Please read and understand all related documentation for your laser prior to using it. The Grbl project is not resposible for any damage or issues the firmware may cause, as defined by its GPL license._
Outlined in this document is how Grbl alters its running conditions for the new laser mode to provide both improved performance and attempting to enforce some basic user safety precautions.
## Laser Mode Overview
The main difference between default Grbl operation and the laser mode is how the spindle/laser output is controlled with motions involved. Every time a spindle state `M3 M4 M5` or spindle speed `Sxxx` is altered, Grbl would come to a stop, allow the spindle to change, and then continue. This is the normal operating procedure for a milling machine spindle. It needs time to change speeds.
However, if a laser starts and stops like this for every spindle change, this leads to scorching and uneven cutting/engraving! Grbl's new laser mode prevents unnecessary stops whenever possible and adds a new dynamic laser power mode that automagically scales power based on current speed related to programmed rate. So, you can get super clean and crisp results, even on a low-acceleration machine!
Enabling or disabling Grbl's laser mode is easy. Just alter the $32 Grbl setting. - To Enable: Send Grbl a `32=0` command.
WARNING: If you switch back from laser mode to a spindle for milling, you MUST disable laser mode by sending Grbl a `$32=0` command. Milling operations require the spindle to get up to the right rpm to cut correctly and to be safe, helping to prevent a tool from breaking and flinging metal shards everywhere. With laser mode disabled, Grbl will briefly pause upon any spindle speed or state change to give the spindle a chance to get up to speed before continuing.
## Laser Mode Operation
When laser mode is enabled, Grbl controls laser power by varying the 0-5V voltage from the spindle PWM D11 pin. 0V should be treated as disabled, while 5V is full power. Intermediate output voltages are also assumed to be linear with laser power, such that 2.5V is approximate 50% laser power. (A compile time option exists to shift this linear model to start at a non-zero voltage.)
By default, the spindle PWM frequency is 1kHz, which is the recommended PWM frequency for most current Grbl-compatible lasers system. If a different frequency is required, this may be altered by editing the `cpu_map.h` file.
The laser is enabled with the `M3` spindle CW and `M4` spindle CCW commands. These enable two different laser modes that are advantageous for different reasons each.
- `M3` Constant Laser Power Mode:
- `M4` Dynamic Laser Power Mode:
Describe below are the operational changes to Grbl when laser mode is enabled. Please read these carefully and understand them fully, because nothing is worse than a garage _fire_.
- Grbl will move continuously through consecutive motion commands when programmed with a new `S` spindle speed (laser power). The spindle PWM pin will be updated instantaneously through each motion without stopping.
G1 X10 S100 F50 G1 X0 S90 G2 X0 I5 S80 ``` - Grbl will enforce a laser mode motion stop in a few circumstances. Primarily to ensure alterations stay in sync with the g-code program.
- The laser will only turn on when Grbl is in a `G1`, `G2`, or `G3` motion mode.
- An `S0` spindle speed of zero will turn off the laser. When programmed with a valid laser motion, Grbl will disable the laser instantaneously without stopping for the duration of that motion and future motions until set greater than zero..
###CAM Developer Implementation Notes
TODO: Add some suggestions on how to write laser G-code for Grbl.
- When using `M3` constant laser power mode, try to avoid force-sync conditions during a job whenever possible. Basically every spindle speed change must be accompanied by a valid motion. Any motion is fine, since Grbl will automatically enable and disable the laser based on the modal state. Avoid a `G0` and `G1` command with no axis words in this mode and in the middle of a job.
- Ensure smooth motions throughout by turning the laser on and off without an `M3 M4 M5` spindle state command. There are two ways to do this: