Commit Graph

1171 Commits

Author SHA1 Message Date
jbernardis 452908afa9 Configtool: prevent negative numbers in thermistor tables. 2015-04-28 11:27:28 +02:00
Markus Hitter 9b7fef2e84 dda_queue.c: report temperatures spontanuously while heating.
A spontaneous temperature report will be produced once a second
while waiting (via M116) for temps to be achieved.

Costs 14 bytes binary size.
2015-04-26 18:11:43 +02:00
jbernardis 3f4e01f991 .gitignore: configtool.ini is now an expected user file. 2015-04-25 17:56:14 +02:00
jbernardis 05bfea40de Configtool: refresh data structures when saving.
Solves Issue #120.
2015-04-25 16:33:27 +02:00
jbernardis d077ae6e9d Configtool: don't use deprecated wxPySimpleApp().
A really simple fix :-)
2015-04-21 02:51:32 +02:00
jbernardis 9f74d315d0 Configtool: don't mess up on modified default configs.
Previously, loading default configurations for board or printer,
then modifying them without saving them, then attempting to
build lead to a big mess, like attempting to save the board file,
failing in doing so and then building anyways.
2015-04-21 02:51:32 +02:00
Markus Hitter 2d191768ca createTemperatureLookup.py: deal with precision limitation on R0.
Inserting a dummy value is better than risking an exception with
failure to write a thermistor table at all. Happens when for one
of the usual thermistors accidently a nominal resistance of
1000k instead of 100k is used.
2015-04-21 02:51:32 +02:00
jbernardis 48433a6254 Configtool: added logic to generate thermistor temp tables.
Also enable editing of temperature sensors.
2015-04-21 02:51:32 +02:00
Phil Hord 1189d809a6 Simulator: add pgm_read_dword() macro.
pgm_read_word() was already defined, but pgm_read_dword() did not
get in our way during earlier testing. These functions force the
arduino to read these "defined in program" constant arrays from
"program memory" instead of RAM as a means to save on RAM usage.
The PC-based simulator doesn't need such tricks and only needs to
read the value directly from the in-RAM array. Therefore it is safe
to convert read directly from the pointer being passed.

pgm_read_word() already does this. Define pgm_read_dword()
similarly to it. Fixes #125.
2015-04-21 02:51:32 +02:00
Markus Hitter 6afddf5680 run-in-simulavr.sh: implement G-code sending handshaking.
Now it waits for an "ok" before sending the next line, like all
the G-code sending hosts do. This allows sending arbitrarily long
G-codes. The 60 seconds simulated time limit is still in place to
avoid endless simulations.

The standard performance simulation now runs more G-code and
results in slightly different numbers accordingly:

cd testcases
./run-in-simulavr.sh short-moves.gcode smooth-curves.gcode triangle-odd.gcode

    FLASH  : 20540 bytes         144%        67%        33%      16%
    RAM    :  2188 bytes         214%       107%        54%      27%
    EEPROM :    32 bytes           4%         2%         2%       1%

short-moves.gcode statistics:
LED on occurences: 888.
LED on time minimum: 304 clock cycles.
LED on time maximum: 720 clock cycles.
LED on time average: 313.256 clock cycles.

smooth-curves.gcode statistics:
LED on occurences: 36511.
LED on time minimum: 304 clock cycles.
LED on time maximum: 706 clock cycles.
LED on time average: 349.172 clock cycles.

triangle-odd.gcode statistics:
LED on occurences: 1636.
LED on time minimum: 304 clock cycles.
LED on time maximum: 710 clock cycles.
LED on time average: 332.32 clock cycles.
2015-04-21 02:51:32 +02:00
Markus Hitter 9aa1d2337f gcode_process.c: we can't rely on next_target.P being zero.
... simply because P is used for many commands and none of them
cares to clean it after usage.

This fixes a bug where setting the default heater without temp
sensor (M106) worked only after a G4 Pxxx command.
2015-04-21 02:51:32 +02:00
Markus Hitter 9dd7426f9d DDA: on short schedules, repeat step routine immediately ...
... instead of trying to fire an interrupt as quickly as possible.
This affects ACCELERATION_TEMPORAL only. It almost doubles the
achievable step rate. Measured maximum step rate (X axis only,
100 mm moves) is 40'000 steps/s on a 16 MHz electronics, so
approx. 50'000 steps/s on a 20 MHz controller, which is even
a bit faster than the ACCELERATION_RAMPING algorithm.

