Commit Graph

46 Commits

Author SHA1 Message Date
Nico Tonnhofer a0936287f9 home.c/.h: formattings 2017-12-08 18:22:08 +01:00
Nico Tonnhofer 3b13eb342f enumerate for axis endstop 2017-12-02 00:11:33 +01:00
Nico Tonnhofer ccbcbc5ab4 home.c: move fast_feedrate and search_feedrate to PROGMEM 2017-12-02 00:08:39 +01:00
Nico Tonnhofer 01c2300d20 home.c: refactor homing 2017-11-04 07:40:02 +01:00
Nico Tonnhofer 5ff6e4c755 home.c: homing starts always at position 0. 2017-11-04 07:37:19 +01:00
Nico Tonnhofer 06931c50f6 home.c: only home to the expected endstop direction.
Afterwards move back. It's not 'zeroed' at this time.
2017-11-04 07:37:19 +01:00
Nico Tonnhofer 3856d11673 home.c: prevent overflow of traveled length while homing.
In dda.c we have some limitation factors. e.g. the calculation
for the move_duration. 'distance * 2400' should be everytime below
UINT32_MAX.
Maybe we find later an other limitation factor. So you can
modify it now in dda.h.
2017-11-04 07:37:11 +01:00
Matt Gilbert a691f2a8ab PCBScriber config files.
PCBScriber is a printer for the scratch 'n etch method, see

  http://reprap.org/wiki/PCBScriber

Commit reviewer Traumflug's note:

 - Rebased to current branch 'experimental', which adds
   USE_INTERNAL_PULLDOWNS.

 - Removed DEFINE_HOMING for now, this part isn't cooked, yet.
   For example, it doesn't pass regression tests.

 - Thank you very much for the contribution!
2016-11-20 14:45:45 +01:00
Markus Hitter f577431aac home.c, dda.c: consider endstops on both axis ends when homing.
Previously, when backing off of X_MIN, X_MAX was also checked,
which of course was already open, so it signals endstop release
even while X_MIN is still closed. The issue exposed only when
endstops on both ends of an axis were defined, a more rare situation.

Essentially the fix simply makes a distinct endstop check case
for each side of each axis.

This even makes binary size 40 bytes smaller for the standard case.
2015-01-09 13:11:01 +01:00
Markus Hitter 84cbf2a42a home.c: no need to turn off Z axis here.
This is done in dda.c already, see dda.c, line 678.
2014-08-31 19:03:57 +02:00
Markus Hitter 94fa733ee8 home.c: don't move to zero after homing to max endstop.
This can be counterproductive if the actual zero point is
outside the available build room. For example, if an additional
bed probing is going to happen. It also costs quite some
time on the Z axis. If you actually  want this behaviour,
send a simple G0 XYZ after homing.
2014-08-31 19:03:45 +02:00
Phil Hord d3f49b3e95 DDA: Convert TARGET axis vars to array.
In preparation for more efficient and scalable code using axis-loops
for common operations, add two new array-types for signed and unsigned
32-bit values per axis. Make the TARGET type use this array instead of
its current X, Y, Z, and E variables.

Traumflug notes:

- Did the usual conversion to spaces for changed lines.

- Added X = 0 to the enum. Just for peace of mind.

- Excellent patch!

Initially I wanted to make the new array an anonymous union with the
old variables to allow accessing values both ways. This way it would
have been possible to do the transition in smaller pieces. But as
the patch worked so flawlessly and binary size is precisely the
same, I abandoned this idea. Maybe it's a good idea in other areas.
2014-08-31 19:03:17 +02:00
Markus Hitter d53407bdc3 home.c: remove some redundant preprocessor stuff.
Binary size is exactly the same, to the optimizer apparently
manages to drop empty functions.
2014-07-11 01:38:25 +02:00
Markus Hitter dc84e4dfe0 home.c: adaptive homing feedrates for all axes. 2014-07-11 01:38:18 +02:00
Markus Hitter b275bfcc32 Implement adaptive homing feedrates.
For now for X min only, but it works excellently already.
Tested quite a few combinations and raising acceleration
or endstop clearance raises homing feedrate just as expected.

Quite a chunk of the code is for testing the given configuration,
only. A thing which would ideally be done for every macro
used in each code file.
2014-07-11 01:37:57 +02:00
Markus Hitter 2ebfd44530 Clean up some unused delay related stuff. 2013-03-24 16:19:21 +01:00
Markus Hitter be29ab61ae home.c: fix typo. 2012-08-22 18:52:05 +02:00
Markus Hitter 9dda3349be Revert the new relative handling for X, Y and Z.
These were commits 9dbfa7217e0de8b140846ab480d6b4a7fc9b6791 and
2b596cb05e621ed822071486f812eb334328267a.

There are several reasons why this new approach didn't work out well:

- The machine coordinate system is lost on relative movements.
  OK, we could keep tracking it, but this would mean even more
  code, so even more chances for bugs.

- With the lost coordinate system, no software endstops are possible.

- Neither of X, Y, Z will ever overflow.

- If a movement planner would appear one day, he'd have to handle
  relative movements as well. Even more code duplication.
