Commit Graph

1100 Commits

Author SHA1 Message Date
Markus Hitter 0991e4a41f Configtool: add some formatting to collected help texts.
Tooltips don't size their box after line lengths, but have their
own idea on how wide to make it. Accordingly one should display
text with newlines only for paragraph delimiters.

This also required adjustments to all the board and printer
description comments. No functional change there.

This should solve issue #148.
2015-05-26 14:23:49 +02:00
Markus Hitter 2f8ed0dbeb Configtool: provide heater names as temp sensor names.
Formerly, both names were arbitrary and the user had to know
that only heaters ans sensors with matching names would work
together. Accordingly, temp sensors can have only names matching
those of existing heaters. With the exception of "noheater",
which is also provided.

This kind of solves issue #143.
2015-05-26 13:59:07 +02:00
Markus Hitter ada9450807 Configtool: teach heaterspage to provide a list of heater names.
This is part of the task to name temp sensors only after existing
heater names.
2015-05-26 13:53:25 +02:00
Markus Hitter 8ea9e93ac7 Configtool: swap heater and temp sensor definition tabs.
This looks like nitpicking right now, but further changes shall
provide only already existing heater names for temp sensor names,
so the former have to be defined first. Lead the user to follow
this strategy intuitively.
2015-05-26 13:53:25 +02:00
jbernardis e5e8983427 Configtool: make tooltips for radio buttons work on Linux.
The problem was, applying tooltips to the radio buttons directly
showed no effect on Linux. While this is likely a bug in wxPython,
we can't change this behaviour.

The solution is to also apply these help texts to the surrounding
StaticBox. This works, even for the radio buttons.

This solves issue #149.
2015-05-26 13:49:31 +02:00
Markus Hitter 276b82d013 config/board*: add help text for temp sensor name limitations.
Unfortunately this is only solution I can offer to complete the
fix for issue #96.
2015-05-23 21:09:03 +02:00
Markus Hitter d9fb7cab96 temp.c: print the right temperature.
Order of heater and temperature sensor can differ, so they can get
different numbers. When printing extruder temperatur, we want to
print the temperature of the sensor matching the extruder heater,
not that of the temp sensor with the same number as the extruder
heater. Same for the bed respectively.

This should partially solve issue #96.
2015-05-23 20:36:40 +02:00
jbernardis a96d4b4dc9 addsensordlg.py: always validate not required fields.
Previously funny things could happen, like a refusal to save
temperature sensors just because some unused field contained
garbage.
2015-05-22 13:18:46 +02:00
jbernardis 6243880982 Configtool: also save thermistor tables when only saving config.h.
Previously this was only done when saving a board file ... but
these tables can also change when general settings are changed.
2015-05-22 13:15:47 +02:00
jbernardis 5006eecd43 configtool.py: don't try to process an unreadable config.h. 2015-05-22 13:13:16 +02:00
jbernardis 50cb7bfb79 Configtool: make all general settings user-editable.
Also add meaningful tooltips.
2015-05-22 10:59:34 +02:00
jbernardis e1277e4f4a Configtool: move thermistor presets into distribution file.
The problem was, that settings distributed in
configtool.default.ini were overridden once a configtool.ini was
created. Accordingly, users upgrading sources wouldn't see changes
in this file.

The solution is to move settings set by the distribution into a
separate file which isn't replaced by a user-saved one.

This should fix issue #142.
2015-05-20 23:31:38 +02:00
Markus Hitter 9a10e70e36 Configtool: also allow to abort builds.
Usually the complete or fail within a few seconds, but one never
knows and consistency with cancel-ability of uploads is good.
2015-05-20 13:49:12 +02:00
jbernardis 61c1ba182f Configtool: add ability to cancel upload.
In case communications to the bootloader doesn't work as expected,
avrdude often takes many many minutes to recognize this, so it's
very convenient to be able to abort these fruitless attempts.

