Commit Graph

757 Commits

Author SHA1 Message Date
Travis Snoozy
e8345fdb88 Add support for active-high limit switches 2013-11-22 18:12:29 -08:00
Sonny Jeon
b36e30de2e Yet another major stepper algorithm and planner overhaul.
- Overhauled the stepper algorithm and planner again. This time
concentrating on the decoupling of the stepper ISR completely. It is
now dumb, relying on the segment generator to provide the number of
steps to execute and how fast it needs to go. This freed up lots of
memory as well because it made a lot tracked variables obsolete.

- The segment generator now computes the velocity profile of the
executing planner block on the fly in floating point math, instead of
allowing the stepper algorithm to govern accelerations in the previous
code. What this accomplishes is the ability and framework to (somewhat)
easily install a different physics model for generating a velocity
profile, i.e. s-curves.

- Made some more planner enhancements and increased efficiency a bit.

- The changes also did not increase the compiled size of Grbl, but
decreased it slightly as well.

- Cleaned up a lot of the commenting.

- Still much to do, but this push works and still is missing feedholds
(coming next.)
2013-11-22 17:35:58 -07:00
Sonny Jeon
2eb5acaa33 Another merge fix. 2013-10-29 19:43:40 -06:00
Sonny Jeon
b8f0a2399e Merge fixes. 2013-10-29 19:28:44 -06:00
Sonny Jeon
4402a9f74a Merge branch 'dev_2' into dev
Conflicts:
	README.md
	gcode.c
	motion_control.c
	planner.c
	planner.h
	protocol.c
	report.c
	settings.c
	settings.h
	stepper.c
	stepper.h
2013-10-29 19:12:09 -06:00
Sonny Jeon
4f9bcde40e Merge branch 'dev_2' into dev
Conflicts:
README.md
gcode.c
motion_control.c
planner.c
planner.h
protocol.c
report.c
settings.c
settings.h
stepper.c
stepper.h
2013-10-29 19:10:39 -06:00
Sonny Jeon
0ac6c87196 Planner function call fix. More clean up. 2013-10-29 18:55:55 -06:00
Sonny Jeon
27297d444b Updated comments. Changed stepper variable names to be more understandable. Added step locking note.
- Updated config comments and stepper code comments for the new changes.

- Changed stepper algorithm variable names to be more understandable in
what they actually do.

- Added a stepper lock note in default.h per user request.

- Started some code layout in handling feed holds and refactoring the
homing routine to use the main stepper algorithm instead of a seperate
version.
2013-10-29 08:31:48 -06:00
Sonny Jeon
f7429ec79b Cleaned up stepper and planner code.
- Added some compile-time error checking. Will add more in future
pushes to ensure settings are correct and within parameters that won't
break anything.

- Pushed some master branch changes with MEGA pin settings.

- Cleaned up planner code and comments to clarify some of the new
changes. Still much to do here.

- Cleaned up the new stepper code. May need to abstract some of the
segment buffer more to fix the feed holds (and integrate homing into
the main stepper routine). With what's planned, this should make the
stepper algorithm easier to attach other types of processes to it,
where it is now tightly integrated with the planner buffer and nothing
else.
2013-10-24 22:12:13 -06:00
Sonny Jeon
fe03216952 Merge pull request #279 from EliteEng/master
Changed Stepper Pins
2013-10-21 19:19:26 -07:00
Rob Brown
a2457c4d70 Changed Stepper Pins
Changed Stepper Pins so the Step Port Invert Mask matches the UNO
2013-10-18 10:06:07 +08:00
Sonny Jeon
9b426d0c91 Merge pull request #278 from EliteEng/master
Update Pin Change Interrupts on Mega 2560
2013-10-17 07:09:08 -07:00
Rob Brown
3e92fef3b4 Update Pin Change Interrupts so it works
PCIE1 - Interrupt 8 on the Mega is attached to USART0 RX so when any
serial communication was transmitted it was triggering the Reset
Interrupt
2013-10-17 17:05:08 +08:00
Sonny Jeon
0cb5756b53 Fine tuning of new stepper algorithm with protected planner. Adaptive step prediction for segment buffer.
- Cleaned up the new stepper algorithm code with more commenting and
better logic flow.

