Commit Graph

337 Commits

Author SHA1 Message Date
Bertus Kruger
61f2bd1bc3 Update planner.c
Removed inline from all functions. 

If this is really needed is there another way that we can get 
around using it? (The Arduino IDE does not recognize it)
2013-03-13 18:41:52 +13:00
Bertus Kruger
f04489530a Update nuts_bolts.c
Removed __floatunsisf and used normal casting on line 81. 
This makes it compatible with the Arduino IDE.
2013-03-13 18:29:28 +13:00
Bertus Kruger
8e01fed143 Update gcode.c
Removed the home_select variable.
2013-03-13 10:19:42 +13:00
Bertus Kruger
5ecc661ec8 Update eeprom.h
Fixed the function signature.
2013-03-13 09:44:22 +13:00
Bertus Kruger
7bb20a7505 Update eeprom.c
Changed back
2013-03-13 09:43:04 +13:00
Bertus Kruger
058cf3f13a Update gcode.c
home_select defined out of scope. Moved it outside the switch 
so the rest of the switch can see it properly.
2013-03-12 19:08:44 +13:00
Bertus Kruger
d376f03bd0 Update eeprom.c
Function eeprom_put_char's parameters did not align with the .h file.
2013-03-12 19:01:17 +13:00
Sonny Jeon
b9bb0894b6 Merge pull request #169 from silasb/fix-execute-bit-on-files
Removing executable bit on the files
2013-01-18 18:15:37 -08:00
Silas Baronda
a5c2964a8f Removing executable bit on the files 2013-01-17 23:25:18 -05:00
Sonny Jeon
4f459e473b Fixed bug with homing and polling at the same time. Updated readme. 2013-01-06 12:32:41 -07:00
Sonny Jeon
e0f619b8c3 Readme link to edge build 2012-12-21 2012-12-21 09:55:43 -07:00
Sonny Jeon
c8b53b9d0a Slow trailing steps fix. Added more defaults.
- Fixed an issue (hopefully) with slow trailing steps after a
triangular velocity profile move. Sets the trapezoid tick cycle counter
to the correct value for an accurate reproduction of the deceleration
curve. Keeps it from arriving too early to the target position, which
causes the slow trailing steps.

- Added Zen Toolworks 7x7 to default settings.

- Updated readme with new edge build.
2012-12-16 17:06:38 -07:00
Sonny Jeon
e21d6a2fc4 Update README.md 2012-12-12 17:23:36 -07:00
Sonny Jeon
b4072a3a5e Changed README to markdown 2012-12-12 17:16:24 -07:00
Sonny Jeon
add7944811 Added download links to README. 2012-12-12 17:11:03 -07:00
Sonny Jeon
b297b8d788 Added builds folder.
Because the Downloads section has been removed, added a builds folder
for users to download pre-compiled firmware without needing to compile
it themselves.
2012-12-11 20:51:24 -07:00
Sonny Jeon
e4d8cf511e G28/G30 post move bug fix.
- Fixed a bug when after moving to a pre-defined position G28/G30, the
next move would go someplace unexpected. The g-code parser position
vector wasn't getting updated.
2012-11-25 11:08:38 -07:00
Sonny Jeon
ce45a348db Merge error fix. 2012-11-20 20:20:09 -07:00
Sonny Jeon
c712af23ab Merge v0.8 edge to master 2012-11-20 13:20:25 -07:00
Sonny Jeon
9e0ce55dbc Updated interface protocol. Fixed M2 bug.
- Updated interface protocol to play nicer with interface programs. All
Grbl responses beginning with '$' signifies a setting. Bracketed '[]'
responses are feedback messages containing either state, parameter, or
general messages. Chevron '<>' response are from the real-time status
messages, i.e. position.

