Commit Graph

800 Commits

Author SHA1 Message Date
Markus Hitter 4c84b31536 gcode_parse.c, decfloat_to_int(): use a smaller variable.
This saves 78 bytes and likely some processing time.
2012-05-11 13:51:01 +02:00
Markus Hitter 5a9a134ae4 gcode_parse.c: review decfloat_to_int() yet again.
This time, raise range at the cost of some precision for the
newly explored areas.
2012-05-11 13:50:57 +02:00
Markus Hitter 88236ba698 gcode_process.c: also reset E on G92 without arguments. 2012-05-11 13:50:55 +02:00
Markus Hitter 4087357a70 clock.c: better debug display of positions. 2012-05-11 13:50:53 +02:00
Markus Hitter eaf6c453be Introduce gcode_init() and honor E_ABSOLUTE as the default. 2012-05-11 13:50:51 +02:00
Markus Hitter ac22a57329 dda.c: enable update_current_position() for the new E relative handling. 2012-05-11 13:50:49 +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 e5cc5ab066 dda.c: Fix a number of minor things, detected by Phord.
These were mistakes introduced with the last commit.
Thanks, Phord!
2012-05-11 13:50:35 +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 34ab76fe6e gcode_parse.c: review decfloat_to_int() again.
Finally, significant simplifications worked out while
keeping micrometer accuracy for up to 4290 mm.
2012-05-11 13:50:26 +02:00
Markus Hitter a6e2a10f10 Update Gen3 config template according to Mendelfanatic.
Thanks a lot for the help, Mendelfanatics. See
http://forums.reprap.org/read.php?147,33082,126135#msg-126135
2012-03-28 12:52:04 +02:00
Markus Hitter b1fa6a1eee Make intercom recognize memory barriers. 2012-03-28 12:39:10 +02:00
Markus Hitter 221b4587c9 README: hint to Pronterface. 2012-03-26 17:49:50 +02:00
Markus Hitter 53140cf87c ThermistorTables.h: add a const to temptable.
This is apparently required by Arch Linux' avr-gcc.
2012-03-26 17:43:40 +02:00
Markus Hitter 7b909fcf82 Fix thermistor tables, which also fixes a build failure.
Now we don't have tables for default or gen7 electronics, but
two default tables for a single vs. two different thermistors.
This seems to be more logical.
2012-03-25 16:16:48 +02:00
Markus Hitter 0d607fd620 sersendf.c: update comment. 2012-03-04 19:06:15 +01:00
Markus Hitter 25b72b4ea3 dda.c: remove the hack to set a minimum delay.
This in no longer needed, as the timer handles very short delays
now properly.
2012-03-04 19:03:31 +01:00
Markus Hitter 07fcff1661 dda.c: initialize dda.c properly. 2012-03-04 19:03:20 +01:00
Markus Hitter 1996cb4167 dda.c: axis_to_step = ' ' is no longer needed.
The need for this was a result of failing code in timer.c, which
was fixed in recent commits.
2012-03-04 19:03:07 +01:00
Markus Hitter 962209dceb Teach ACCELERATION_TEMPORAL to respect maximum feedrates. 2012-03-04 19:02:57 +01:00
Markus Hitter e8db35ec76 dda.c: get rid of a unused variable warning. 2012-03-04 19:02:48 +01:00
Markus Hitter 7528037d4e Save status register on each interrupt.
Costs 28 bytes binary size and two CPU cycles per interrupt,
at the advantage of getting rid of possible well hidden bugs.
2012-03-04 19:02:38 +01:00
Markus Hitter c126629ec8 Make the step timer fit for very short delays.
This isn't the magic patch which suddenly allows us to run at
arbitrary high step rates, but can deal with short bursts of
very short delays only. Typical for a 45 deg move when using
ACCELERATION_TEMPORAL.

The implementation simply extends the impossible small delay.
To keep overall timing promises regardless, the extra is stored
and compensated for when a longer delay request comes in.