- The new segment buffer now predicts the number of steps each segment
should have to execute over about 8 milliseconds each (based on the
ACCELERATION_TICKS_PER_SECOND setting). So, for when the whole segment
buffer is full, the stepper algorithm has roughly 40 milliseconds of
steps queued before it needs to refilled by the main program.

- Readjusted the max supported step rate back to 30kHz from the lower
development 20kHz. Everything still works amazing great and the test
CNC machine still runs twice as fast with the new stepper algorithm and
planner.

- Upped the standard serial baudrate to 115200 baud, as it is clear
that the bottleneck is the serial interface. Will now support this, as
well as the old 9600 baud, in new firmware builds.
2013-10-14 21:21:56 -06:00
Sonny Jeon
8a10654b1c New stepper subsystem bug fixes.
- New stepper algorithm with the new optimized planner seems to be
working nearly twice as fast as the previous algorithm.

- For one, the planner computation overhead is probably a fraction of
what it used to be with the worst case being about half still.

- Secondly, anytime the planner plans back to the first executing
block, it no longer overwrites the block conditions and allows it to
complete without lost steps. So no matter if the streams slows, the
protected planner should keep the steppers moving without risk of lost
steps (although this still needs to be tested thoroughly and may
audibly sound weird when this happens.)

- It now seems that the bottleneck is the serial baudrate (which is
good!)
2013-10-12 10:35:26 -06:00
Sonny Jeon
805f0f219c Protected buffer works! Vast improvements to planner efficiency. Many things still broken with overhaul.
Development push. Lots still broken.

- Protected planner concept works! This is a critical precursor to
enabling feedrate overrides in allowing the planner buffer and the
stepper execution operate atomically. This is done through a
intermediary segment buffer.

- Still lots of work to be done, as this was a complete overhaul of the
planner and stepper subsystems. The code can be cleaned up quite a bit,
re-enabling some of the broken features like feed holds, and finishing
up some of the concepts

- Pushed some of the fixes from the master and edge branch to here, as
this will likely replace the edge branch when done.
2013-10-09 09:33:22 -06:00
Sonny Jeon
471a45a1b9 Merge pull request #263 from 0xPIT/master
remove mcu argument for avr-size in makefile as it is not present in GNU...
2013-08-25 11:08:08 -07:00
0xPIT
24280f95a5 remove mcu argument for avr-size in makefile as it is not present in GNU Binutils 2.22 2013-08-25 14:54:10 +02:00
Sonny Jeon
0894183991 Pin map definition cleanup. 2013-08-20 20:05:16 -06:00
Sonny Jeon
e24e67ffe2 Processor-independent pin mapping feature.
- Cleaned up and organized pin mapping concept by @elmom.

- pin_map.h allows for user-supplied pin mapping and port vector
definitions in a centralized file. With more processor types, more
definitions could be added.
2013-08-19 15:07:47 -06:00
Sonny Jeon
b2a69c02cf Merge pull request #260 from elmom/master
Thanks for the contribution! Looks good. Will update some of the semantics shortly, but the idea is solid.
2013-08-19 08:27:01 -07:00
Sonny Jeon
7a175bd2db Push old dev_2 draft to work on other things.
- **NON-FUNCTIONAL**
- Contains an old draft of separating the stepper driver direct access
to the planner buffer. This is designed to keep the stepper and planner
modules independent and prevent overwriting or other complications. In
this way, feedrate override should be able to be installed as well.
- A number of planner optimizations are installed too.
- Not sure where the bugs are. Either in the new planner optimizations,
new stepper module updates, or in both. Or it just could be that the
Arduino AVR is choking with the new things it has to do.
2013-08-19 09:24:22 -06:00
Sonny Jeon
b2b5352e82 Merge pull request #229 from 0xPIT/patch-1
fix command line parameter for avr-size
2013-08-19 08:18:43 -07:00
Elmo Mäntynen
72ef50b17d Refactor config.h to allow defaults for chips/boards with different pin mappings 2013-07-21 15:11:04 +03:00
Elmo Mäntynen
689bc6d471 Added pin mapping list to docs, useful for porting 2013-07-21 13:54:14 +03:00
Elmo Mäntynen
8c781e155c Make serial work with most chips by default 2013-07-21 12:45:45 +03:00
0xPIT
d39abee37d fix command line parameter for avr-size 2013-05-16 21:48:44 +02:00
Sonny Jeon
fc5c497256 Updated readme 2013-04-05 09:32:20 -06:00
Sonny Jeon
ca563cf423 Increased g-code parser line buffer. Added line overflow feedback.
- Increased g-code parser line buffer from 50 to 70 characters. Should
fix most all issues with long arc statements, provided that they are 8
digits(float) long only.