Tests with temporary test code were run and judging by these
tests, clock interrupts are now very reliable up to the point
where processing speed is simply exhaused.

Performance with ACCELERATION_RAMPING: this costs 10 bytes
binary size and exactly 2 clock cycles per step interrupt or
0.6% performance even. We could avoid this with a lot
of #ifdefs, but considering ACCELERATION_TEMPORAL will one
day be the default acceleration, skip these #ifdefs, also
for better code readability.

$ cd testcases
$ ./run-in-simulavr.sh short-moves.gcode smooth-curves.gcode triangle-odd.gcode
    SIZES             ATmega...  '168    '328(P)    '644(P)    '1280
    FLASH  : 20528 bytes         144%        67%        33%      16%
    RAM    :  2188 bytes         214%       107%        54%      27%
    EEPROM :    32 bytes           4%         2%         2%       1%

short-moves.gcode statistics:
LED on occurences: 838.
LED on time minimum: 304 clock cycles.
LED on time maximum: 715 clock cycles.
LED on time average: 310.717 clock cycles.

smooth-curves.gcode statistics:
LED on occurences: 8585.
LED on time minimum: 309 clock cycles.
LED on time maximum: 712 clock cycles.
LED on time average: 360.051 clock cycles.

triangle-odd.gcode statistics:
LED on occurences: 1636.
LED on time minimum: 304 clock cycles.
LED on time maximum: 710 clock cycles.
LED on time average: 332.32 clock cycles.
2015-04-21 02:51:32 +02:00
Markus Hitter 7dda91ab56 dda.c: put code for ACCELERATION_TEMPORAL in dda_step() together.
Performance for ACCELERATION_RAMPING unchanged:

$ cd testcases
$ ./run-in-simulavr.sh short-moves.gcode smooth-curves.gcode triangle-odd.gcode
[...]
    SIZES             ATmega...  '168    '328(P)    '644(P)    '1280
    FLASH  : 20518 bytes         144%        67%        33%      16%
    RAM    :  2188 bytes         214%       107%        54%      27%
    EEPROM :    32 bytes           4%         2%         2%       1%

short-moves.gcode statistics:
LED on occurences: 838.
LED on time minimum: 302 clock cycles.
LED on time maximum: 713 clock cycles.
LED on time average: 308.72 clock cycles.

smooth-curves.gcode statistics:
LED on occurences: 8585.
LED on time minimum: 307 clock cycles.
LED on time maximum: 710 clock cycles.
LED on time average: 358.051 clock cycles.

triangle-odd.gcode statistics:
LED on occurences: 1636.
LED on time minimum: 302 clock cycles.
LED on time maximum: 708 clock cycles.
LED on time average: 330.322 clock cycles.
2015-04-21 02:51:32 +02:00
Markus Hitter 8b88334b06 Rename setTimer() to timer_set() for more consistency.
Pure cosmetical change.

Performance check:

$ cd testcases
$ ./run-in-simulavr.sh short-moves.gcode smooth-curves.gcode triangle-odd.gcode
[...]
    SIZES             ATmega...  '168    '328(P)    '644(P)    '1280
    FLASH  : 20518 bytes         144%        67%        33%      16%
    RAM    :  2188 bytes         214%       107%        54%      27%
    EEPROM :    32 bytes           4%         2%         2%       1%

short-moves.gcode statistics:
LED on occurences: 838.
LED on time minimum: 302 clock cycles.
LED on time maximum: 713 clock cycles.
LED on time average: 308.72 clock cycles.

smooth-curves.gcode statistics:
LED on occurences: 8585.
LED on time minimum: 307 clock cycles.
LED on time maximum: 710 clock cycles.
LED on time average: 358.051 clock cycles.

