Skip to content

Commit b9c3461

Browse files
committed
Bug fixes.
- G38.x was not printing correctly in the $G g-code state reports. Now fixed. - When investigating the above issue, it was noticed that G38.x wouldn’t show at all, but instead a G0 would be printed. This was unlike the v0.9j master build. It turned out volatile variables do not like to be defined inside a C struct. These are undefined on how to be handled. Once pulled out, all weird issues went away. - Also changed two ‘sizeof()’ statements in the mc_probe() and probe_state_monitor() functions to be more robust later on. - Updated the commit logs to individual files for each minor release. Forgot to update the generating script to account for this.
2 parents dade712 + d226555 commit b9c3461

15 files changed

Lines changed: 183 additions & 142 deletions

doc/log/commit_log_v0.9i.txt

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,3 @@
1-
----------------
2-
Date: 2015-09-05
3-
Author: Sonny Jeon
4-
Subject: Parking motion bug fix.
5-
6-
- Parking motion would intermittently complete the queued tool path
7-
upon resuming in certain scenarios. Now fixed.
8-
9-
10-
----------------
11-
Date: 2015-08-29
12-
Author: Sonny Jeon
13-
Subject: Optional line number reporting bug fix.
14-
15-
- Fixed a bug where it would not compile when USE_LINE_NUMBERS was
16-
enabled.
17-
18-
19-
----------------
20-
Date: 2015-08-27
21-
Author: Sonny Jeon
22-
Subject: Update README
23-
24-
25-
----------------
26-
Date: 2015-08-27
27-
Author: Sonny Jeon
28-
Subject: v1.0 Beta Release.
29-
30-
- Tons of new stuff in this release, which is fairly stable and well
31-
tested. However, much more is coming soon!
32-
33-
- Real-time parking motion with safety door. When this compile option
34-
is enabled, an opened safety door will cause Grbl to automatically feed
35-
hold, retract, de-energize the spindle/coolant, and parks near Z max.
36-
After the door is closed and resume is commanded, this reverses and the
37-
program continues as if nothing happened. This is also highly
38-
configurable. See config.h for details.
39-
40-
- New spindle max and min rpm ‘$’ settings! This has been requested
41-
often. Grbl will output 5V when commanded to turn on the spindle at its
42-
max rpm, and 0.02V with min rpm. The voltage and the rpm range are
43-
linear to each other. This should help users tweak their settings to
44-
get close to true rpm’s.
45-
46-
- If the new max rpm ‘$’ setting is set = 0 or less than min rpm, the
47-
spindle speed PWM pin will act like a regular on/off spindle enable
48-
pin. On pin D11.
49-
50-
- BEWARE: Your old EEPROM settings will be wiped! The new spindle rpm
51-
settings require a new settings version, so Grbl will automatically
52-
wipe and restore the EEPROM with the new defaults.
53-
54-
- Control pin can now be inverted individually with a
55-
CONTROL_INVERT_MASK in the cpu_map header file. Not typical for users
56-
to need this, but handy to have.
57-
58-
- Fixed bug when Grbl receive too many characters in a line and
59-
overflows. Previously it would respond with an error per overflow
60-
character and another acknowledge upon an EOL character. This broke the
61-
streaming protocol. Now fixed to only respond with an error after an
62-
EOL character.
63-
64-
- Fixed a bug with the safety door during an ALARM mode. You now can’t
65-
home or unlock the axes until the safety door has been closed. This is
66-
for safety reasons (obviously.)
67-
68-
- Tweaked some the Mega2560 cpu_map settings . Increased segment buffer
69-
size and fixed the spindle PWM settings to output at a higher PWM
70-
frequency.
71-
72-
- Generalized the delay function used by G4 delay for use by parking
73-
motion. Allows non-blocking status reports and real-time control during
74-
re-energizing of the spindle and coolant.
75-
76-
- Added spindle rpm max and min defaults to default.h files.
77-
78-
- Added a new print float for rpm values.
79-
80-
811
----------------
822
Date: 2015-08-14
833
Author: Sonny Jeon

