Commit Graph

570 Commits

Author SHA1 Message Date
Markus Hitter 5e85bb4fbb Makefile: typo fix. 2011-08-16 15:19:11 +02:00
Markus Hitter 9e64fdd8b0 Makefile: make that sizes table fit into 80 chars again. 2011-08-16 15:14:50 +02:00
Markus Hitter f6a70a5984 Makefile: get rid of that unrequested diff output.
This masks the message and annoys developers.
2011-08-16 15:14:47 +02:00
Bas Laarhoven 0dd3b7a892 Allow for queue sizes that are not a power of 2.
This prevents nasty surprises because this restriction is not mentioned in the configuration files. It also allows better tuning of performance against memory usage.

Traumflug: costs 18 bytes flash, so it's bearable.
2011-08-16 14:39:03 +02:00
Bas Laarhoven 1683db7f57 Fixed single inclusion of file. Added missing define. 2011-08-16 14:09:49 +02:00
Bas Laarhoven b1d8fd4a1f Renamed old RAMPS config file because another version was created. 2011-08-16 14:05:41 +02:00
Bas Laarhoven 72fdd33958 Prevent unexpected macro expansion. 2011-08-16 13:59:41 +02:00
Bas Laarhoven dfbaed16b9 Just added some comments. 2011-08-16 13:56:00 +02:00
Bas Laarhoven a8d21ebb92 Changed 'denoise' into more commonly used term 'debounce'. 2011-08-16 13:45:48 +02:00
Bas Laarhoven b05e358223 Added size output for ATMEGA1280. 2011-08-16 13:38:53 +02:00
Bas Laarhoven c2e7da519a Changed and tested pin definitions based on RAMPS v1.3 schematics. 2011-08-16 13:24:59 +02:00
Bas Laarhoven 41f0d4050b Created a new config file for the RAMPS v1.3 shield. Duplicated config.ramps.h to start with. 2011-08-16 13:23:27 +02:00
Michael Moon 8483073380 revert G28 to homing, as no-one uses it properly anyway 2011-07-16 21:01:31 +10:00
Michael Moon 49e2844213 fix bug introduced by 2421b788: dda struct requires c member even with no acceleration, it is used for feedrate 2011-07-08 09:56:43 +10:00
Michael Moon 131d7390c0 fix move to zero in next move after homing command, add M84 disable motors 2011-06-26 17:41:33 +10:00
Michael Moon fd93109b63 enable power and motors before homing, set position to n_MIN when hitting MIN limits if set 2011-06-26 17:41:21 +10:00
Michael Moon a262d72788 fix 'MUX5 not declared' compile error for chips that don't have A8-15 2011-06-22 11:23:19 +10:00
Michael Moon 9bd8a048ea new option: enforce_order. causes M105 and friends to wait for queue to empty before reporting 2011-06-18 22:47:53 +10:00
Michael Moon 2013effd9c allow larger chips to use analog channels 8-15 2011-06-18 13:28:47 +10:00
Michael Moon 43b5c0f0b4 force heater to remain off when target is zero 2011-06-14 23:16:14 +10:00
Michael Moon a68ae12679 add NO_AUTO_IDLE option to prevent powercuts after inactivity, add temp_all_zero so power isn't cut if heater remains off for a while but has a non-zero set temperature 2011-06-14 23:05:13 +10:00
Michael Moon e05e12c9e0 Fix bug introduced by 2421b788: Check once per second when waiting for temp instead of every 256 seconds 2011-06-13 13:55:52 +10:00
Jens Ch. Restemeier cea2a656a5 Fix assumption that debug led is on SCK pin
Signed-off-by: Michael Moon <triffid.hunter@gmail.com>
2011-06-10 22:58:25 +10:00
Jens Ch. Restemeier b39a7b8d84 fixed documentation errors 2011-06-03 02:02:47 +10:00
Jens Ch. Restemeier 14afa84aca Added gcode documentation and extraction tool 2011-06-03 02:02:46 +10:00
Markus Hitter 47d8dedf24 dda.c: move dda->*_steps and dda->*_counter into move_state as well.
Now we're easily back into business with an 8-line buffer queue
on an '168.
2011-05-16 22:09:12 +02:00
Markus Hitter ed77abba31 Move dda->step_no into move_state as well. 2011-05-16 22:09:10 +02:00
Markus Hitter bebb619054 dda.c, RAMPING: 16 bits for move_state.n are sufficient. 2011-05-16 00:16:00 +02:00
Markus Hitter 826f534fff dda.c: remove a few obsolete comments. 2011-05-15 23:48:58 +02:00
Markus Hitter 2421b788b9 Move dda->c out of DDA into move_state as well.
This also required to get rid of the usage of this variable
when waiting for temperature in dda_queue.*. Hope I got this
later part right.
2011-05-15 20:34:38 +02:00
Markus Hitter 51be23177a dda: move dda->n out into a new state variable
This required to also introduce dda_init() and re-adjust the
number of accelerating steps a bit.

Goal of this is to make look-ahead possible by just reducing
the number of deceleration steps and acceleration steps of
the next move. dda->c and dda->n no longer go down to their
initial values, then.

