Wykres commitów

699 Commity (master)

Autor SHA1 Wiadomość Data
Sonny Jeon bfb67f0c79
Update README.md 2021-01-22 19:13:48 -05:00
Sonny Jeon eefe2bb95b Update log. 2019-08-30 07:13:51 -04:00
Sonny Jeon bdc2da9b59 Fixed typo bug effecting dual-axis build with Y. 2019-08-30 07:13:21 -04:00
Sonny Jeon 40eb439bf2 Update grbl.h 2019-08-25 21:13:03 -04:00
Sonny Jeon cc4c0ffebc Update system.c 2019-08-25 21:04:09 -04:00
Sonny Jeon b75e5571ee Dual motor support for self-squaring gantry homing.
- New dual motor support feature for gantry CNC machines. An axis motor is  efficiently mirrored to a dedicated set of step and direction pins (D12/D13 or A3/A4) with no detectable loss of performance. Primarily used to independently home both sides of a dual-motor gantry with a pair of limit switches (second shared with Z-axis limit pin). When the limit switches are setup correctly, Grbl will self-square the gantry (and stay square if $1=255 is programmed). Beware use at your own risk! Grbl is not responsible for any damage to any machines.

- Dual axis motors is only supported on the X-axis or Y-axis. And deletes the spindle direction(D13) and optional coolant mist (A4) features to make room for the dual motor step and direction pins.

- Dual axis homing will automatically abort homing if one limit switch triggers and travels more than 5% (default) of the non-dual axis max travel setting. For example, if the X-axis has dual motors and one X-axis triggers during homing, Grbl will abort 5% of the Y-axis max travel and the other X-axis limit fails to trigger. This will help keep any misconfigurations or failed limit switches from damaging the machine, but not completely eliminate this risk. Please take all precautions and test thouroughly before using this.

- Dual axis motors supports two configurations:

- Support for Arduino CNC shield clones. For these, step/dir on pins D12/D13, and spindle enable is moved to A3 (old coolant enable), while coolant enable is moved to A4 (SDA pin). Variable spindle/laser mode option is NOT supported for this shield.

- Support for Protoneer CNC Shield v3.51. Step/dir on pins A3/A4, and  coolant enable is moved to D13 (old spindle direction pin). Variable spindle/laser mode option IS supported for this shield.

- Added Bob's CNC E3 and E4 CNC machine defaults.
2019-07-30 21:51:49 -04:00
Sonny Jeon bb25d2f97e
Update grbl.h 2018-11-12 08:25:57 -07:00
Sonny Jeon addb1a9813
Update system.c
Correct control pin state checking within pin change interrupt. Improper if-else statements could lead to missed signal.
2018-11-12 08:25:32 -07:00
Sonny Jeon 0b5604bd7b
Update gcode.c
If statement bug fix related to jog motion modal group error checking.
2018-11-12 08:20:45 -07:00
Sonny Jeon 332acada88 Spindle/coolant rare bug fixes. Free more flash.
[new] Altered the way default settings are stored and restored. Saved about 300 bytes(!) of flashed size. Should free up enough for certain configurations of CoreXY machines.

[fix] When the optional M7 mist coolant IO was enabled, coolant overrides was not disabling correctly.

[fix] Coolant override states was not restored correctly after a parking motion in certain situations. It would restore programmed state, rather than current overridden state.

[fix] Now allow coolant overrides to operate during jogging motion.

[fix] Invert control pin mask typo.