triangle-odd.gcode statistics:
LED on occurences: 1636.
LED on time minimum: 302 clock cycles.
LED on time maximum: 708 clock cycles.
LED on time average: 330.322 clock cycles.
2015-04-21 02:51:32 +02:00
Markus Hitter d29737699f temp.h: remove indirection temp_tick(). 2015-04-21 02:51:31 +02:00
Markus Hitter 8408d8c294 Configtool: DEFINE_TEMP_SENSOR always wants four paramters.
Compilation with something else than a thermistor still doesn't
work, because temp.c insists on a thermistor table, but we're a
step closer.
2015-04-21 02:51:31 +02:00
Markus Hitter 29dd85a129 Configtool: also prettify writing heater definitions. 2015-04-21 02:51:31 +02:00
Markus Hitter 778af87102 Configtool: prettify writing sensor definitions.
This might look a bit oversensitive right now, but soon we'll also
write temperature table data, then it makes more sense.
2015-04-21 02:51:31 +02:00
Markus Hitter 2b5e28a4c8 Configtool: on configuration mismatch, save instead of load.
Loading led to building a firmware which didn't match what was
visible in the dialogs when the build was started. Very
misleading.
2015-04-21 02:51:31 +02:00
Markus Hitter 6a93cbac64 Configtool: don't overwrite configtool.default.ini.
It's rarely a good idea to overwrite files coming with a
distribution. Not for users, because they can't reset to factory
values; not for developers, because Git would pick up such changed
files.

Instead we read from configtool.default.ini now, but write to
configtool.ini. If configtool.ini is already present, it's
prefered over configtool.default.ini.
2015-04-21 02:51:31 +02:00
Markus Hitter c7ef3b9ff9 Configtool: report save settings success directly in SettingsDlg.
There we have access to the actual file name.
2015-04-21 02:51:31 +02:00
Markus Hitter a217465e65 SIMINFO: fetch device name from Makefile / compile parameters.
It's also possible to do this by stringifying MCU, but this
requires double redirection, which isn't easily readable in a .c
file. For stringification, see the bottom example at
https://gcc.gnu.org/onlinedocs/cpp/Stringification.html
2015-04-21 02:51:31 +02:00
Markus Hitter 1cc1cc5c14 Makefiles: rename "MCU_TARGET" to "MCU".
Cosmetic change.
2015-04-21 02:51:31 +02:00
Markus Hitter 01621cfbdb Makefiles: adjust comments.
- "Traumflug" and "Markus Hitter" are the same, mention him only
   once.

 - Add more common F_CPU choices in comments.

 - Hint to another choice in Makefile-example.
2015-04-21 02:51:31 +02:00
Markus Hitter 74c9924366 run-in-simulavr.sh: make stopping on "stop" working again.
It was so far unnoticed that the "simulavr" program is only a
script when run from within the build directory. Still killing it
by name worked, because bash's exec didn't terminate the initiating
script.

Apparently this week Ubuntu updated bash and the new version now
terminates the initiating script (which is a good idea), but now
the executable to kill by name has a different name. It's prefixed
with "lt-". As this "lt-" is hardcoded we can rely on it.
2015-04-21 02:51:31 +02:00
Markus Hitter a6be2f9584 dda.c: add forgotten variable declaration.
Forgotten in commit 74808610c7,
"DDA: Move axis calculations into loops, part 5.".

This and the previous commit makes ACCELERATION_TEMPORAL building
(and working!) again.
2015-04-21 02:51:31 +02:00
Markus Hitter a303f1ba3e dda.c: complete the rename from all_step to last_step.
Next time, please at least try to compile the code section in
question when explicitely changing the section. In this case,
with ACCELERATION_TEMPORAL enabled. It didn't build.

Was broken with commit 95926a3f113809bde8ff0c84b94c55c73e398f67,
"DDA: Rename confusing variable name.".
2015-04-21 02:51:31 +02:00
Markus Hitter 69e91b8acd ACCELERATION_TEMPORAL: always disable lookahead.
We simply don't support it, yet. And warn about it, so developers
get encouraged to add the few missing bits.
2015-04-21 02:51:31 +02:00
Markus Hitter 7d7d6178cf Remove now obsolete copier.c/.h.
Original author @triffid about these files:

  "The idea was to be able to program another board from your
   electronics without PC intervention, but reprap never seemed
   to go down that road."