Also, quite a number of variables in the dda struct are used only when
the dda is live, so there is no need to store that for each
movement of the queue.
2011-05-15 20:34:35 +02:00
Markus Hitter 2f7619ae26 ACCELERATION_RAMPING: remove the old ramping algorithm.
The new algorithm takes up 80 bytes more binary size
and 12 bytes more RAM, but offers opportunities to
compensate for that.
2011-05-15 13:10:40 +02:00
Markus Hitter 20093404e9 ACCELERATION_RAMPING: use the precalculated number of ramping steps.
This is an intermediate step where both, the old and the new
ramping calculation methods are used and compared. The commit
is done for the case the new method needs debugging in other setups.
2011-05-15 13:10:38 +02:00
Markus Hitter ec47633794 ACCELERATION_RAMPING: precalculate number of acceleration steps.
These numbers aren't used, yet, but they can be compared with the
numbers calculated by the traditional method.
2011-05-15 13:10:36 +02:00
Markus Hitter 26fb18d178 Define acceleration in mm/s^2 instead of some unspecified value.
This units thing nicely covers the fact we need the ACCELERATION
to precalculate ramping steps later.
2011-05-15 13:10:32 +02:00
Jim McGee f555887eb5 Testing and setting the delay to a minimum value needs to occur only
if delay is not zero, otherwise the timer is not turned off when it
should be. Move the test and setting back inside the block that is only
executed if delay > 0.
2011-05-15 16:48:25 +10:00
Jim McGee 408718d2bb Limit effect on dda->c when computing reprap style acceleration.
This fix is really a hack to protect from overflow/underflows
in the acceleration code due to the limited precision of the
fixed point calculations. It does, however, protect the code
from accidently turning off the step timer or setting the
timer interval value outside of the range defined by the current
interval and the ultimate endpoint interval.

This is a cleanup replacement for the code posted on the reprap forum:
http://forums.reprap.org/read.php?147,33082,83467#msg-83467
2011-05-15 09:56:33 +10:00
Jim McGee 5dc0c80f0b Defer enabling of timer1_compa interrupt the end of the interrupt handler.
Specifically, disable interrupts just before returning and then enable
the timer interrupt if appropriate. This means that the timer interrupt
cannot actually fire until after the RETI, so the function cannot be
entered recursively.
2011-05-15 09:56:33 +10:00
Jim McGee 57b30b0ff1 Set a minimum delay instead of attempting to call the timer interrupt
service routine in the case that the requested timer interval is too
small.

Calling the interrupt service routine at this point is likely to
recursively clobber the stack.

Setting a lower bounds on the interrupt delay will limit the upper
speed of pulse generation, but it should not change the relative
pulse rates, and will not recurvisely clobber the stack.

Note that the lower limit of 17 has not been researched, it is
simply the value below which the old code attempted to call
the interrupt service routine directly.
2011-05-15 09:56:33 +10:00
Jim McGee 8241549276 Remove volatile from next_step_time as it can be easily managed using
memory barriers since it is only touched inside a single interrupt
handler or while interrupts are disabled in setTimer().

This saves about 90 bytes since it no longer needs to be reloaded multiple
times.
2011-05-15 09:56:33 +10:00
Jim McGee 8378aa04fc Address issues with interrupts and the shared variables used to
manage the movebuffer (mb_head, mb_tail, movebuffer).

The approach taken is to leave all of the variables non-volatile
and use memory barriers to control reads/writes. read/modify/write
operations that can be done outside of the interrupt context are
protected by disabling interrupts.

Also, manually cache the pointer to the movebuffer of interest
as the compiler does a poor job of reusing the pointer even in
places that it could.

There are still some groups of accesses to the movebuffer data that need
to be protected by disabling interrupts, but these are all related
to sending back debug data. The error will cause occassional mismatched
values to be sent back via the serial connection, but they do not
affect the actual operation of the code, so they will be addressed
in a separate checkin.

Conflicts:

	dda_queue.c
2011-05-15 09:56:33 +10:00
Jim McGee 85a9f63dfb Pretest DEBUG_X constants for non-zero and && the test with all existing
& tests of the debug_flags. Currently the compiler is able to eliminate
the block and the & operation when the constant is zero, but since
the debug_flags variable is a volatile the compiler does not eliminate
the load of the variable. By pretesting and shortcutting the load is
eliminated. Saves a small number of bytes when the debug build is
disabled and costs nothing when it is enabled.
2011-05-15 09:56:33 +10:00
Jim McGee f22e691fee Convert the clock_flag variable into 3 separate varables.
This costs 2 bytes of ram, but saves 60 bytes of flash. Doing so
also eliminates the need to disable interrupts while clearing flags
in the ifclock macro.

Conflicts:

	clock.c
	timer.c
	timer.h
2011-05-15 09:56:32 +10:00
Jim McGee 1e198e16ea Fix handling of the steptimeout variable.
Steptimeout is used both inside and outside
of interrupts, and as such it needs special attention.
Specifically, the increment outside of the interrupt
context needs to occur when interrupts are disabled,
or a clear of the variable can be missed.

The variable was also made volatile. This is not strictly necessary
given the current code, but it is the more conservative approach
to dealing with the variable (and costs nothing in the current code).
2011-05-15 09:56:32 +10:00
Jim McGee b6b5ced7be Add CLI_SEI_BUG_MEMORY_BARRIER() macro that inserts a memory barrier for older versions of avr-libc that do not include a memory barrier as part of the definition of SEI() and CLI(). 2011-05-15 09:56:32 +10:00
Jim McGee 4420652549 Add standalone memory barrier function to project. 2011-05-15 09:56:32 +10:00
Jim McGee 1059f27592 Clean up delay functions and rename them to be consistent with
what was used before the inline delay approach was attempted.
2011-05-15 09:56:32 +10:00
Jim McGee 757e1258e2 Shorten waiting delay while waiting for room to place a movebuffer on the queue. 2011-05-14 02:10:01 +02:00
Markus Hitter c095fa5de3 Leverage E_ABSOLUTE into config.h's, so people recognize it.
Oh, and let's hope it works already :-)
2011-05-13 13:24:52 +02:00
Sergey Batalov 03cebb5a82 TEMP_RESIDENCY now in units of 10ms rather than next_read_time
Signed-off-by: Michael Moon <triffid.hunter@gmail.com>
2011-05-10 14:10:56 +10:00