- M2 Program end command was causing a system alarm. Fixed. Thanks
@blinkenlight !
2012-11-19 17:39:40 -07:00
Sonny Jeon
b3f5536530 Updated readme 2012-11-18 21:03:58 -07:00
Sonny Jeon
d85238cc9b Homing search sequence now compile-time option. New defaults.h file. Tidying up.
- The homing sequence is now a compile-time option, where a user can
choose which axes(s) move in sequence during the search phase. Up to 3
sequences. Works with the locating phase and the pull-off maneuver.

- New defaults.h file to store user generated default settings for
different machines. Mainly to be used as a central repo, but each set
may be select to be compiled in as a config.h define.
2012-11-18 19:52:16 -07:00
Sonny Jeon
5dd6d90122 Added Grbl state in status report. Removed switch support.
- Added Grbl state (Idle, Running, Queued, Hold, etc) to the real-time
status reporting feature as feedback to the user of what Grbl is doing.
Updated the help message to reflect this change.

- Removed switches (dry run, block delete, single block mode). To keep
Grbl simple and not muddled up from things that can easily be taken
care of by an external interface, these were removed.

- Check g-code mode was retained, but the command was moved to '$C'
from '$S0'.
2012-11-15 21:53:11 -07:00
Sonny Jeon
559feb97e2 Re-factored system states and alarm management. Serial baud support greater than 57600.
- Refactored system states to be more clear and concise. Alarm locks
processes when position is unknown to indicate to user something has
gone wrong.

- Changed mc_alarm to mc_reset, which now manages the system reset
function. Centralizes it.

- Renamed '$X' kill homing lock to kill alarm lock.

- Created an alarm error reporting method to clear up what is an alarm:
message vs a status error: message. For GUIs mainly. Alarm codes are
negative. Status codes are positive.

- Serial baud support upto 115200. Previous baudrate calc was unstable
for 57600 and above.

- Alarm state locks out all g-code blocks, including startup scripts,
but allows user to access settings and internal commands. For example,
to disable hard limits, if they are problematic.

- Hard limits do not respond in an alarm state.

- Fixed a problem with the hard limit interrupt during the homing
cycle. The interrupt register is still active during the homing cycle
and still signal the interrupt to trigger when re-enabled. Instead,
just disabled the register.

- Homing rate adjusted. All axes move at homing seek rate, regardless
of how many axes move at the same time. This is unlike how the stepper
module does it as a point to point rate.

- New config.h settings to disable the homing rate adjustment and the
force homing upon powerup.

- Reduced the number of startup lines back down to 2 from 3. This
discourages users from placing motion block in there, which can be very
dangerous.

- Startup blocks now run only after an alarm-free reset or after a
homing cycle. Does not run when $X kill is called. For satefy reasons
2012-11-14 17:36:29 -07:00
Sonny Jeon
e6ad15b548 Tweaks. Seek rate updates when set. CCW arc full circle fix.
- Fixed a minor issue where the seek rates would not immediately be
used and only would after a reset. Should update live now.

- A full circle IJ offset CCW arc would not do anything. Fixed bug via
a simple if-then statement.

- Radius mode tweaks to check for negative value in sqrt() rather than
isnan() it. Error report updated to indicate what actually happened.
2012-11-10 12:49:33 -07:00
Sonny Jeon
978de77c2f Added note that D13 can't be used as input, pulled-high. 2012-11-09 18:33:38 -07:00
Sonny Jeon
5844172af1 Fixed homing cycle hanging after locating switches. 2012-11-09 16:25:42 -07:00
Sonny Jeon
00fd09189d Housekeeping.
- Added some more notes to config.h.

- Added the ability to override some of the #defines around Grbl in
config.h, like planner buffer size, line buffer size, serial
send/receive buffers. Mainly to centralize the configurations to be
able to port to different microcontrollers later.
2012-11-08 19:23:47 -07:00
Sonny Jeon
baf137882b Sanguino compile patch
@daapp : Sanguino compile serial USART path. Thanks!
2012-11-08 17:24:56 -07:00
Sonny Jeon
5e7a4b3ba8 More tweaks. Removed dry run. Trimmed all messages to save flash space.
- Removed the dry run switch. It was getting overly complicated for
what it needed to do. In practice, single block mode and feed rate
overrides (coming in next release) does a much better job with dry runs
than 'dry run'.

