Commit Graph

566 Commits

Author SHA1 Message Date
Sonny Jeon
955a9f3cf8 Allow '$$' in check mode.
- Now allows the ‘$$’ view Grbl settings while in check mode

- Updated the version build date
2014-08-04 06:25:17 -06:00
Sonny Jeon
b33c2dd842 Update README.md 2014-08-04 05:54:15 -06:00
Sonny Jeon
d55f6b938c Fixed probe position sync error.
- Restored probe position syncing. Had removed a pull-off motion after
a probe cycle completes, but ended up de-synchronizing the g-code
parser and probing cycle positions. Putting the pull-off motion back
fixed the problem.
2014-08-04 05:52:41 -06:00
Sonny Jeon
aa314776e0 Update README.md 2014-08-03 21:12:51 -06:00
Sonny Jeon
469399fcd5 Probing cycle and view build info bug fixes.
- Probing cycle would drop into a QUEUED state, if multiple G38.2 are
sent. It would not honor the auto cycle start flags. To fix, the auto
cycle start state is saved at the beginning of the probing cycle and
restored at the end, since the feed hold it uses to stop a triggered
probe will disable the auto start flag. For now it’s a patch, rather
than a permanent fix.

- protocol_buffer_synchronize() also has a failure case. Auto cycle
start does not get executed when the system is waiting in here, so if
it’s in a QUEUED state already, it won’t resume. Patched here, but not
fully resolved.

- Fixed a problem with the “view build info” command. The EEPROM write
would do weird things and corrupt the EEPROM. Not sure exactly what
caused it, but it’s likely a compiler problem with an improperly
defined EEPROM address. It didn’t have enough room to store a full
string. To fix, the build info EEPROM range was increased and the max
number of STARTUP_BLOCKS was reduced to 2 from 3.

- Lastly, when a $I view build info is used for the first time, it
would normally show an EEPROM read error, since it wasn’t cleared or
wasn’t therein the first place. It will now not show that error. A
patch rather than a permanent fix again.
2014-08-03 21:10:27 -06:00
Sonny Jeon
4c97bfc929 Update README.md 2014-08-01 08:39:04 -06:00
Sonny Jeon
5c0d311d92 Minor bug fixes.
- Bug fix for step and direction invert masks not immediately being in
effect. Now regenerates the masks when a user changes this setting.

- Bug fix for probing cycle. G-code standard mandates that there is an
error if the probe is already triggered when the cycle is commanded.
However, Grbl may have motions to pull off a previous probing cycle in
queue and can falsely lead to errors. To fix this, the triggered check
is performed within the probing cycle itself, right after the planner
buffer is synced. If there is an error, it will now alarm out as a
probe fail.
2014-08-01 08:29:35 -06:00
Sonny Jeon
a396adf60e Compile in Atmel Studio fix. 2014-07-28 21:44:56 -06:00
Sonny Jeon
3081be8e76 Update README.md 2014-07-28 06:55:43 -06:00
Sonny Jeon
06832148a8 Added build info feedback in help
- `$I` prints the Grbl build info and version number. NOTE: `$I=xxx`
stores an additional 30 character string into EEPROM, which will be
printed with the build info the next time it’s run. This is for
identification purposes for users that have more than one system using
Grbl.
2014-07-27 16:59:39 -06:00
Sonny Jeon
299c09d177 Updates to allow Arduino IDE direct compiling.
- Only minor changes were required to make the Arduino IDE compile all
of the Grbl’s source code (correctly using the C-compiler). Tested in
Windows and Mac and with the normal USB upload and with a programmer.
2014-07-26 15:11:42 -06:00
Sonny Jeon
71f333ddca Settings refactoring. Bug fixes. Misc new features.
This is likely the last major change to the v0.9 code base before push
to master. Only two minor things remain on the agenda (CoreXY support,
force clear EEPROM, and an extremely low federate bug).

- NEW! Grbl is now compile-able and may be flashed directly through the
Arduino IDE. Only minor changes were required for this compatibility.
See the Wiki to learn how to do it.

- New status reporting mask to turn on and off what Grbl sends back.
This includes machine coordinates, work coordinates, serial RX buffer
usage, and planner buffer usage. Expandable to more information on user
request, but that’s it for now.