- Added a line buffer overflow feedback error to let the user know when
it encounters this problem. Resets the line whenever this occurs.
(Thanks @BHSPitMonkey!)
2013-04-05 09:29:10 -06:00
Sonny Jeon
1fa3dad206 Updates to edge/dev. Line buffer increased/planner buffer decreased. Line overflow feedback.
- Increased g-code parser line buffer to 70 characters (from 50) to
prevent some long arc commands from getting truncated.

- Decreased planner buffer from 18 to 17 blocks to free up memory for
line buffer.

- Added a line buffer overflow feedback error (Thanks @BHSPitMonkey!)
2013-04-05 09:21:52 -06:00
Sonny Jeon
08baabc63c Minor updates to code and commenting. 2013-03-28 10:11:41 -06:00
Sonny Jeon
49f703bb2c Update README.md 2013-03-22 08:45:46 -06:00
Sonny Jeon
3c9c516a47 Untested! Soft limits, max travel, homing changes, new settings.
- WARNING: Completely untested. Will later when there is time. Settings
WILL be overwritten, as there are new settings.

- Soft limits installed. Homing must be enabled for soft limits to work
correctly. Errors out much like a hard limit, locking out everything
and bringing up the alarm mode. Only difference is it forces a feed
hold before doing so. Position is not lost.

- IMPORTANT: Homing had to be updated so that soft limits work better
with less CPU overhead. When homing completes, all axes are assumed to
exist in negative space. If your limit switch is other side, the homing
cycle with set this axis location to the max travel value, rather than
zero.

- Update mc_line() to accept an array, rather than individual variables.

- Added an mc_auto_cycle_start() function handle this feature.
Organization only.

-
2013-03-21 19:22:07 -06:00
Sonny Jeon
33c6659523 Update README.md 2013-03-19 11:43:11 -06:00
Sonny Jeon
96f7d9b78e G-code updates for G10 L2 and L20
- Updated g-codes G10 L2 and G10 L20 to the new descriptions on
linuxcnc.org
2013-03-19 11:35:24 -06:00
Sonny Jeon
e3cfa93d97 G-code updates for G10 L2 and L20.
- LinuxCNC's g-code definitions changed for G10. Updated to their
descriptions.
2013-03-19 11:33:04 -06:00
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
Sonny Jeon
aae1089051 Pushed minor changes. Thanks @Protoneer! 2013-03-12 18:10:24 -06:00
Sonny Jeon
cdcb4263e8 Merge pull request #200 from Protoneer/master
Fixed small bug.
2013-03-12 17:09:54 -07: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
b06643a2e0 Bug fix to-do note on soft limit checks. Not yet completed. 2013-03-01 10:50:36 -07:00
Sonny Jeon
74b2af3c2f Minor changes and added notes to soft limits routines.
- Changed up mc_line to accept an array rather than individual x,y,z
coordinates. Makes some of the position data handling more effective,
especially for a 4th-axis later on.

- Changed up some soft limits variable names.
2013-03-01 09:55:10 -07:00
Sonny Jeon
7951b83294 Merge pull request #193 from bungao/soft_limts
integrating soft limits
2013-02-26 09:35:30 -08:00
Jens Geisler
a0f430d188 bugfix: uninitiallized curr_block->new_entry_speed_sqr lead to step loss
in some cases
2013-02-26 08:40:43 +01:00
bungao
b75e95c880 integrating soft limits 2013-02-26 13:55:12 +11:00