Browse files

Merge bug fixes from recent v0.8c push. Added readme for Grbl Sim.

  • Loading branch information...
1 parent 8a1720e commit 97d18f0ffe76f7943b2b2cb907e3bcb12f910a89 @chamnit chamnit committed Jan 19, 2013
Showing with 17 additions and 3 deletions.
  1. +1 −0
  2. +1 −2 limits.c
  3. +2 −0 motion_control.c
  4. +2 −1 report.c
  5. +11 −0 sim/
@@ -16,6 +16,7 @@ Grbl includes full acceleration management with look ahead. That means the contr
- Acceleration independence: Each axes may be defined with different acceleration parameters and Grbl will automagically calculate the maximum acceleration through a path depending on the direction traveled. This is very useful for machine that have very different axes properties, like the ShapeOko z-axis.
- Maximum velocity independence: As with acceleration, the maximum velocity of individual axes may be defined. All seek/rapids motions will move at these maximum rates, but never exceed any one axes. So, when two or more axes move, the limiting axis will move at its maximum rate, while the other axes are scaled down.
- Significantly improved arc performance: Arcs are now defined in terms of chordal tolerance, rather than segment length. Chordal tolerance will automatically scale all arc line segments depending on arc radius, such that the error does not exceed the tolerance value (default: 0.005 mm.) So, for larger radii arcs, Grbl can move faster through them, because the segments are always longer and the planner has more distance to plan with.
+ - New Grbl SIMULATOR by @jgeisler: A completely independent wrapper of the Grbl main source code that may be compiled as an executable on a computer. No Arduino required. Simply simulates the responses of Grbl as if it was on an Arduino. May be used for many things: checking out how Grbl works, pre-process moves for GUI graphics, debugging of new features, etc. Much left to do, but potentially very powerful, as the dummy AVR variables can be written to output anything you need.
- Feedrate overrides: In the works, but planner has begun to be re-factored for this feature.
- Jogging controls: Methodology needs to be to figured out first. Last item on the agenda.
@@ -187,8 +187,7 @@ static void homing_cycle(uint8_t cycle_mask, int8_t pos_dir, bool invert_pin, fl
// Check if we are done or for system abort
- protocol_execute_runtime();
- if (!(cycle_mask) || sys.abort) { return; }
+ if (!(cycle_mask) || (sys.execute & EXEC_RESET)) { return; }
// Perform step.
@@ -226,6 +226,8 @@ void mc_go_home()
LIMIT_PCMSK &= ~LIMIT_MASK; // Disable hard limits pin change register for cycle duration
limits_go_home(); // Perform homing routine.
+ protocol_execute_runtime(); // Check for reset and set system abort.
if (sys.abort) { return; } // Did not complete. Alarm state set by mc_alarm.
// The machine should now be homed and machine zero has been located. Upon completion,
@@ -90,6 +90,7 @@ void report_alarm_message(int8_t alarm_code)
printPgmString(PSTR("Abort during cycle")); break;
printPgmString(PSTR(". MPos?\r\n"));
+ delay_ms(500); // Force delay to ensure message clears serial write buffer.
// Prints feedback messages. This serves as a centralized method to provide additional
@@ -326,7 +327,7 @@ void report_realtime_status()
print_position[i] -= gc.coord_system[i]+gc.coord_offset[i];
- if (i < N_AXIS-1) { printPgmString(PSTR(",")); }
+ if (i < (N_AXIS-1)) { printPgmString(PSTR(",")); }
@@ -0,0 +1,11 @@
+GRBL SIM : by Jens Geisler
+This directory contains an experimental Grbl simulator that compiles the main Grbl source code into a wrapped executable for use on a computer. No Arduino required. When the executable is run, the user should be able to interact with the Grbl simulator as if connected to an Arduino with Grbl.
+WARNING: Grbl Sim is under heavy development. So many things may not work, or respond in ways unexpected. At the moment, this code is a proof-of-concept.
+What can you do with Grbl Sim?
+- Simply checking out how Grbl works without needing an Arduino.
+- Visualize a g-code program by having the simulator parse and execute to a GUI. Fluctuations in feed rates by the acceleration planner can be viewed as well.
+- A powerful debugging tool for development.
+- Each of the AVR functions are replaced with dummy functions, like the stepper ISR. These could be written to whatever you need. For example, output simulated step pulses over time and examine its performance.

0 comments on commit 97d18f0

Please sign in to comment.