Wrapped all this in #ifdef ACCELERATION_TEMPORAL, as this adds
about 300 bytes of binary size, so it likely slows down the
setTimer() code a bit and non-temporal algorithms are expected to
never request an unreasonable short delay.
2012-03-04 19:02:28 +01:00
Markus Hitter fd91ee7e8b dda.c: re-introduce ACCELERATION_TEMPORAL.
The implementation is slightly different this time, as it's not
using these famous bresenham algorithms. The intention is to
allow axis-independent movements, as it's required for
EMC-quality look-ahead.
2012-03-04 19:02:17 +01:00
Markus Hitter 6864268df8 gcode_process.c: add notes about M82 and M83. 2012-03-03 16:58:41 +01:00
Markus Hitter 86e20580f8 Make fast PWM optional.
In some cases the heater switching MOSFETs overheat and using a lower
PWM frequency is advised. See also:
http://reprap.org/wiki/Gen7_Research#Heat_vs._PWM_Frequency
2012-03-03 16:56:36 +01:00
Markus Hitter 56258a3908 Configuration samples: don't use preprocessor math for STEPS_PER_M.
Since the introduction of STEPS_PER_M instead of STEPS_PER_MM
it's no longer allowed. Unfortunately.
2011-12-13 03:30:03 +01:00
Markus Hitter 72185f776b home.c: fix a typo. 2011-12-06 13:50:36 +01:00
Markus Hitter 71fb5d6f47 configs: make F_CPU UL instead of L. 2011-12-04 18:36:15 +01:00
Markus Hitter 69610a6dae timer.c: simplify clock counting a bit.
Nothing fancy, but it saves 8 bytes, so likely 8 cycles.
2011-11-21 09:56:12 +01:00
Markus Hitter 9c489911b6 timer.c: get rid of explicitely disabling the step timer.
This is no longer neccessary, as the step timer is not designed to
fire always exactly once.

Saves 54 bytes binary size.
2011-11-21 09:54:41 +01:00
Markus Hitter 53490bb318 Get rid of defered enabling of the step interrupt again.
This makes the code cleaner and the reduction of code
probably easily compensates for keeping global interrupts
enabled for a bit longer. Talked to macscifi about this.

Saves about 300 bytes of binary size.
2011-11-21 09:54:38 +01:00
Markus Hitter fcd11a6f24 dda.c: get rid of did_step.
We want to stop stepping as there are no steps left, not one step later.

Accordingly, we get rid of a small pause between two movements and
also have to decelerate one step earlier.
2011-11-21 09:54:35 +01:00
Markus Hitter 1ee4668e21 dda.c: also reset startpoint_steps.E on relative extruder movements.
Thanks to bgamari for identifying this bug.
2011-11-17 13:49:08 +01:00
Markus Hitter 64b1a23cd3 dda.c: fix a typo in update_current_position(). 2011-11-17 13:48:48 +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 22a5b428c6 Clean up default thermistor tables, analog to config.default.h.
Most likely, these tables don't depend on the type of electronics,
but on the type of thermistor.
2011-11-12 23:28:01 +01:00
Markus Hitter 67d88132a6 Move ThermistorTable.h out of the repository.
Having this available immediately is nice, having this table
overwritten with each update is a lot worse, though.
2011-11-12 23:26:12 +01:00
Markus Hitter a3f67e04e9 Deleted the "endstop" branch.
This is an empty commit just to notify interested parties.
All the interesting bits formerly in the endstop branch
can be found also in the "newdda" branch.
2011-11-07 13:23:17 +01:00
Markus Hitter b80c736004 Add the missing E_INVERT_ENABLE to the config templates.
Catch by brnrd, thanks.
2011-10-28 13:22:15 +02:00
Markus Hitter eabf3d8e4c config.ramps-1.2.h: invert X/Y/Z enable pins by default.
Suggestion by brnrd, thanks.
2011-10-28 13:22:14 +02: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 61b81b8a0a README: add installation instructions link in a prominent place. 2011-10-23 20:30:49 +02:00
Markus Hitter 2f8a257a0d dda.c: make update_position() work with an empty queue. 2011-10-23 19:52:00 +02:00
Markus Hitter 7a458486ed dda.c: reset ramping after an endstop stop.
As the new homing code ramps up, but not down, we have to reset
move_state.c before starting the next move.
2011-10-23 19:51:55 +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