Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update text header in grblUpload.ino #1474

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b3a53a4
v1.0 Beta Release.
chamnit Aug 28, 2015
9152d14
Update README
chamnit Aug 28, 2015
9575199
Optional line number reporting bug fix.
chamnit Aug 29, 2015
965e337
Parking motion bug fix.
chamnit Sep 5, 2015
dade712
Updated G28/G30 intermediate motion behavior.
chamnit Sep 24, 2015
b9c3461
Bug fixes.
chamnit Oct 1, 2015
5eee108
Pin state reporting of all pins. Flash optimization.
chamnit Nov 10, 2015
111d28d
Applied master branch bug fixes.
chamnit Mar 4, 2016
81adc20
Soft limit error bug fix.
chamnit Mar 11, 2016
5bfc3a1
No variable spindle and spindle speed fix.
Mar 19, 2016
ff5f8da
Update README
Mar 19, 2016
061e609
Removed 328p-related code. Enabled options by default.
chamnit Mar 20, 2016
b29b960
EEPROM string checks and re-added some compile options.
Mar 20, 2016
8693534
Sleep feature. General re-org and bug fixes.
Apr 4, 2016
e87f4ea
Update readme and sleep documentation.
chamnit Apr 4, 2016
d5decf8
Alarm and safety door bug fix.
Apr 10, 2016
2b82c42
Planner and printFloat update.
May 11, 2016
be5faf6
Minor bug fix to certain safety conditions.
Sep 1, 2016
5e3048f
Grbl v1.1e port to Mega2560 branch
chamnit Dec 19, 2016
e4dd12f
Spindle PWM update for Mega2560
chamnit Dec 20, 2016
c912b82
Alarm handling bug fix.
chamnit Dec 20, 2016
795d2f6
Pulled in Grbl-328p changes.
chamnit Jan 14, 2017
dd2f156
Update README.md
chamnit Mar 19, 2017
9e96e45
Update README.md
chamnit Mar 19, 2017
e0efa4b
Moved Grbl logo files to separate repo.
chamnit Mar 19, 2017
759ff61
Add Ramps 1.4 Board Support
docwelch Jun 27, 2017
4b8e411
Syncing mainstream v1.1f
chamnit Jul 18, 2017
e16b5fb
Merge branch 'edge' into Ramps-1.4
chamnit Jul 18, 2017
576a72c
Merge pull request #28 from docwelch/Ramps-1.4
chamnit Jul 18, 2017
e321c82
Fixed RAMPS control pin conflict
chamnit Aug 1, 2017
40fd602
Fixed a very rare but critical bug when reducing override rates.
chamnit Aug 2, 2017
68d9152
fixes gremlin where changing stepper direction mask didn't work corre…
bgort Aug 10, 2018
a311e2d
Merge pull request #68 from bgort/gremlinfix
chamnit Aug 10, 2018
0f15e66
Upstream updates. Spindle/coolant rare bug fixes.
chamnit Aug 13, 2018
bc05282
Merge branch 'edge' of https://github.com/gnea/grbl-Mega into edge
chamnit Aug 13, 2018
df87b36
Updated version.
chamnit Aug 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Planner and printFloat update.
- Planner model update. Improves performance for machines with
different accelerations on each axes. Particularly for 3D carving.

- Print float update to print 13 (from 10) characters. Help reduce
print errors for unusually long floating point values.
  • Loading branch information
chamnit authored and chamnit committed May 11, 2016
commit 2b82c4254ec407868476db8504a33a7a0707928d
38 changes: 10 additions & 28 deletions doc/log/commit_log_v1.0d.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
----------------
Date: 2016-04-10
Author: chamnit
Subject: Alarm and safety door bug fix.

- Typo in protocol.c caused a safety door to lock out the system during
an alarm. The correct character should keep that from happening and
bring back the original door/alarm behavior.


----------------
Date: 2016-04-04
Author: Sonny Jeon
Expand Down Expand Up @@ -60,31 +70,3 @@ time being. These removal options will go away eventually before they
become hard-coded in. (They will be toggle-able with the status report
mask in settings though.)


----------------
Date: 2016-03-19
Author: Sonny Jeon
Subject: Removed 328p-related code. Enabled options by default.

- Removed all of the 328p-related code, which seemed to clean up things
quite a bit without all those ifdefs everywhere.

- Since the 328p was very memory and flash limited, lots of
compile-time options were disabled by default. These have been now been
enabled by default. As they are considered generally helpful and does
not significantly impact how Grbl runs.

- For example, status reports can now report back real time feed rate
and line number being executed. Variable spindle is standard with a
separate spindle enable pin. Grbl will now check if a user setting has
exceeded the maximum step frequency and report an error, if so. And
finally, M7 flood coolant is enabled.

- In addition, all buffers have been significantly increased to take
advantage of the additional memory available. The planner buffer can
plan up to 36 motions. The serial buffers have been doubled in size
(256/128 bytes RX/TX). And the longest line Grbl can accept is 256
bytes, per the g-code standard (Grbl 328p is limited to 80).

- Removed the cpu_map folder, since this version is strictly Mega2560.

2 changes: 1 addition & 1 deletion grbl/grbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Grbl versioning system
#define GRBL_VERSION "1.0d"
#define GRBL_VERSION_BUILD "20160410"
#define GRBL_VERSION_BUILD "20160510"

// Define standard libraries used by Grbl.
#include <avr/io.h>
Expand Down
43 changes: 26 additions & 17 deletions grbl/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,6 @@ uint8_t plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rat
block->line_number = line_number;