2012-05-11 13:50:47 +02:00
Markus Hitter 5f9ae5b087 Implement M82/M83 and handle relative movements entirely different.
Instead of converting them to absolute first, then back to
relative and having all the fuzz with working on the queue's
start vs. working at the queue's end, mark a movement as relative
and use this directly.
2012-05-11 13:50:33 +02:00
Markus Hitter 72185f776b home.c: fix a typo. 2011-12-06 13:50:36 +01:00
Markus Hitter 4e5f51f01e Store distances in the TARGET strucure in micrometers for all axes.
This extends the previous commit from X to Y, Z and E.
2011-11-17 13:48:36 +01:00
Markus Hitter c96ea0c773 Store distances in the TARGET structure always in micrometers.
This is a intrusive patch and for now, it's done for the X axis only.
To make comparison with the former approach easier ...

The advantages of this change:

- Converting from mm to steps in gcode_parse.c and back in dda.c
  wastes cycles and accuracy.

- In dda.c, UM_PER_STEP simply goes away, so distance calculations
  work now with STEPS_PER_MM > 500 just fine. 1/16 microstepping
  on threaded rods (Z axis) becomes possible.

- Distance calculations (feedrate, acceleration, ...) become much
  simpler.

- A wide range of STEPS_PER_M can now be handled at reasonable
  (4 decimal digit) accuracy with a simple macro. Formerly,
  we were limited to 500 steps/mm, now we can do 4'096 steps/mm
  and could easily raise this another digit.

Disadvantages:

- STEPS_PER_MM is gone in config.h, using STEPS_PER_M is required,
  because the preprocessor refuses to compare numbers with decimal
  points in them.

- The DDA has to store the position in steps anyways to avoid
  rounding errors.
2011-11-17 13:48:26 +01:00
Markus Hitter f216ff5e0b home.c: catch by brnrd: inconsistency with Z_MIN_PIN and Z_MAX_PIN.
If both were defined, it was different from handling of X and Y.
Thanks, brnrd.
2011-10-28 13:22:12 +02:00
Markus Hitter d0972036ca home.c: catched by brnrd: two missing &.
Thanks, brnrd.
2011-10-28 13:22:09 +02:00
Markus Hitter 2f04a9e58c Update current_position only as needed.
This saves almost 200 bytes and 100 runs of
update_current_position() per second.
2011-10-23 19:51:54 +02:00
Markus Hitter 414e0f7258 home.c: home_..._positive requires both, ..._MAX_PIN and ..._MAX. 2011-10-23 19:51:52 +02:00
Markus Hitter 27a247646c home.c: make queueing home movements while the machine is running work
current_position is the position at the start of the queue,
startpoint is the position at the end of the queue and we add
at the end, obviously.
2011-10-23 19:51:50 +02:00
Markus Hitter 129bdc64bc home.c: introduce SLOW_HOMING 2011-10-23 19:51:48 +02:00
Markus Hitter f2fea37eb8 home.c: remove now obsolete power-on stuff.
This went obsolete, as homing movements are enqueued now.
2011-10-23 19:51:43 +02: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
Markus Hitter 3b4953a631 Remove a bunch of duplicate x_enable() etc.. 2011-10-05 14:13:22 +02:00
Markus Hitter b45969e57a Introduce stepper_enable() and stepper_disable().
This allows to heat up with disables steppers, even if all steppers
share a common enable pin.
2011-10-05 14:13:21 +02:00
Bas Laarhoven a8d21ebb92 Changed 'denoise' into more commonly used term 'debounce'. 2011-08-16 13:45:48 +02: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 b37a5d435e home Z to max if possible by default 2011-04-09 09:15:48 +10:00
Michael Moon f4e4788892 wait for queue to empty before homing 2011-04-09 09:15:22 +10:00
Michael Moon 0dc7d77885 Massive Doxygen documentation addition
'make doc' then point your browser at doc/html/

Needs plenty of cleanup and polishing, but the main bulk is here

even documents your configuration! ;)
2011-03-22 01:34:36 +11:00
Markus Amsler 7a15fb6df2 homing: delay is in microseconds. 2011-02-27 22:40:03 +01:00
Markus Amsler 994acb58c3 homing: enable axis before moving. 2011-02-27 22:31:27 +01:00
Michael Moon 8188ff3593 merge intercom-protocol into master 2011-02-21 16:01:27 +11:00
Markus Amsler 7aff5623ef home: delay is in micro seconds 2011-02-21 15:52:14 +11:00
Michael Moon c6122eda74 add G161/G162 commands, upgrade home.c to provide negative/positive homing calls for G161/G162 2011-02-20 14:10:53 +11:00
Michael Moon 4426c69274 individual functions to home each axis 2011-02-20 13:39:07 +11:00
Michael Moon 940d474c6c home to max should now return to zero after homing 2011-02-15 10:10:29 +11:00
Michael Moon 4da63d31ff fix homing code 2011-02-08 17:53:42 +11:00
Michael Moon 0110af2ede preliminary homing code- not linked into anything yet 2011-02-08 17:52:51 +11:00