- Trimmed all of Grbl's messages from help, status, feedback to
settings. Saved 0.6KB+ of flash space that could be used for v0.9
features.

- Removed some settings inits when set. Will depend on user to power
cycle to get some of these to reload.

- Fixed a bug with settings version not re-writing old settings, when
it should. Thanks Alden!
2012-11-07 20:53:03 -07:00
Sonny Jeon
e2e794af45 Merge pull request #132 from hin/header_dependencies
Header dependencies
2012-11-06 06:22:51 -08:00
Sonny Jeon
f41dd69273 Tweaks and bug fixes. Increase to 3 startup blocks. Remove purge/added unlock command
- Increased the number of startup blocks to 3 for no good reason other
than it doesn't increase the flash size.

- Removed the purge buffer command and replaced with an disable homing
lock command.

- Homing now blocks all g-code commands (not system commands) until the
homing cycle has been performed or the disable homing lock is sent.
Homing is required upon startup or if Grbl loses it position. This is
for safety reasons.

- Cleaned up some of the Grbl states and re-organized it to be little
more cohesive.

- Cleaned up the feedback and status messages to not use so much flash
space, as it's a premium now.

 - Check g-code and dry run switches how are mutually exclusive and
can't be enabled when the other is. And automatically resets Grbl when
disabled.

- Some bug fixes and other minor tweaks.
2012-11-05 21:40:52 -07:00
Hans Insulander
8a09e2c9c4 Ignore dependency files 2012-11-05 22:55:49 +01:00
Hans Insulander
b3b454ee77 Generate header dependencies and use them in Makefile 2012-11-05 22:54:53 +01:00
Sonny Jeon
c2b31a06ff Tweaked dry run and check g-code switches. Now resets when toggled off.
- To make managing the code easier and to help ensure a user starts
with a fresh reset, the functionality of check g-code and dry run has
been changed to automatically perform a soft reset when toggled off.
Position will not be lost, unless there is a cycle active. Feed hold
before toggling off it needed.

This is mainly a safety issue. If a user dry runs a program and kills
it mid-program, and then restarts it thinking to run it as normal, the
g-code modes that we're set may not be what they expect, and very bad
things can happen.

- NOTE: Grbl is at 83.5% of flash capacity. Not a lot of room left, but
I think we can squeeze in some more!
2012-11-05 13:32:29 -07:00
Sonny Jeon
9cabc915ef Runtime command pinned out! Re-organized coolant pins.
- Pinned out cycle start(A2), feed hold(A1), and reset(A0) runtime
commands. These pins are held high with the internal pull-up resistor
enabled. All you have to do is connect a normally-open switch to the
pin and ground. That's it.

- Moved the coolant control pins to A3 (and the optional mist control
to A4).

- Moved all of the MASK defines into the config.h file to centralize
them.
2012-11-04 10:48:57 -07:00
Sonny Jeon
8c0106c247 Tweaks and minor bug fixes. Added purge buffer command.
- Added a purge buffer (and lock) command. This is an advanced option
to clear any queued blocks in the buffer in the event of system
position being lost or homed. These queued blocks will likely not move
correctly if not purged. In typical use, the purging command releases
the homing axes lock in case a user need to move the axes off their
hard limit switches, but position is not guaranteed. Homing is advised
immediately after.

- Created a system-wide sync current position function. Cleans up some
of the repetitive tasks in various places in the code that do the same
thing.

- Removed the clear all switches command '$S'. Not really needed and
helped clean up a sync call.