- Settings have been completely renumbered to allow for future new
settings to be installed without having to constantly reshuffle and
renumber all of the settings every time.

- All settings masks have been standardized to mean bit 0 = X, bit 1 =
Y, and bit 2 = Z, to reduce confusion on how they work. The invert
masks used by the internal Grbl system were updated to accommodate this
change as well.

- New invert probe pin setting, which does what it sounds like.

- Fixed a probing cycle bug, where it would freeze intermittently, and
removed some redundant code.

- Homing may now be set to the origin wherever the limit switches are.
Traditionally machine coordinates should always be in negative space,
but when limit switches on are on the opposite side, the machine
coordinate would be set to -max_travel for the axis. Now you can always
make it [0,0,0] via a compile-time option in config.h. (Soft limits
routine was updated to account for this as well.)

 - Probe coordinate message immediately after a probing cycle may now
be turned off via a compile-time option in config.h. By default the
probing location is always reported.

- Reduced the N_ARC_CORRECTION default value to reflect the changes in
how circles are generated by an arc tolerance, rather than a fixed arc
segment setting.

- Increased the incoming line buffer limit from 70 to 80 characters.
Had some extra memory space to invest into this.

- Fixed a bug where tool number T was not being tracked and reported
correctly.

- Added a print free memory function for debugging purposes. Not used
otherwise.

- Realtime rate report should now work during feed holds, but it hasn’t
been tested yet.

- Updated the streaming scripts with MIT-license and added the simple
streaming to the main stream.py script to allow for settings to be sent.

- Some minor code refactoring to improve flash efficiency. Reduced the
flash by several hundred KB, which was re-invested in some of these new
features.
2014-07-26 15:01:34 -06:00
Sonny Jeon
3aeb5d3d06 Update README.md 2014-07-17 07:33:53 -06:00
Sonny Jeon
1c74be0625 Update README.md 2014-07-12 10:50:02 -06:00
Sonny Jeon
48dc1902a7 Update README.md 2014-07-12 10:40:39 -06:00
Sonny Jeon
89df0f28c8 Update README.md 2014-07-12 10:39:40 -06:00
Sonny Jeon
ac7db2c8b2 Updated README 2014-07-12 10:33:55 -06:00
Sonny Jeon
1969f8b057 Updated README 2014-07-11 10:14:08 -06:00
Sonny Jeon
7d0df8ac4a Merge pull request #441 from ashelly/edge-simfix
Fixes for simulator in alternate configurations.
2014-07-11 08:41:04 -06:00
ashelly
c7039b3512 Restore changes made only for testing. 2014-07-10 13:13:58 -04:00
ashelly
9b37637ae6 Bug fixes for timers, added some wdt support for limit debounce.
- Typo in timer def,
- Handle 8 bit timers correctly,
- Don't skip TOP count in CTC mode
- added SREG for atomic bit operations
2014-07-10 13:01:03 -04:00
Sonny Jeon
23ed7b6d4b Merge branch 'dev' into edge
Conflicts:
	sim/simulator.c
	sim/simulator.h
2014-07-09 09:52:57 -06:00
Sonny Jeon
6c22cb37c2 Added test g-code programs. 2014-07-09 09:17:33 -06:00
Sonny Jeon
a35262d56e Version and build update.
- Incremented from v0.9e to v0.9f due to the new g-codes, velocity
reporting option, decimal printing refactoring, grbl-sim updates, and
G0/G1 bug fix.

- Settings version was also incremented since settings.decimal_places
is now gone.
2014-07-06 19:07:30 -06:00
Sonny Jeon
87c5703200 Isolate atomic bit flag for execution.
- Denoted bit_true_atomic only for sys.execute bit settings. All other
bit_true type calls are for local variables only and don’t need atomic
access. Still looking into other ways of setting these flags without
requiring atomic access, but this is a patch for now.
2014-07-06 19:05:12 -06:00
Sonny Jeon
a20d3e9855 Merge pull request #436 from kfoltman/dev
Fixed atomic access to flags in sys.execute.
2014-07-06 18:21:01 -06:00
Sonny Jeon
145cea2dd0 Syntax fix for gcode.c
- Whoops! Missed a bracket and it wasn’t compiling. Now fixed.