Should solve Issue #115.
2015-04-21 02:51:31 +02:00
jbernardis 77d9b3d3c6 Configtool: finally remove all the old templates.
As they're all converted, they're no longer of any use. Still
they were kept up to this commit to allow comparisons between
old and new config.h system.
2015-04-21 02:51:31 +02:00
jbernardis 20af64d780 Configtool: convert template for Teensy++ 2.0.
Note the "++", it's a Teensy 2.0 with bigger CPU and more I/O pins.
2015-04-21 02:51:31 +02:00
jbernardis bcf7691bdd Configtool: convert template for Teensy 2.0. 2015-04-21 02:51:31 +02:00
jbernardis 845804f182 Configtool: convert template for Sanguish. 2015-04-21 02:51:31 +02:00
jbernardis b491d122b3 Configtool: convert template for 3Drag Controller. 2015-04-21 02:51:30 +02:00
jbernardis 0a848fffc1 Configtool: convert template for RUMBA. 2015-04-21 02:51:30 +02:00
jbernardis f67ad76b3c Configtool: convert template for Gen6. 2015-04-21 02:51:30 +02:00
jbernardis face7c0dc7 Configtool: convert template for Gen3. 2015-04-21 02:51:30 +02:00
jbernardis 342e1c4df7 Configtool: convert template for Sanguinololu v1.2. 2015-04-21 02:51:30 +02:00
jbernardis 821e0c1295 Configtool: convert template for Sanguinololu v1.1. 2015-04-21 02:51:30 +02:00
jbernardis 7ebdb81ce7 Configtool: convert template for RAMPS v1.2. 2015-04-21 02:51:30 +02:00
jbernardis 31858b7082 Configtool: convert template for Gen7 v1.1-v1.3.
Also sort printers in config.default.h alphabetically and make
Mendel the default printer.
2015-04-21 02:51:30 +02:00
jbernardis b5ba625697 config/board.ramps-v1.3.h: add yet another possible heater pin. 2015-04-21 02:51:30 +02:00
jbernardis a1b0dac6af Configtool: use --save-temps=obj again.
It has turned out developers use Configtool, too, so it makes
sense to keep temporary files for inspection.
2015-04-21 02:51:30 +02:00
jbernardis ee8f5f9170 Configtool: some code prettifications.
Pure whitespace changes.
2015-04-21 02:51:30 +02:00
jbernardis 2436ac2865 Configtool: a few more apperance enhancements. 2015-04-21 02:51:30 +02:00
jbernardis cbc87fc526 Configtool: align labels and choices vertically.
wxPython apparently doesn't allow to do this automatically,
so do it kind of manually, with a constand in data.py.
--Traumflug
2015-04-21 02:51:30 +02:00
jbernardis be8b0da71a Configtool: remove "Load default" menu entry.
This one is pretty pointless, because every user has a different
printer, so we can't deliver a meaningful default with the
distribution.
2015-04-21 02:51:30 +02:00
jbernardis 73f7e43227 Configtool: enforce correct configuration file names.
Previously one could save a board or printer configuration with
a name which wouldn't allow to load it again.
2015-04-21 02:51:30 +02:00
jbernardis 706ccf0637 Configtool: protect original config files.
Likely users don't care too much about the name of the saved file,
so they likely use the default ones. If they mess up, they also
likely want to return to the original, but, d'oh, it's overwritten.
Don't let this happen, enforce a non-original file name for user
saves.

In other words: don't let users shoot themselfs into their foot.
2015-04-21 02:51:27 +02:00
Markus Hitter 1cd21251d2 Get rid of STEP_INTERRUPT_INTERRUPTIBLE.
It was certainly a good idea, but also always a suspect of
malfunctions and as such, almost never used. Newer code
organisation moves most of the code behind it to dda_clock()
anyways, so it also became mostly obsolete.

Rest In Peace, STEP_INTERRUPT_INTERRUPTIBLE, you were matter
of quite a number of interesting discussions and investigations.

Changes for Configtool by jbernardis <jeff.bernardis@gmail.com>
2015-04-21 02:11:01 +02:00