- Other minor tweaks. Readme updated slightly..
2012-11-04 08:44:54 -07:00
Sonny Jeon
4c711a4af7 New startup script setting. New dry run, check gcode switches. New system state variable. Lots of reorganizing.
(All v0.8 features installed. Still likely buggy, but now thourough
testing will need to start to squash them all. As soon as we're done,
this will be pushed to master and v0.9 development will be started.
Please report ANY issues to us so we can get this rolled out ASAP.)

- User startup script! A user can now save one (up to 5 as compile-time
option) block of g-code in EEPROM memory. This will be run everytime
Grbl resets. Mainly to be used as a way to set your preferences, like
G21, G54, etc.

- New dry run and check g-code switches. Dry run moves ALL motions at
rapids rate ignoring spindle, coolant, and dwell commands. For rapid
physical proofing of your code. The check g-code switch ignores all
motion and provides the user a way to check if there are any errors in
their program that Grbl may not like.

- Program restart! (sort of). Program restart is typically an advanced
feature that allows users to restart a program mid-stream. The check
g-code switch can perform this feature by enabling the switch at the
start of the program, and disabling it at the desired point with some
minimal changes.

- New system state variable. This state variable tracks all of the
different state processes that Grbl performs, i.e. cycle start, feed
hold, homing, etc. This is mainly for making managing of these task
easier and more clear.

- Position lost state variable. Only when homing is enabled, Grbl will
refuse to move until homing is completed and position is known. This is
mainly for safety. Otherwise, it will let users fend for themselves.

- Moved the default settings defines into config.h. The plan is to
eventually create a set of config.h's for particular as-built machines
to help users from doing it themselves.

- Moved around misc defines into .h files. And lots of other little
things.
2012-11-03 11:32:23 -06:00
Sonny Jeon
303cf59f52 Added block delete, opt stop, single block mode. New parser state and parameter feedback. Overhauled '$' command.
NOTE: Another incremental update. Likely buggy, still a ways to go
before everything is installed, such as startup blocks.

- Changed the '$' command to print help. '$$' now prints Grbl settings.
The help now instructs the user of runtime commands, switch toggling,
homing, etc. Jogging will be added to these in v0.9.

- Added switches: block delete, opt stop, and single block mode.

- Now can print the g-code parser state and persistent parameters
(coord sys) to view what Grbl has internally.

- Made the gc struct in the g-code parser global to be able to print
the states. Also moved coordinate system tracking from sys to gc struct.

- Changed up the welcome flag and updated version to v0.8c.