- Updated the unsupported gcodes listed at the end of the gcode.c file.
2014-07-06 15:42:40 -06:00
Sonny Jeon
dab4535729 G43.1/G49 tool length offset installed. Minor bug fix.
- Minor bug fix that caused G92.1 not to work. The mantissa of G92.1
was not computed correctly due to floating point round-off errors and
the use of trunc(). Fixed it by changing the computation with round().

- Installed tool length offsets with G43.1 and G49! True tool length
offsets via G43 are not supported, because these require us to store
tool data that we don’t have space for. But we’ve come up with a good
solution for users that need this. Instead we are strictly using the
dynamic version G43.1 via linuxcnc.org. Visit their website for more
details on the command.

- G43.1 operates by requiring an axis word and value to offset the
configured tool length axis, which can be configured for any axis
(default Z-axis) in config.h. For example, ```G43.1 Z0.5``` will offset
the work coordinates from Z0.0 to Z-0.5.

- G49 will cancel the last tool length offset value and reset it to
zero.

- Tweaked the ‘$#’ parameters report. `Probe` is now `PRB` and a new
value `TLO` states the tool length offset value.
2014-07-06 15:20:20 -06:00
Sonny Jeon
57eb860089 Merge branch 'ashelly-sim-update' into dev 2014-07-05 10:10:53 -06:00
Sonny Jeon
21850ce985 Merge grbl-sim updates for v0.9.
- Removed some conflicting code in the main Grbl firmware source.

- Temporary patch for coolant and spindle control with streaming
applied.
2014-07-05 09:59:16 -06:00
Sonny Jeon
e455faaeef New G43.1/G49 gcodes. Not working yet!!
- Pushed this uncompleted code to merge a conflicting pull request.

- New G43.1 and G49 g-codes to be installed. The beginnings of it are
in place. These g-codes are intended to be used in conjunction with
probing and allow GUIs to set tool length offsets without Grbl needing
to store a tool table.

- G43.1 is defined as a dynamic tool length offset that is not stored
in memory. Rather, when commanded, these are applied to the work
coordinates until a reset or disabled by G49. This works much like G92.
2014-07-05 09:51:22 -06:00
ashelly
1b66c9c304 formatting 2014-07-05 00:12:43 -04:00
ashelly
aa95cb65bd Update readme.md 2014-07-05 00:11:42 -04:00
ashelly
df2fd6095b Don't need kbhit.h 2014-07-04 23:43:45 -04:00
Adam Shelly
82075627b3 minor tweaks for mingw. 2014-07-04 23:21:19 -04:00
Sonny Jeon
ed417220e1 Realtime rate reporting. Updated decimal places.
- Added a new optional compile-time feature for ‘realtime’ (within
50ms) feed rate reporting. When querying for a status report, a new
data value will state the current operating rate. It’s only beta at the
moment and has some kinks to work out.

- Updated the code for printing floating point values to N decimal
places. Generalized the main floating point print code to accept a new
decimal places value and created a set of handler functions to print
certain floating point value types used in Grbl, like position, rates,
coordinate offsets, etc. All of these have different decimal
requirements and change when printed in mm or inches mode.

- Number of decimal places for the different value types can be
re-defined in config.h, but there shouldn’t be a need for this, as
these are physically limited.

- Removed the decimal places settings, as this was now obsoleted by the
new decimal places code.

- The new decimal places code also saves almost 300kB in flash space,
as it’s more efficient.
2014-07-04 16:08:15 -06:00
ashelly
d3322ccded reduce diffs with dev branch 2014-07-04 16:43:52 -04:00
ashelly
8c9f3bca65 Total rework of simulator for dev branch. Create separate thread for interrupt processes. Tick-accurate simulation of timers. Non-blocking character input for running in realtime mode. Decouple hardware sim from grbl code as much as possible. Expanded command line options. Provisions for cross-platform solution. 2014-07-04 11:14:54 -04:00
Sonny Jeon
67a87b4678 Update README.md 2014-07-03 18:20:05 -06:00
Sonny Jeon
f4f7d7d05e G18 reporting bug fix.
- G18 wasn’t getting reported back to the user correctly, even though
it has been set internally. Fixed the reporting code to reflect this
accurately.
2014-07-03 18:16:47 -06:00
Sonny Jeon
92d6c2bca5 G-code parser G0/G1 bug fix.
- Although stated as invalid in the NIST g-code standard, most g-code
parsers, including linuxcnc, allow G0 and G1 to be commanded without
axis words present. For example, something like ‘G1 F100.0’ to preset
the motion mode and feed rate without a motion commanded. Older CNC
controllers actually required this for feed rate settings. This update
should now allow this type of behavior.
2014-07-03 18:13:39 -06:00
Sonny Jeon
1ef5a45479 Minor bug fixes and updates. Line number tracking.
- Line number tracking was getting truncated at 255, since it was using
wrong variable type. Fixed it with a trunc().