[new] Added a new build info feedback mechanism for enabling the safety door input pin.
2018-06-14 10:10:58 -06:00
Jon a84aa1800c Fix apparent error in restore masking that causes the call to coolant_set_state to not re-enable the mist (M7) output if it was previously enabled. (#469) 2018-06-09 17:47:01 -06:00
Sonny Jeon 5c8dcefcbd Updated instructions in fit_nonlinear_spindle.py
- repl.it has changed since the last time fit_nonlinear_spindle.py was tested. Updated instructions.
2018-04-06 13:09:15 -06:00
Sonny Jeon 5967839ab3 Improved fix for rare lowering feed/rapid override bug.
[fix] In the previous hot fix, there was still (rarer) potential for
very small floating point errors incorrectly handle an override
deceleration and crash Grbl. Re-factored the if-then statement in terms
of speed changes, rather than distance, to completely eliminate the
issue.
2017-08-01 10:27:42 -06:00
Sonny Jeon 477a94cd49 Hot fix for rare lowering feed override bug.
[fix] Squashed a very rare bug when lowering the feedrate (or rapid) override. When in the very strict set of circumstances with acceleration settings, override step size, and current speed, an internal calculation would cause Grbl to crash. The fix was an overlooked equality statement that should have been a less than or equal, not a less than.
2017-07-31 17:48:07 -06:00
Sonny Jeon 921e5a9799 Clean up and new streaming script check-mode feature.
[new] The stream.py streaming script now has a check-mode option, where it will place Grbl in $C check mode automatically and then stream the g-code program. It's a very fast way to check if the g-code program has any errors.

[fix] The debug variable was not initialized if the debug option was enabled in config.h

[fix] Updated error_codes CSV file to the same format as the others.
2017-07-17 21:25:42 -06:00
chamnit 790c666ecb New nonlinear spindle speed PWM output model and solution. Updated scripts.
[new] A nonlinear spindle speed/PWM output option via a piecewise
linear fit model. Enabled through config.h and solved by a Python
script in /doc/script

[new] fit_nonlinear_spindle.py. A solver script that can be run on
http://repl.it for free. No Python install necessary. All instructions
are available in the script file comments.

[new] stream.py has been updated to include status reports feedback at
1 second interval.

[fix] stream.py bug fix with verbose mode disabled.
2017-05-31 21:37:21 -06:00
Sonny Jeon 775acac601 Added an error code for laser mode when VARIABLE_SPINDLE is disabled.
- When trying to enable laser mode with $32=1 and VARIABLE_SPINDLE is
disabled, the error code shown was improperly stating it was a homing
failure. Added an new error code specifically for the laser mode being
disabled without VARIABLE_SPINDLE.
2017-03-24 20:18:54 -06:00
Sonny Jeon 43561abaf7 Housekeeping.
- Moved Grbl logo files to a separate repo.

- Added PocketNC FR4 defaults. Needs some additional work though to be
compatible.

- Updated README image links.
2017-03-19 09:27:52 -06:00
Sonny Jeon b214accc6d Update README.md 2017-03-19 09:09:09 -06:00
Sonny Jeon 849122559b Fixed $G report issue with M7 and M8 both enabled.
[fix] When M7 and M8 are both enabled, $G report would show `M78`,
rather than `M7 M8`. This only effects systems that enable M7 mist
coolant in config.h. Not the default build.
2017-03-02 09:40:23 -07:00
Sonny Jeon fd2a4ebaee Fixed shared build info code.
- The build info options of “two switches on an axis” and “homing init
lock” shared the same letter ‘L’. The former is now ’T’.
2017-02-27 15:24:51 -07:00
Sonny Jeon e54444e948 Restrict coincident target updates to M3 constant laser only.
- Restrict M3 forced updates when there is a motion block with a
coincident target. Force syncing of the spindle state can lead to some
pauses during a job that has coincident targets. That’s not
particularly desirable. This ensures M4 dynamic mode is not effected by
this force-sync.
2017-02-23 12:52:35 -07:00
Sonny Jeon bdc853e557 Fixed issue with M3 laser state changes and coincident targets.
[fix] When in M3 constant laser power mode, a change from G0 to G1
would not set the laser on, if G1 was passed with a coincident target.
Motion controller now checks for a coincident target situation and will
force a spindle sync when detected.
2017-02-23 12:00:20 -07:00
Sonny Jeon f51268e855 Additional build info in the $I printout.
- [new] Added total available planner buffer blocks (15 shown, but
there are 16. one is used by the ring buffer and to execute system
motions) and serial RX buffer bytes. This information is useful for
GUIs to setup and optimize their streaming protocols easily.

[doc] Updated the interface document to reflect the change.
2017-01-31 18:46:20 -07:00
Sonny Jeon beaa40583c Tidying up parking override control implementation
[new] Added a default configuration for the parking override control
upon a reset or power-up. By default, parking is enabled, but this may
be disabled via a config.h option.

[fix] Parking override control should be checking if the command word
is passed, rather than the value.
2017-01-29 11:35:51 -07:00
chamnit e455764079 v1.1f. Parking override control. Spindle enable pin option.
[ver] v1.1f update due to tweaks to interface from new parking override
control.

[new] Parking motion override control via new `M56 P0` and `M56 P1`
command, which disables and enables the parking motion, respectively.
Requires ENABLE_PARKING_OVERRIDE_CONTROL and PARKING_ENABLE enabled in
config.h. Primarily for OEMs.

[new] `M56` appears in the $G report when enabled.

[new] Five new build info identification letters. Some were missing and
a couple are new. Updated the CSV and documentation to reflect these
new items.

[new] Spindle enable pin configuration option to alter its behavior
based on how certain lasers work. By default, Grbl treats the enable
pin separately and leaves it on when S is 0. The new option turns the
enable pin on and off with S>0 and S=0. This only is in effect when a
user enables the USE_SPINDLE_DIR_AS_ENABLE_PIN option.

[fix] M4 is now allowed to work when USE_SPINDLE_DIR_AS_ENABLE_PIN is
enabled. Previously this was blocked and was problematic for laser
folks using M4.

[fix] Properly declared system variables as extern. Not sure how that
went unnoticed or why it worked up until now but it has.

[fix] EXTREMELY RARE. When AMASS is intentionally disabled and sent a
motion command that is _one step_ in length, Grbl would not actuate the
step due to numerical round-off. Applied a fix to prevent the round-off
issue.

[fix] Added a compile-time check for AMASS settings to make sure that
the numerical round-off issue doesn’t effect it. This would only happen
if someone set AMASS max levels to zero. It does not effect AMASS with
its current defaults.

[fix] Wrapped the mc_parking_motion() function in an ifdef for porting
purposes.

[fix] Fixed an issue when in inverse time mode and G0’s would require a
F word. This was not correct.

[fix] Added a note in the defaults.h file that MAX_TRAVEL values must
be positive. Some users were setting this negative and it was causing
issues.
2017-01-28 17:13:06 -07:00
Sonny Jeon 67ab9280d9 Tool number bug fix. Updated documentation.
- [fix] Tool numbers were not being tracked and reported correctly. Now
shows tool number values in $G when programmed.

- [fix] Added a max tool number value check to the g-code parser.

- [doc] Added a new error code for invalid tool number. Updated CSV and
interface documents.

- [doc] Added a implementation note for buffer state in status reports.
Don’t rely on this data for streaming.
2017-01-14 13:54:14 -07:00
Sonny Jeon 30c0f79afd Spindle enable pin with variable spindle option fix.
- [fix] When USE_SPINDLE_DIR_AS_ENABLE_PIN is enabled in config.h, the
enable pin was not being set when spindle speed is zero. This behavior
should now be fixed.
2017-01-03 10:10:35 -07:00
Sonny Jeon 864d1306b9 Fixed homing fail alarm handling. Re-integrated software debouncing.
- [bug] Fixed a homing fail issue, where the alarm was not being set
right, not cleared correctly. It would report the wrong code and enter
an infinite alarm loop. This was due to how alarm codes were altered a
while back. Now updated and fixed to show the right codes.

- [feature] Re-installed optional software debouncing for hard limit
switches. By request.
2016-12-19 22:18:23 -07:00
Sonny Jeon d5ed3bdb81 Addressed optional PWM min value issue. Updated docs.
- [fix] Spindle PWM minimum value had some typos. Fixed the macros to
compile correctly. Only effects users that enable SPINDLE_MINIMUM_PWM.
The name changed to SPINDLE_PWM_MIN_VALUE for consistency sake.

- Updated the laser documentation.
2016-12-18 19:17:55 -07:00
Sonny Jeon af17f0071f Updating steam.py streaming script
- Added push message capability to the stream.py streaming script. It
prints out as a `Debug:` string in the output.
2016-12-12 11:49:18 -07:00
Sonny Jeon 5d79103eb9 Updated documentation. 2016-12-11 20:04:17 -07:00
Sonny Jeon 91d6de90bd Updated documentation. Cleaned up a bit.
- [doc] Updated the markdown documents for the v1.1 release.

- [doc] Removed references to classic GUI mode.
2016-12-10 23:13:28 -07:00
Sonny Jeon 4d10c3062c Update README.md 2016-12-09 22:00:38 -07:00
Sonny Jeon 8f9605c65a Update README.md 2016-12-09 21:54:43 -07:00
Sonny Jeon 54985b30a3 Update README.md 2016-12-09 21:53:28 -07:00
Sonny Jeon 490d3f1220 Removed classic GUI interface. Fixed typo with line number support.
- [config] Permanently removed classic GUI interface support. This
unintentionally created a problem where some users/GUI devs used this
compatibility mode and did not update to the new interface. So, there
were two interfaces in use, rather than just one like it was intended.
This removal should help everyone by forcing all GUIs to update and
updated GUI not having to support yet another interface.

- Fixed typo with line number support in jog mode.
2016-12-08 23:17:45 -07:00
chamnit 94083e8314 Fixed unintended laser mode pausing. Updated documentation. Min SS OVR lowered to 10%.
- [laser] Tested a working version and pushed the wrong one for the
last! 20161203 was pausing upon every spindle speed change. That’s not
right. Fixed so nearly all motions are passed through and does not stop.

- Minimum spindle speed override lower from 50% to 10%. Lasers could
use the lower speeds.

- Fixed a very minor bug related to G80 error checking. Allowed no
error with non-modal motions with axis words. Not correct and fixed.

- Fixed a compile error when disabling VARIABLE_SPINDLE

- [doc] Updated some obsolete documentation.

- [doc] Started a “Laser Mode” document that summarizes how Grbl’s new
laser mode works.
2016-12-04 23:49:48 -07:00
Sonny Jeon b753c542c7 v1.1e: New laser features. G-code parser refactoring. CoreXY homing fix.
- Increment to v1.1e due to new laser features.

- After several discussions with some prominent laser people, a few
tweaks to the new laser mode has been installed.

- LASER: M3 behaves in a constant power mode.

- LASER: M4 behaves in a dynamic power mode, where the laser power is
automatically adjusted based on how fast Grbl is moving relative to the
programmed feed rate. This is the same as the  CONSTANT_POWER_PER_RATE
config.h option in the last version. NOTE: When not in motion in M4,
Grbl automatically turns off the laser. Again, it only operates while
moving!

- LASER: Only G1, G2, and G3 motion modes will turn on the laser. So,
this means that G0, G80 motion modes will always keep the laser
disabled. No matter if M3/M4 are active!

- LASER: A spindle stop override is automatically invoked when a laser
is put in a feed hold. This behavior may be disabled by a config.h
option.

- Lots of little tweaks to the g-code parser to help streamline it a
bit. It should no effect how it operates. Generally just added a parser
flag to track and execute certain scenarios a little more clearly.

- Jog motions now allow line numbers to be passed to it and will be
displayed in the status reports.

- Fixed a CoreXY homing bug.

- Fixed an issue when $13 is changed, WCO isn’t sent immediately.

- Altered how spindle PWM is set in the stepper ISR. Updated on a step
segment basis now. May need to change this back if there are any
oddities from doing this.

- Updated some documentation. Clarified why M0 no longer showing up in
$G and why a `1.` floating point values are shown with no decimals,
like so `1`.
2016-12-03 18:02:45 -07:00
Sonny Jeon 998f23b9ce PWM calculation correction.
- The PWM calculation was a little bit off and has been corrected.

- Edited the unused settings strings to be smaller and just show what
the settings are, rather than include units. May include this in the
master build, if it fits.

- The minimum spindle PWM define in config.h needed to be update for
cpu map compatibilty.
2016-11-12 20:54:38 -07:00
Sonny Jeon 1161056bf2 Fixed a g-code parser issue caused by last commit.
- G-code parser refactoring in the last commit wasn’t tested. Found and
fixed issues with G28.1/30.1 and G38.x probe commands. They were not
being accepted due to a borked mantissa check.
2016-11-04 10:50:28 -06:00
Sonny Jeon 6e3fb6bd13 Improved constant laser power per rate mode. Re-factored for flash size. Minor bug fixes.
- NOTE: This commit has largely been untested.

- Constant laser power per rate mode has been improved. Altered its
implementation to be more responsive and accurate.

- Based on LaserWeb dev feedback, only G1, G2, and G3 moves operate
with constant laser power mode. Meaning that G0, G38.x, and $J jogging
motions operate without it and will keep a constant power output. This
was specifically requested as a way to focus the laser by keeping the
laser on when not moving. Operationally, this shouldn’t alter how the
laser mode operates.

- Re-factored parts of the g-code parser and g-code state reports to
save a few hundred bytes of flash. What was done makes the code a bit
more unreadable (bad), but the flash space was in dire need. So, I’m
willing to live with it for now.

- Fixed a problem with $G g-code state reports. Showed `M0` program
pause during a run state. Now fixed to show nothing during a run state.
Also, `M30` program end was shown as `M2`. This was also corrected.

- Improved spindle stop override responsiveness by removing the
enforced spindle restoring delay. It’s not needed for a feature that is
user controlled.

- Fixed a bug with G2/3 arcs in inverse time mode.

- Updated the interface.md document to make it more clear how WPos: or
MPos: can be calculated from WCO:. Some GUI devs have failed to catch
this in the documentation.
2016-11-04 09:15:34 -06:00
Sonny Jeon e8b717604b Spindle speed overrides behavior tweak. New experimental laser dynamic power mode.
- Spindle speed overrides now update immediately if they are changed
while in a HOLD state. Previously, they would update after exiting the
HOLD, which isn’t correct.

- New experimental dynamic laser power mode that adjusts laser power
based on current machine speed. Enabled by uncommenting
LASER_CONSTANT_POWER_PER_RATE in config.h

  - It assumes the programmed rate is the intended power/rate for the
motion.
  - Feed rate overrides (FRO) do not effect the power/rate. Meaning
that spindle PWM will automatically lower with lower FRO and increase
with higher FRO to keep it the same.
  - Spindle speed overrides (SSO) will directly increase and decrease
the power/rate. So 150% SSO will increase the PWM output by 150% for
the same speed.
  - The combination of FRO and SSO behaviors should allow for subtle
and highly flexible tuning of how the laser cutter is operating in
real-time and during the job.

- Re-factored planner block rapid rate handling for the dynamic laser
power feature. Should have had no effect on how Grbl operates.
2016-10-27 09:11:59 -06:00
Sonny Jeon cb916a996a Add high-frequency spindle output option. Minor parking motion re-factoring.
- Some laser controllers were reported to need a very high PWM
frequency. Added a line to enable this in cpu_map.h, if needed.

- Cleaned up some of the parking code. Mostly just editing the comments.

- Moved the accessory state resetting after the initial parking
retract. Should ensure the accessory state is properly handled upon an
aborted parking restore. Not certain if this was a problem before
though. Just to be sure.
2016-10-26 08:42:45 -06:00
chamnit 3854d200bb Mandate all probe cycles ignore feed overrides.
- For repeatability reasons, all G38.x probe cycles ignore feed rate
overrides and move at their programmed speed.

- The mandate can be removed with a new config.h option.

- Updated the documentation to reflect the change.
2016-10-25 20:03:30 -06:00
chamnit a6f6431515 Resolved parking accessory handling issue.
- Yikes. Totally borked the last parking “fix”. Testing shows that all
accessories are now properly handled when retracting and restoring. It
was caused by not accounting for the planner re-factoring correctly in
the parking code.
2016-10-25 19:43:06 -06:00
Sonny Jeon f8ca08ad66 Minor re-factoring. Fix an issue with parking and spindle restore.
- Altered the report counters to be count down, rather than count up.
Simplified some of the logic.

- Fixed an issue with parking restore. The spindle state would disable
then reenable.

- Clarified some of the config.h descriptions.

- Moved the compile-time checks from config.h to grbl.h. They don’t
belong in the config.h file.

- Refactored the initialization of the system variables in main.c.
System position and probe position were undefined when power cycled,
but were zero anyway. Added clear vector code to make it explicit.
2016-10-24 22:18:13 -06:00
Sonny Jeon 498dd62572 Spindle speed close to minimum fix.
- When spindle speed is close to the minimum rpm, the PWM value would
be zero or lower than allowed. The computation error was caused by
setting the minimum PWM value to zero, when it should have been 1.

- Added a compiler check for minimum PWM to be greater than zero.

- Moved some of the spindle PWM macros to a more appropriate place in
the cpu_map.h.
2016-10-23 13:55:50 -06:00
Will Winder 8e638f0054 Minor VARIABLE_SPINDLE feature toggle refactoring (#16)
* Modify code CSV format.

- Wrap value in quotes to avoid issue with embedded commas. This occurs
  in one of the alarm codes.

- Change header row format to allow same parsing code as data rows.

* VARIABLE_SPINDLE feature flag experiment.

- Use a macro for 'spindle_set_speed' and 'spindle_sync' to reduce the
  number of required VARIABLE_SPINDLE checks.
2016-10-22 13:28:05 -06:00
Sonny Jeon 8b76a39d5d Improved option for v0.9 GUI compatibility.
- Addressed an issue with backward compatibility with Grbl v0.9-style
GUIs.

- It still may not work due to new data and states coming back from
Grbl v1.1. Regardless, DO NOT TRY TO USE THE COMPATIBILITY MODE UNTIL
THERE IS A REALLY GOOD REASON TO.

- v0.9 GUI compatibility mode will be removed in future versions.
You’ve been warned. It’s highly recommended for GUIs to update to the
new v1.1 interface.

- Compability mode will only fit on an Arduino Uno due to size
increases.

- Removed the REPORT_GUI_MODE compile option since it’s part of the
v1.1 interface standard.

- Updated the documentation to better describe the compatibility mode
build option.
2016-10-18 22:58:52 -06:00