- Removed spindle speed from gcode parser. Not used.
2012-11-01 19:48:55 -06:00
Sonny Jeon
e0a9054e32 New report module. 6 persistent work coordinates. New G-codes and settings. README and minor bug updates
(NOTE: This push is likely buggy so proceed with caution. Just
uploading to let people know where we're going.)

- New report.c module. Moved all feedback functions into this module to
centralize these processes. Includes realtime status reports, status
messages, feedback messages.

- Official support 6 work coordinate systems (G54-G59), which are
persistently held in EEPROM memory.

- New g-code support: G28.1, G30.1 stores current machine position as a
home position into EEPROM. G10 L20 Px stores current machine position
into work coordinates without needing to explicitly send XYZ words.

- Homing performed with '$H' command. G28/G30 no longer start the
homing cycle. This is how it's supposed to be.

- New settings: Stepper enable invert and n_arc correction installed.

- Updated and changed up some limits and homing functionality. Pull-off
travel will now move after the homing cycle regardless of hard limits
enabled. Fixed direction of pull-off travel (went wrong way).

- Started on designing an internal Grbl command protocol based on the
'$' settings letter. Commands with non numeric characters after '$'
will perform switch commands, homing cycle, jogging, printing
paramters, etc. Much more to do here.

- Updated README to reflect all of the new features.
2012-11-01 09:37:27 -06:00
Sonny Jeon
5d8c3dcbd7 Added misc message to indicate how to exit ALARM mode. 2012-10-21 19:29:18 -06:00
Sonny Jeon
065ceceb34 New alarm method. Re(re)organized status messages.
- Installed a new 'alarm' method to centralize motion kills across
alarm or reset events. Right now, this is controlled by system abort
and hard limits. But, in the future, a g-code parser error may call
this too as a safety feature.

- Re(re)organized status messages to just print all errors, regardless
from where it was called. This centralizes them into one place.

- Misc messages method installed for any user feedback that is not a
confirmation or error. Mainly so that there is a place to perform
warnings and such.

- New stuff installed and still made the flash size smaller by saving
flash space from clearing out repeated '\r\n' pgmstrings.

- Fixed a bug where hard limits message would print everytime a system
abort was sent.
2012-10-21 19:18:24 -06:00
Sonny Jeon
909feb7f79 Re-organized status messages to be more coherent and centralized.
- Reorganized all of the status message feedback from both the g-code
parser and settings modules to be centralized into two message modules:
status feedback from executing a line and warnings for misc feedback.

- Pulled out the printPgmString() messages in settings.c and placed it
into the new module. (settings_dump() not moved).

- Some other minor edits. Renaming defines, comment updates, etc.
2012-10-21 16:55:59 -06:00
Sonny Jeon
39e11b696f Hard limits code minor updates.
- Fixed a bug that would not disable the steppers if a user issues a
system abort during a homing cycle.

- Updated the hard limit interrupt to be more correct and to issue a
shutdown for the right situations when the switch has been triggered.

- Added a status message to indicate to the user what happened and what
to do upon a hard limit trigger.
2012-10-18 21:29:07 -06:00
Sonny Jeon
df5bb70b25 Hard limits, homing direction, pull-off limits after homing, status reports in mm or inches, system alarm, and more.
- Thank you statement added for Alden Hart of Synthetos.

- Hard limits option added, which also works with homing by pulling off
the switches to help prevent unintended triggering. Hard limits use a
interrupt to sense a falling edge pin change and immediately go into
alarm mode, which stops everything and forces the user to issue a reset
(Ctrl-x) or reboot.

- Auto cycle start now a configuration option.

- Alarm mode: A new method to kill all Grbl processes in the event of
something catastrophic or potentially catastropic. Just works with hard
limits for now, but will be expanded to include g-code errors (most
likely) and other events.

- Updated status reports to be configurable in inches or mm mode. Much
more to do here, but this is the first step.

- New settings: auto cycle start, hard limit enable, homing direction
mask (which works the same as the stepper mask), homing pulloff
distance (or distance traveled from homed machine zero to prevent
accidental limit trip).

- Minor memory liberation and calculation speed ups.
2012-10-16 21:29:45 -06:00
Sonny Jeon
34f6d2eb4b Minor updates, improvements, and bug fixes.
- Allowed status_message function to be called by others. This is to
centralize all feedback into protocol.c.

- Fixed a bug where line number words 'N' were causing the parser to
error out.

- Allowed homing routine feed rates to move slower than the
MINIMUM_STEP_RATE parameter in config.h.

- Homing performs idle lock at the end of the routine.

- Stepper idle lock time will now not disable the steppers when the
value is set at 255. This is accomodate users who prefer to keep their
axes enabled at all times.

- Moved some defines around to where they need to be.
2012-10-13 13:11:43 -06:00
Sonny Jeon
00701ff24e Updated delay_us() function to accept long integers 2012-10-12 08:27:14 -06:00
Sonny Jeon
9b4e108905 (2x) speed increase in printFloat() function. Decimal places setting added.
- printFloat() function execution doubled in speed. This is a precursor
to status reporting, since GUIs may query real-time position rapidly.

- Decimal places added to settings (for now). This may disappear in
future pushes, but here for testing purposes.
2012-10-11 22:43:54 -06:00
Sonny Jeon
d8ca4176bf Homing stepper enable bit fix. 2012-10-11 00:06:52 -06:00
Sonny Jeon
32963289fe Homing direction pin bits fixed. Lite refactoring of settings. 2012-10-10 18:01:43 -06:00