This should solve issue #131.
2015-05-20 13:49:10 +02:00
jbernardis 610e1d169b Configtool: add Steinhart-Hart algorithm and thermistor presets.
The Steinhart-Hart algorithm allows more precise thermistor
tables, but also requires more parameters, which aren't
available for all thermistors. Accordingly, add support for both,
the traditional logic using the beta parameter as well as the new
one.

This also adds thermistor-presets, so users can simply choose
from a pulldown-menu to set their thermistor.

Also, identical thermistors get merged into one table, saving
binary size.

Last not least, a few bugs in this area got fixed.

Usually, all these things go into separate commits, but they were
contributed all in one and separating them is a bit error-prone
for little gain.

This should address issue #130, #134 and #135.
2015-05-19 18:11:09 +02:00
Markus Hitter 3d2c307c56 Configtool: use absolute path for .hex file when uploading.
There were cases where the working directory got lost and
teacup.hex weren't found.

This should be the last bit to solve issue #132.
2015-05-14 13:07:46 +02:00
jbernardis e661170f75 Configtool: use absolute paths for .al files.
In some cases the working directory gets changed unintentionally,
so these .al files were no longer found.

This should partially solve issue #132.
2015-05-14 11:56:39 +02:00
jbernardis ae8a2a2b59 Configtool: remove Analog Reference user choice.
This was previously made obsolete in the firmware code already.
See previous commits.

This should solve issue #138.

In case it ever turns out this was a poor decision, it's likely
a good idea to re-add this to the board configuration instead of
the printer configuration.
2015-05-11 02:03:47 +02:00
Markus Hitter 881629b74c analog.h: document and clean up.
No functional change.
2015-05-11 01:17:25 +02:00
Markus Hitter efa1e9bcbb analog.h: clamp ADC reference voltage to AVcc.
As none of the known controllers allow a meaningful other choice,
it's a bit pointless to provide this as a user choice via
config.h.
2015-05-11 01:14:22 +02:00
Markus Hitter 41e208a21f heater.c: remove some unneccessary #ifdef DEBUG.
These are redundant, the wrapped if() will be optimized away for
non-debug builds. The same strategy is used in many other places.
2015-05-09 15:11:21 +02:00
jbernardis 5b5032f87f Configtool: don't make DEBUG configuration user-visible.
Debug stuff is meaningful for developers, only. Also often
enabled on a per-file basis depending on the problem at hand.
Two reasons to remove it from Configtool and one reason to
remove it from the config files.

This should solve issue #137.
2015-05-08 20:38:23 +02:00
jbernardis b2e075be67 Configtool: load config.h at startup, if present.
This is for conveninence of continued usage and should solve
issue #139.
2015-05-08 20:38:23 +02:00
Markus Hitter c53c45d9cf Move patch "use absolute path names in config.h" to the attic. 2015-05-08 20:38:23 +02:00
jbernardis c6150737a7 Configtool: don't report successful file saves.
This is the expected outcome, so explicitely reporting this, with
requiring the user to click a dialog box away, is kind of clutter.

This should solve issue #136.
2015-05-08 14:06:40 +02:00
jbernardis ac8890b207 Configtool: distiguish between bootloader and firmware baud rate.
This should solve issue #133.
2015-05-04 22:30:01 +02:00
Markus Hitter f734b225eb Rename ThermistorTable.h to thermistortable.h.
This is purely cosmetics to match naming conventions of other
files. No functional change.
2015-05-04 20:08:39 +02:00
Markus Hitter 6f85f625cc Remove ThermistorTable{single|double}.h.
These are no longer needed, as they're now created on the fly by
Configtool.

Also pick unique information from there over to Configtool, see
the change in configtool/addsensordlg.h.
2015-05-04 19:55:16 +02:00
Markus Hitter 3dfb8a83bc delay.c: delay_us() and delay_ms() are now calibrated.
See comments in the code for the result.

This also fixes a bug where corner cases like delay(0) or
delay(13107) whould result in an extra long pause.
Note: 65535 / (F_CPU / 4000000) = 13107 on 20 MHz.

This costs 28 bytes binary size.
2015-04-28 13:05:21 +02:00
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