Commit Graph

15 Commits

Author SHA1 Message Date
Markus Hitter 2e13d2bc9d dda_queue.c/.h: introduce mb_tail_dda.
For now, this costs 2 bytes RAM, 8 bytes binary size and slows
down the slowest step by 4 clock cycles. We expect opportunities
for improvements elsewhere, of course.

  ATmega sizes               '168   '328(P)   '644(P)     '1280
  Program:  19434 bytes      136%       64%       31%       16%
     Data:   2179 bytes      213%      107%       54%       27%
   EEPROM:     32 bytes        4%        2%        2%        1%

  short-moves.gcode statistics:
  LED on occurences: 888.
  LED on time minimum: 230 clock cycles.
  LED on time maximum: 407 clock cycles.
  LED on time average: 263.008 clock cycles.

  smooth-curves.gcode statistics:
  LED on occurences: 23648.
  LED on time minimum: 251 clock cycles.
  LED on time maximum: 450 clock cycles.
  LED on time average: 286.212 clock cycles.

  triangle-odd.gcode statistics:
  LED on occurences: 1636.
  LED on time minimum: 251 clock cycles.
  LED on time maximum: 407 clock cycles.
  LED on time average: 276.568 clock cycles.
2016-12-06 13:49:25 +01:00
Markus Hitter 329dd14446 dda_queue.c: eliminate next_move() entirely.
All the simplifications before led to a simple three-line
function, one of which happened to duplicate a line of the calling
code. Also update comments mentioning this former function.

No stepping performance improvement, but cleaner code and 32 bytes
less binary size:

  ATmega sizes               '168   '328(P)   '644(P)     '1280
  Program:  19440 bytes      136%       64%       31%       16%
     Data:   2177 bytes      213%      107%       54%       27%
   EEPROM:     32 bytes        4%        2%        2%        1%
2016-12-06 13:19:48 +01:00
Markus Hitter fc70e00ca2 DDA: don't queue up heater waits.
Not queuing up waits for the heaters in the movement queue removes
some code in performance critical paths. What a luck we just
implemented an alternative M116 functionality with the previous
commit :-)

Performance of the slowest step is decreased a nice 29 clock
cycles and binary size decreased by a whoppy 472 bytes. That's
still 210 bytes less than before implementing the alternative
heater wait.

Best of all, average step time is down some 21 clock cycles, too,
so we increased general stepping performance by no less than 5%.

  ATmega sizes               '168   '328(P)   '644(P)     '1280
  Program:  19436 bytes      136%       64%       31%       16%
     Data:   2177 bytes      213%      107%       54%       27%
   EEPROM:     32 bytes        4%        2%        2%        1%

  short-moves.gcode statistics:
  LED on occurences: 888.
  LED on time minimum: 259 clock cycles.
  LED on time maximum: 429 clock cycles.
  LED on time average: 263.491 clock cycles.

  smooth-curves.gcode statistics:
  LED on occurences: 23648.
  LED on time minimum: 251 clock cycles.
  LED on time maximum: 472 clock cycles.
  LED on time average: 286.259 clock cycles.

  triangle-odd.gcode statistics:
  LED on occurences: 1636.
  LED on time minimum: 251 clock cycles.
  LED on time maximum: 429 clock cycles.
  LED on time average: 276.616 clock cycles.
2016-12-05 21:36:03 +01:00
Markus Hitter bf0760f883 dda_queue.h: replace all tabs by spaces.
Another file 'clean' and only few changes, so likely not producing
a mess in future rebases. No functional changes.
2016-11-25 22:04:25 +01:00
Markus Hitter c594a2b995 dda_queue.c/.h: make mb_head local.
This doesn't change binary size or performance, but it increases
encapsulation.
2016-11-25 22:04:17 +01:00
Markus Hitter 08179ccbbe Remove __attribute__((hot)).
There's no apparent documentation for this on the AVR variant of GCC.
Likely it means to optimize "more aggressively". Uhm, is gcc
intentionally wasting cycles otherwise? Likely not.

Also, the compilation result is exactly the same size with or
without this attribute.
2014-03-04 19:56:13 +01:00
Markus Hitter 13ec2d7521 Move endstop handling into a time-based procedure.
Before, endstops were checked on every step, wasting precious time.
Checking them 500 times a second should be more than sufficient.

Additionally, an endstop stop now properly decelerates the movement.
This is one important step towards handling accidental endstop hits
gracefully, as it avoids step losses in such situations.
2013-10-27 20:01:10 +01:00
Markus Hitter d51ec02cdf dda_queue: optimize enqueue().
Suggestion by ItsDrone, see
http://forums.reprap.org/read.php?146,174364,174364#msg-174364
2013-02-05 14:10:27 +01:00
Ben Gamari 45124316e3 Rework endstop homing.
The DDA is now used for motion control.

Note from Traumflug: thanks a lot for this excellent patch, Ben.
2011-10-23 19:51:40 +02: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
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
Michael Moon 096d7dfdf3 Merge release-candidate-triffid branch 2011-01-07 23:09:13 +11:00
Michael Moon d0c3744f92 add flush queue for emergency stop 2010-10-20 17:54:13 +11:00
Markus Hitter 90fca50535 dda_queue.c/.h: merge enqueue() and enqueue_temp_wait(). This
saves almost 200 bytes.
2010-09-30 21:55:39 +02:00
Michael Moon 595b66a341 setting up new branch 2 2010-08-10 14:26:24 +10:00