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

This commit is contained in:
Sonny Jeon 2013-01-18 17:02:44 -07:00
parent 8a1720e1a1
commit 97d18f0ffe
5 changed files with 17 additions and 3 deletions

View File

@ -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. - 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. - 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. - 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. - 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. - Jogging controls: Methodology needs to be to figured out first. Last item on the agenda.

View File

@ -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 // Check if we are done or for system abort
protocol_execute_runtime(); if (!(cycle_mask) || (sys.execute & EXEC_RESET)) { return; }
if (!(cycle_mask) || sys.abort) { return; }
// Perform step. // Perform step.
STEPPING_PORT = (STEPPING_PORT & ~STEP_MASK) | (out_bits & STEP_MASK); STEPPING_PORT = (STEPPING_PORT & ~STEP_MASK) | (out_bits & STEP_MASK);

View File

@ -226,6 +226,8 @@ void mc_go_home()
LIMIT_PCMSK &= ~LIMIT_MASK; // Disable hard limits pin change register for cycle duration LIMIT_PCMSK &= ~LIMIT_MASK; // Disable hard limits pin change register for cycle duration
limits_go_home(); // Perform homing routine. 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. 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, // The machine should now be homed and machine zero has been located. Upon completion,

View File

@ -90,6 +90,7 @@ void report_alarm_message(int8_t alarm_code)
printPgmString(PSTR("Abort during cycle")); break; printPgmString(PSTR("Abort during cycle")); break;
} }
printPgmString(PSTR(". MPos?\r\n")); 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 // 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]; print_position[i] -= gc.coord_system[i]+gc.coord_offset[i];
} }
printFloat(print_position[i]); printFloat(print_position[i]);
if (i < N_AXIS-1) { printPgmString(PSTR(",")); } if (i < (N_AXIS-1)) { printPgmString(PSTR(",")); }
} }
printPgmString(PSTR(">\r\n")); printPgmString(PSTR(">\r\n"));

11
sim/README.md Normal file
View File

@ -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.