doc/log/commit_log_v0.9j.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
----------------
2+
Date: 2015-08-14
3+
Author: Sonny Jeon
4+
Subject: Individual control pin invert compile-option.
5+
6+
- Control pins may be individually inverted through a
7+
CONTROL_INVERT_MASK macro. This mask is define in the cpu_map.h file.
8+
9+
10+
----------------
11+
Date: 2015-07-17
12+
Author: Sonny Jeon
13+
Subject: Version bump to v0.9j
14+
15+
- Version bump requested by OEMs to easily determine whether the
16+
firmware supports the new EEPROM reset feature. Other than that, no
17+
significant changes.

doc/log/commit_log_v1.0b.txt

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
----------------
2+
Date: 2015-09-24
3+
Author: Sonny Jeon
4+
Subject: Updated G28/G30 intermediate motion behavior.
5+
6+
- G28 and G30’s behavior has been updated from the old NIST g-code
7+
standard to LinuxCNC’s. Previously when an intermediate motion was
8+
programmed, the NIST standard would move all axes to the final G28/30
9+
stored coordinates. LinuxCNC states it only moves the axes specified in
10+
the command.
11+
12+
For example, suppose G28’s stored position is (x,y,z) = (1,2,3) for
13+
simplicity, and we want to do an automated z-axis tool retraction and
14+
then park at the x,y location. `G28 G91 Z5` will first move the Z axis
15+
5mm(or inches) up, then move Z to position 3 in machine coordinates.
16+
Next, the command `G28 G91 X0 Y0` would skip the intermediate move
17+
since distance is zero, but then move only the x and y axes to machine
18+
coordinates 1 and 2, respectively. The z-axis wouldn’t move in this
19+
case, since it wasn’t specified.
20+
21+
This change is intended to make Grbl more LinuxCNC compatible while
22+
making commands, like the shown tool retraction, much easier to
23+
implement.
24+
25+
26+
----------------
27+
Date: 2015-09-05
28+
Author: Sonny Jeon
29+
Subject: Parking motion bug fix.
30+
31+
- Parking motion would intermittently complete the queued tool path
32+
upon resuming in certain scenarios. Now fixed.
33+
34+
35+
----------------
36+
Date: 2015-08-29
37+
Author: Sonny Jeon
38+
Subject: Optional line number reporting bug fix.
39+
40+
- Fixed a bug where it would not compile when USE_LINE_NUMBERS was
41+
enabled.
42+
43+
44+
----------------
45+
Date: 2015-08-27
46+
Author: Sonny Jeon
47+
Subject: Update README
48+
49+
50+
----------------
51+
Date: 2015-08-27
52+
Author: Sonny Jeon
53+
Subject: v1.0 Beta Release.
54+
55+
- Tons of new stuff in this release, which is fairly stable and well
56+
tested. However, much more is coming soon!
57+
58+
- Real-time parking motion with safety door. When this compile option
59+
is enabled, an opened safety door will cause Grbl to automatically feed
60+
hold, retract, de-energize the spindle/coolant, and parks near Z max.
61+
After the door is closed and resume is commanded, this reverses and the
62+
program continues as if nothing happened. This is also highly
63+
configurable. See config.h for details.
64+
65+
- New spindle max and min rpm ‘$’ settings! This has been requested
66+
often. Grbl will output 5V when commanded to turn on the spindle at its
67+
max rpm, and 0.02V with min rpm. The voltage and the rpm range are
68+
linear to each other. This should help users tweak their settings to
69+
get close to true rpm’s.
70+
71+
- If the new max rpm ‘$’ setting is set = 0 or less than min rpm, the
72+
spindle speed PWM pin will act like a regular on/off spindle enable
73+
pin. On pin D11.
74+
75+
- BEWARE: Your old EEPROM settings will be wiped! The new spindle rpm
76+
settings require a new settings version, so Grbl will automatically
77+
wipe and restore the EEPROM with the new defaults.
78+
79+
- Control pin can now be inverted individually with a
80+
CONTROL_INVERT_MASK in the cpu_map header file. Not typical for users
81+
to need this, but handy to have.
82+
83+
- Fixed bug when Grbl receive too many characters in a line and
84+
overflows. Previously it would respond with an error per overflow
85+
character and another acknowledge upon an EOL character. This broke the
86+
streaming protocol. Now fixed to only respond with an error after an
87+
EOL character.
88+
89+
- Fixed a bug with the safety door during an ALARM mode. You now can’t
90+
home or unlock the axes until the safety door has been closed. This is
91+
for safety reasons (obviously.)
92+
93+
- Tweaked some the Mega2560 cpu_map settings . Increased segment buffer
94+
size and fixed the spindle PWM settings to output at a higher PWM
95+
frequency.
96+
97+
- Generalized the delay function used by G4 delay for use by parking
98+
motion. Allows non-blocking status reports and real-time control during
99+
re-energizing of the spindle and coolant.
100+
101+
- Added spindle rpm max and min defaults to default.h files.
102+
103+
- Added a new print float for rpm values.
104+