// Compute and store initial move distance data.
// TODO: After this for-loop, we don't touch the stepper algorithm data. Might be a good idea
// to try to keep these types of things completely separate from the planner for portability.
int32_t target_steps[N_AXIS], position_steps[N_AXIS];
float unit_vec[N_AXIS], delta_mm;
uint8_t idx;
Expand Down Expand Up @@ -326,7 +324,6 @@ uint8_t plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rat
if (block->step_event_count == 0) { return(PLAN_EMPTY_BLOCK); }

// Adjust feed_rate value to mm/min depending on type of rate input (normal, inverse time, or rapids)
// TODO: Need to distinguish a rapids vs feed move for overrides. Some flag of some sort.
if (feed_rate < 0) { feed_rate = SOME_LARGE_VALUE; } // Scaled down to absolute max/rapids rate later
else if (invert_feed_rate) { feed_rate *= block->millimeters; }
if (feed_rate < MINIMUM_FEED_RATE) { feed_rate = MINIMUM_FEED_RATE; } // Prevents step generation round-off condition.
Expand All @@ -335,23 +332,26 @@ uint8_t plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rat
// down such that no individual axes maximum values are exceeded with respect to the line direction.
// NOTE: This calculation assumes all axes are orthogonal (Cartesian) and works with ABC-axes,
// if they are also orthogonal/independent. Operates on the absolute value of the unit vector.
float inverse_unit_vec_value;
float junction_vec[N_AXIS];
float inverse_millimeters = 1.0/block->millimeters; // Inverse millimeters to remove multiple float divides
float junction_cos_theta = 0.0;
float magnitude_junction_vec = 0.0;
for (idx=0; idx<N_AXIS; idx++) {
if (unit_vec[idx] != 0) { // Avoid divide by zero.
unit_vec[idx] *= inverse_millimeters; // Complete unit vector calculation
inverse_unit_vec_value = fabs(1.0/unit_vec[idx]); // Inverse to remove multiple float divides.

// Check and limit feed rate against max individual axis velocities and accelerations
feed_rate = min(feed_rate,settings.max_rate[idx]*inverse_unit_vec_value);
block->acceleration = min(block->acceleration,settings.acceleration[idx]*inverse_unit_vec_value);

block->acceleration = min(block->acceleration,fabs(settings.acceleration[idx]/unit_vec[idx]));
feed_rate = min(feed_rate,fabs(settings.max_rate[idx]/unit_vec[idx]));
// Incrementally compute cosine of angle between previous and current path. Cos(theta) of the junction
// between the current move and the previous move is simply the dot product of the two unit vectors,
// where prev_unit_vec is negative. Used later to compute maximum junction speed.
junction_cos_theta -= pl.previous_unit_vec[idx] * unit_vec[idx];
junction_cos_theta -= pl.previous_unit_vec[idx]*unit_vec[idx];
}
// Compute junction acceleration vector. Magnitude completed later when necessary.
junction_vec[idx] = unit_vec[idx]-pl.previous_unit_vec[idx];
magnitude_junction_vec += junction_vec[idx]*junction_vec[idx];
}

// TODO: Need to check this method handling zero junction speeds when starting from rest.
Expand Down Expand Up @@ -386,19 +386,28 @@ uint8_t plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rat
memory in the event of a feedrate override changing the nominal speeds of blocks, which can
change the overall maximum entry speed conditions of all blocks.
*/

// NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta).
if (junction_cos_theta > 0.999999) {
// For a 0 degree acute junction, just set minimum junction speed.
block->max_junction_speed_sqr = MINIMUM_JUNCTION_SPEED*MINIMUM_JUNCTION_SPEED;
} else {
junction_cos_theta = max(junction_cos_theta,-0.999999); // Check for numerical round-off to avoid divide by zero.
float sin_theta_d2 = sqrt(0.5*(1.0-junction_cos_theta)); // Trig half angle identity. Always positive.

// TODO: Technically, the acceleration used in calculation needs to be limited by the minimum of the
// two junctions. However, this shouldn't be a significant problem except in extreme circumstances.
block->max_junction_speed_sqr = max( MINIMUM_JUNCTION_SPEED*MINIMUM_JUNCTION_SPEED,
(block->acceleration * settings.junction_deviation * sin_theta_d2)/(1.0-sin_theta_d2) );

if (junction_cos_theta < -0.999999) {
// Junction is a straight line or 180 degrees. Junction speed is infinite.
block->max_junction_speed_sqr = SOME_LARGE_VALUE;
} else {
float junction_acceleration = SOME_LARGE_VALUE;
magnitude_junction_vec = sqrt(magnitude_junction_vec); // Complete magnitude calculation.
for (idx=0; idx<N_AXIS; idx++) {
if (junction_vec[idx] != 0) { // Avoid divide by zero.
junction_acceleration = min( junction_acceleration,
fabs((settings.acceleration[idx]*magnitude_junction_vec)/junction_vec[idx]) );
}
}
float sin_theta_d2 = sqrt(0.5*(1.0-junction_cos_theta)); // Trig half angle identity. Always positive.
block->max_junction_speed_sqr = max( MINIMUM_JUNCTION_SPEED*MINIMUM_JUNCTION_SPEED,
(junction_acceleration * settings.junction_deviation * sin_theta_d2)/(1.0-sin_theta_d2) );
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion grbl/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void printFloat(float n, uint8_t decimal_places)
n += 0.5; // Add rounding factor. Ensures carryover through entire value.

// Generate digits backwards and store in string.
unsigned char buf[10];
unsigned char buf[13];
uint8_t i = 0;
uint32_t a = (long)n;
buf[decimal_places] = '.'; // Place decimal point, even if decimal places are zero.
Expand Down