- Increased the max number line allowed by Grbl to 9999999 from the
g-code standard 99999. The latter seems to be an arbitrary number, so
we are allowing larger ones for at least one known use case scenario.

- Created a new test directory to contain some testing g-code to proof
the firmware. Only got started with one test case so far. More will be
inserted as needed.

- Some other commenting updates to clarify certain aspects of the code.
2014-07-02 08:39:19 -06:00
Krzysztof Foltman
015d5fa191 Fixed atomic access to flags in sys.execute.
This seems to fix the bug that caused Grbl to hang during some operations,
especially jogging.
2014-06-26 23:06:26 +01:00
Sonny Jeon
79e0e45826 Arc error-checking update.
- Updated offset-mode arc error-checking to EMC2’s version: The old
NIST definition required the radii to the current location and target
location to differ no more than 0.002mm. This proved to be problematic
and probably why LinuxCNC(EMC2) updated it to be 0.005mm AND 0.1%
radius OR 0.5mm.
2014-05-31 23:23:21 -06:00
Sonny Jeon
8ed8005f6c Various minor g-code parser fixes.
- Updated the mantissa calculation that checks for non-integer values
and GXX.X commands that aren’t supported. There was a potential uint8
overflow issue.

- Fixed g-code parser bug related to not using the correct modal
struct. G10 P0 not selecting the current coordinate system when a
G55-59 is issued in the same line.

- Fixed g-code parser bug related to not using the correct modal
struct. Target position locations were not computed correctly when
G90/91 distance modes were changed in the same line. It was using the
previous state, rather than the current block.
2014-05-31 21:58:59 -06:00
Sonny Jeon
9439e43975 Fixed spindle/coolant/dwell state check. 2014-05-29 15:41:53 -06:00
Sonny Jeon
532c359a11 Major g-code parser overhaul. 100%* compliant. Other related updates.
- Completely overhauled the g-code parser. It’s now 100%* compliant. (*
may have some bugs). Being compliant, here are some of the major
differences.

- SMALLER and JUST AS FAST! A number of optimizations were found that
sped things up and allowed for the more thorough error-checking to be
installed without a speed hit. Trimmed a lot of ‘fat’ in the parser and
still was able to make it significantly smaller than it was.

- No default feed rate setting! Removed completely! This doesn’t exist
in the g-code standard. So, it now errors out whenever it’s undefined
for motions that require it (G1/2/3/38.2).

- Any g-code parser error expunges the ENTIRE block. This means all
information is lost and not passed on to the running state. Before some
of the states would remain, which could have led to some problems.

- If the g-code block passes all of the error-checks, the g-code state
is updated and all motions are executed according to the order of
execution.

- Changes in spindle speed, when already running, will update the
output pin accordingly. This fixes a bug, where it wouldn’t update the
speed.

- Update g-code parser error reporting. Errors now return detailed
information of what exact went wrong. The most common errors return a
short text description. For less common errors, the parser reports
‘Invalid gcode ID:20’, where 20 is a error ID. A list of error code IDs
and their descriptions will be documented for user reference elsewhere
to save flash space.

- Other notable changes:

- Added a print integer routine for uint8 variables. This saved
significant flash space by switching from a heavier universal print
integer routine.

- Saved some flash space with our own short hypotenuse calculation

- Some arc computation flash and memory optimizations.
2014-05-25 16:05:28 -06:00
Jens Geisler
1922887c9b Merge pull request #408 from chamnit/master
MIT-Licensing change.
2014-05-18 21:13:14 +02:00
Sonny Jeon
dcb4f6fc1b MIT-licensing change. 2014-05-18 10:05:37 -06:00
Sonny Jeon
da92ddcb0b MIT-licensing change 2014-05-18 10:01:05 -06:00