grbl/gcode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ uint8_t gc_execute_line(char *line)
10441044
protocol_buffer_synchronize(); // Sync and finish all remaining buffered motions before moving on.
10451045
if (gc_state.modal.program_flow == PROGRAM_FLOW_PAUSED) {
10461046
if (sys.state != STATE_CHECK_MODE) {
1047-
bit_true_atomic(sys.rt_exec_state, EXEC_FEED_HOLD); // Use feed hold for program pause.
1047+
bit_true_atomic(sys_rt_exec_state, EXEC_FEED_HOLD); // Use feed hold for program pause.
10481048
protocol_execute_realtime(); // Execute suspend.
10491049
}
10501050
} else { // == PROGRAM_FLOW_COMPLETED

grbl/grbl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
// Grbl versioning system
2525
#define GRBL_VERSION "1.0b"
26-
#define GRBL_VERSION_BUILD "20150924"
26+
#define GRBL_VERSION_BUILD "20150930"
2727

2828
// Define standard libraries used by Grbl.
2929
#include <avr/io.h>

grbl/limits.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,16 @@ uint8_t limits_get_state()
101101
// locked out until a homing cycle or a kill lock command. Allows the user to disable the hard
102102
// limit setting if their limits are constantly triggering after a reset and move their axes.
103103
if (sys.state != STATE_ALARM) {
104-
if (!(sys.rt_exec_alarm)) {
104+
if (!(sys_rt_exec_alarm)) {
105105
#ifdef HARD_LIMIT_FORCE_STATE_CHECK
106106
// Check limit pin state.
107107
if (limits_get_state()) {
108108
mc_reset(); // Initiate system kill.
109-
bit_true_atomic(sys.rt_exec_alarm, (EXEC_ALARM_HARD_LIMIT|EXEC_CRITICAL_EVENT)); // Indicate hard limit critical event
109+
bit_true_atomic(sys_rt_exec_alarm, (EXEC_ALARM_HARD_LIMIT|EXEC_CRITICAL_EVENT)); // Indicate hard limit critical event
110110
}
111111
#else
112112
mc_reset(); // Initiate system kill.
113-
bit_true_atomic(sys.rt_exec_alarm, (EXEC_ALARM_HARD_LIMIT|EXEC_CRITICAL_EVENT)); // Indicate hard limit critical event
113+
bit_true_atomic(sys_rt_exec_alarm, (EXEC_ALARM_HARD_LIMIT|EXEC_CRITICAL_EVENT)); // Indicate hard limit critical event
114114
#endif
115115
}
116116
}
@@ -122,11 +122,11 @@ uint8_t limits_get_state()
122122
{
123123
WDTCSR &= ~(1<<WDIE); // Disable watchdog timer.
124124
if (sys.state != STATE_ALARM) { // Ignore if already in alarm state.
125-
if (!(sys.rt_exec_alarm)) {
125+
if (!(sys_rt_exec_alarm)) {
126126
// Check limit pin state.
127127
if (limits_get_state()) {
128128
mc_reset(); // Initiate system kill.
129-
bit_true_atomic(sys.rt_exec_alarm, (EXEC_ALARM_HARD_LIMIT|EXEC_CRITICAL_EVENT)); // Indicate hard limit critical event
129+
bit_true_atomic(sys_rt_exec_alarm, (EXEC_ALARM_HARD_LIMIT|EXEC_CRITICAL_EVENT)); // Indicate hard limit critical event
130130
}
131131
}
132132
}
@@ -225,17 +225,17 @@ void limits_go_home(uint8_t cycle_mask)
225225
st_prep_buffer(); // Check and prep segment buffer. NOTE: Should take no longer than 200us.
226226

227227
// Exit routines: No time to run protocol_execute_realtime() in this loop.
228-
if (sys.rt_exec_state & (EXEC_SAFETY_DOOR | EXEC_RESET | EXEC_CYCLE_STOP)) {
228+
if (sys_rt_exec_state & (EXEC_SAFETY_DOOR | EXEC_RESET | EXEC_CYCLE_STOP)) {
229229
// Homing failure: Limit switches are still engaged after pull-off motion
230-
if ( (sys.rt_exec_state & (EXEC_SAFETY_DOOR | EXEC_RESET)) || // Safety door or reset issued
230+
if ( (sys_rt_exec_state & (EXEC_SAFETY_DOOR | EXEC_RESET)) || // Safety door or reset issued
231231
(!approach && (limits_get_state() & cycle_mask)) || // Limit switch still engaged after pull-off motion
232-
( approach && (sys.rt_exec_state & EXEC_CYCLE_STOP)) ) { // Limit switch not found during approach.
232+
( approach && (sys_rt_exec_state & EXEC_CYCLE_STOP)) ) { // Limit switch not found during approach.
233233
mc_reset(); // Stop motors, if they are running.
234234
protocol_execute_realtime();
235235
return;
236236
} else {
237237
// Pull-off motion complete. Disable CYCLE_STOP from executing.
238-
bit_false_atomic(sys.rt_exec_state,EXEC_CYCLE_STOP);
238+
bit_false_atomic(sys_rt_exec_state,EXEC_CYCLE_STOP);
239239
break;
240240
}
241241
}
@@ -335,15 +335,15 @@ void limits_soft_check(float *target)
335335
// workspace volume so just come to a controlled stop so position is not lost. When complete
336336
// enter alarm mode.
337337
if (sys.state == STATE_CYCLE) {
338-
bit_true_atomic(sys.rt_exec_state, EXEC_FEED_HOLD);
338+
bit_true_atomic(sys_rt_exec_state, EXEC_FEED_HOLD);
339339
do {
340340
protocol_execute_realtime();
341341
if (sys.abort) { return; }
342342
} while ( sys.state != STATE_IDLE );
343343
}
344344

345345
mc_reset(); // Issue system reset and ensure spindle and coolant are shutdown.
346-
bit_true_atomic(sys.rt_exec_alarm, (EXEC_ALARM_SOFT_LIMIT|EXEC_CRITICAL_EVENT)); // Indicate soft limit critical event
346+
bit_true_atomic(sys_rt_exec_alarm, (EXEC_ALARM_SOFT_LIMIT|EXEC_CRITICAL_EVENT)); // Indicate soft limit critical event
347347
protocol_execute_realtime(); // Execute to enter critical event loop and system abort
348348
return;
349349
}

grbl/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ int main(void)
7777

7878
// Reset system variables.
7979
sys.abort = false;
80-
sys.rt_exec_state = 0;
81-
sys.rt_exec_alarm = 0;
80+
sys_rt_exec_state = 0;
81+
sys_rt_exec_alarm = 0;
8282
sys.suspend = false;
8383

8484
// Start Grbl main loop. Processes program inputs and executes them.

grbl/motion_control.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void mc_homing_cycle()
220220
#ifdef LIMITS_TWO_SWITCHES_ON_AXES
221221
if (limits_get_state()) {
222222
mc_reset(); // Issue system reset and ensure spindle and coolant are shutdown.
223-
bit_true_atomic(sys.rt_exec_alarm, (EXEC_ALARM_HARD_LIMIT|EXEC_CRITICAL_EVENT));
223+
bit_true_atomic(sys_rt_exec_alarm, (EXEC_ALARM_HARD_LIMIT|EXEC_CRITICAL_EVENT));
224224
return;
225225
}
226226
#endif
@@ -276,7 +276,7 @@ void mc_homing_cycle()
276276
// After syncing, check if probe is already triggered. If so, halt and issue alarm.
277277
// NOTE: This probe initialization error applies to all probing cycles.
278278
if ( probe_get_state() ) { // Check probe pin state.
279-
bit_true_atomic(sys.rt_exec_alarm, EXEC_ALARM_PROBE_FAIL);
279+
bit_true_atomic(sys_rt_exec_alarm, EXEC_ALARM_PROBE_FAIL);
280280
protocol_execute_realtime();
281281
}
282282
if (sys.abort) { return; } // Return if system reset has been issued.
@@ -289,10 +289,10 @@ void mc_homing_cycle()
289289
#endif
290290

291291
// Activate the probing state monitor in the stepper module.
292-
sys.probe_state = PROBE_ACTIVE;
292+
sys_probe_state = PROBE_ACTIVE;
293293

294294
// Perform probing cycle. Wait here until probe is triggered or motion completes.
295-
bit_true_atomic(sys.rt_exec_state, EXEC_CYCLE_START);
295+
bit_true_atomic(sys_rt_exec_state, EXEC_CYCLE_START);
296296
do {
297297
protocol_execute_realtime();
298298
if (sys.abort) { return; } // Check for system abort
@@ -301,13 +301,13 @@ void mc_homing_cycle()
301301
// Probing cycle complete!
302302

303303
// Set state variables and error out, if the probe failed and cycle with error is enabled.
304-
if (sys.probe_state == PROBE_ACTIVE) {
305-
if (is_no_error) { memcpy(sys.probe_position, sys.position, sizeof(float)*N_AXIS); }
306-
else { bit_true_atomic(sys.rt_exec_alarm, EXEC_ALARM_PROBE_FAIL); }
304+
if (sys_probe_state == PROBE_ACTIVE) {
305+
if (is_no_error) { memcpy(sys.probe_position, sys.position, sizeof(sys.position)); }
306+
else { bit_true_atomic(sys_rt_exec_alarm, EXEC_ALARM_PROBE_FAIL); }
307307
} else {
308308
sys.probe_succeeded = true; // Indicate to system the probing cycle completed successfully.
309309
}
310-
sys.probe_state = PROBE_OFF; // Ensure probe state monitor is disabled.
310+
sys_probe_state = PROBE_OFF; // Ensure probe state monitor is disabled.
311311
protocol_execute_realtime(); // Check and execute run-time commands
312312
if (sys.abort) { return; } // Check for system abort
313313

@@ -365,8 +365,8 @@ void mc_parking_motion(float *parking_target, float feed_rate)
365365
void mc_reset()
366366
{
367367
// Only this function can set the system reset. Helps prevent multiple kill calls.
368-
if (bit_isfalse(sys.rt_exec_state, EXEC_RESET)) {
369-
bit_true_atomic(sys.rt_exec_state, EXEC_RESET);
368+
if (bit_isfalse(sys_rt_exec_state, EXEC_RESET)) {
369+
bit_true_atomic(sys_rt_exec_state, EXEC_RESET);
370370

371371
// Kill spindle and coolant.
372372
spindle_stop();
@@ -378,8 +378,8 @@ void mc_reset()
378378
// violated, by which, all bets are off.
379379
if ((sys.state & (STATE_CYCLE | STATE_HOMING)) ||
380380
(sys.step_control & (STEP_CONTROL_EXECUTE_HOLD | STEP_CONTROL_EXECUTE_PARK))) {
381-
if (sys.state == STATE_HOMING) { bit_true_atomic(sys.rt_exec_alarm, EXEC_ALARM_HOMING_FAIL); }
382-
else { bit_true_atomic(sys.rt_exec_alarm, EXEC_ALARM_ABORT_CYCLE); }
381+
if (sys.state == STATE_HOMING) { bit_true_atomic(sys_rt_exec_alarm, EXEC_ALARM_HOMING_FAIL); }
382+
else { bit_true_atomic(sys_rt_exec_alarm, EXEC_ALARM_ABORT_CYCLE); }
383383
st_go_idle(); // Force kill steppers. Position has likely been lost.
384384
}
385385
}

grbl/probe.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ uint8_t probe_get_state() { return((PROBE_PIN & PROBE_MASK) ^ probe_invert_mask)
5858
// NOTE: This function must be extremely efficient as to not bog down the stepper ISR.
5959
void probe_state_monitor()
6060
{
61-
if (sys.probe_state == PROBE_ACTIVE) {
61+
if (sys_probe_state == PROBE_ACTIVE) {
6262
if (probe_get_state()) {
63-
sys.probe_state = PROBE_OFF;
64-
memcpy(sys.probe_position, sys.position, sizeof(float)*N_AXIS);
65-
bit_true(sys.rt_exec_state, EXEC_MOTION_CANCEL);
63+
sys_probe_state = PROBE_OFF;
64+
memcpy(sys.probe_position, sys.position, sizeof(sys.position));
65+
bit_true(sys_rt_exec_state, EXEC_MOTION_CANCEL);
6666
}
6767
}
6868
}

0 commit comments

Comments
 (0)