Commit Graph

155 Commits

Author SHA1 Message Date
Markus Hitter 65857b17dc temp.c: get rid of TEMPTABLE_FORMAT.
Detecting tables by data size works fine, the optimiser removes
unneeded code successfully. Binary size stays the same.
2016-04-17 14:31:52 +02:00
Phil Hord 2291642456 Expand thermistortable to include precomputed slope
Save a division at runtime by pre-calculating the slope between each
pair of adjacent thermistortable values.  Since we use the larger value
each time, save the slope between two values A and B in the table
with the B data.  Therefore the slope is that between each value and
its predecessor in the list.

Store this new value in the third element of the now 3-integers-wide
array which makes up the table. Use fixed-point 6.10 format to store
the slope.  This is almost too narrow for some slopes and maybe it
should be changed to 8.8 fixed-point. In practice this presents a
loss in accuracy, but it is still significantly better than the
previous fixed-sample-size table production method. In particular no
provision is made to handle values which scale over 65535, and it
seems we should at least warn about this if not simply fail before
letting the user go off compiling his code.

Add a new flag TEMPTABLE_FORMAT and define it as 1 to tell the code
that we are using this new and incompatible format.  This lets us
tolerate old hand-crafted thermistor tables by keeping the slower
algorithm in case one is still used.  New thermistor tables should be
defined with this new format and with the FORMAT define set accordingly.

With the default 25 samples this adds 100 bytes to the flash image for
the thermistortable storage for two different thermistors.  But the
code is simplified and saves me 134 bytes in the bargain for a net
decrease in flash size of 34 bytes.
2016-04-17 14:31:12 +02:00
Phil Hord fe006021ee thermistortablefile.py: keep fractional part when computing table.
The Thermistortablefile.py routine prematurely drops the
fractional part of the temperature when computing the 14.2
temperature values to emit in the code. Keep this instead until
the last moment when we finally calculate the integer format we
will store.
2016-04-16 01:01:16 +02:00
Phil Hord 090be579d1 Refactor temp table optimization for any algorithm
This should be squashed but is separated here for comparison.
2016-04-14 13:26:17 +02:00
Phil Hord b7a2d58b31 Restrict thermistor table range to 0C-500C
We don't care about the accuracy of very cold temperatures
or unreasonably hot ones.
2016-04-14 13:24:59 +02:00
Phil Hord 6542c284fb Optimize temperature tables for accuracy
Temperature tables are emitted by selecting arbitrary sample values
to be used for the linear lookup table.  This is fine in the range
where the thermistor produces linear output, but it is markedly wrong
near the extremes where the thermister output begins to curve.

Introduce a new sample selector which chooses samples based on the "most
incorrect estimate" and improves from there to ensure we get a cleaner
approximation across the selected range.

Traumflug: this topic is tracked here:
https://github.com/Traumflug/Teacup_Firmware/pull/208
2016-04-14 13:03:30 +02:00
Witold Sowa fdf6dbe849 Added support for MCP3008 and MCP3004 ADC for temperature read 2016-04-12 22:37:50 +02:00
Phil Hord 52e5d784fd Remove useless lines from Configtool
I don't know what these lines were intended for, but the 'idx'
variable is not used anywhere else, so setting it is pointless.
2016-04-12 14:15:11 +02:00
Markus Hitter 82374b8e24 Rename Z_LATE_ENABLE to Z_AUTODISABLE and refine description.
Also turn it on by default for the Mendel printer.

Also add the forgotten Mendel90 printer.
2016-03-27 20:23:05 +02:00
Wurstnase 57afef9fdd Add Z late enable.
Until this commit, the Z axis is disabled after each move and
only enabled when the Z axis will move. Now you can enable this
as a feature. Some printer axes are too heavy or have a high
pitch which are not self locking. In that case simply do nothing.
It's now off by default.
2016-03-27 20:14:04 +02:00
Markus Hitter be6ca4c857 ARM, AVR: support inverted heater pin signals.
Implemented and tested for both platforms. This is quite a big
commit. Unlike with the previous changes to now choosable PWM
frequencies, all board configuration files and Configtool had
to be changed immediately to deal with the additional parameter
in DEFINE_HEATER() and keep AVR builds working (and regression
tests passing).
2015-08-13 17:12:10 +02:00
Markus Hitter 5a8dcf8e97 ARM: add a board configuration for Gen7-ARM.
Wohoo, this is the first ARM board in Configtool. Let's see how
Configtool deals with it :-)
2015-08-12 14:26:36 +02:00
Markus Hitter 43626b2ba2 boardpanel.py: fix getCPUInfo(), don't report tuples.
This was forgotten with the recent move to storing configuration
items as tuples (value, enabled). It should fix the refusal to
build reported in issue #86.
2015-08-12 14:18:40 +02:00
Markus Hitter 42b96e0e27 SD card: commit SD_CARD_SELECT_PIN to all the board files.
For the bigger boards like RAMPS or Rumba the pin numbers were
taken from Marlin. For the smaller boards, the pin is commented
out.
2015-07-30 15:31:57 +02:00
Phil Hord 15e8dec9b2 board.gen3.h: restore {TX,RX}_ENABLE_PIN defs.
These were dropped accidentally, I assume, during the Configtool
template conversion. Without them the INTERCOM feature does not
compile and so board.gen3.h is broken.

Add the gen3 config to testcases and regressiontests to ensure
this does not drop again.
2015-07-29 21:05:38 +02:00
jbernardis c92dcb02e2 Configtool: thermistor table entries are now distributed by ADC.
Previously they were evenly spaced across the temperature range,
now they're evenly distributed across the ADC range ... which
is not entirely the same.

This is related to issue #176.
2015-07-27 18:04:41 +02:00
jbernardis a40f818068 Configtool: fix the logic to accept floating input.
Previously if did not read back in the table information correctly.

This is related to issue #176.
2015-07-27 18:04:32 +02:00
jbernardis feb57c3eb0 Configtool: Steinhart-Hart temperature fields should allow floats.
This is, the parameter entry fields in the GUI, not in the
generated temperature table. Allowing floats is a tiny bit more
precise and also, more importantly, less confusing for the user.
--Traumflug

This is related to issue #176.
2015-07-27 18:04:02 +02:00
Markus Hitter cd1eb4e250 Configtool: move board/printer.metadata to configtool/ ...
and rename it to board/printer.generic.h.
2015-07-17 13:38:22 +02:00
Markus Hitter 6b5156d459 Configtool: take advantage of the now recognized values.
This is for now to restore disabled values as well, not only
active ones. More uses are thinkable.
2015-07-17 13:38:15 +02:00
Markus Hitter 3795c7a36f Configtool: don't ignore disabled values.
Previously, values of ignored keys simply got lost and were
replaced with the ones from from the metadata file. Now this
value is preserved and perhaps, some time in the future, we'll
use this bit of information to to provide the right value when
re-enabling it.
2015-07-17 13:38:09 +02:00
Markus Hitter 27cf051f03 Configtool: de-duplicate insertValues().
No change in behaviour intended.
2015-07-17 13:38:02 +02:00
Markus Hitter 88b813c4ba Configtool: don't pick up values which no longer exist.
Previously they were dropped only at save time, which is too late
for the GUI. This is mostly for robustness, the case where a
value was removed from config files, but not yet from the GUI.
2015-07-17 13:37:55 +02:00
Markus Hitter a07e5a7d1e Configtool: don't try to parse help text in the loaded file.
This shouldn't change functionality and is for more robustness.
2015-07-17 13:37:48 +02:00
Markus Hitter a48d9edf67 Configtool: let the parsing method decide about values.
Shouldn't cause functional change.

So far, values commented out are still ignored, which is why the
used regexp changed. This will hopefully change in the future,
so a configuration can remember disabled values, too.
2015-07-17 13:37:42 +02:00
Markus Hitter d9e4cd1086 Configtool: let the parsing method decide what a name is.
This is mostly for code robustness.
2015-07-17 13:37:34 +02:00
Markus Hitter e7395c8dd8 Configtool: there are no simple comments in printer.metadata.
Accordingly, don't try to parse them. If they ever appear, they
need handling.
2015-07-17 13:37:26 +02:00
Markus Hitter eeee384ed6 Configtool: let the parsing method decide what a candidate is.
This is mostly for code robustness.
2015-07-17 13:37:18 +02:00
Markus Hitter 7acbf30e22 Configtool: ignore value options in board.metadata.
This solves the problem of choice menus being populated with too
many entries. Before, such menus would pick up values from
board.metadata as well as from the actually loaded file.

File printer.metadata contains no options, so no adjustment
needed there.
2015-07-17 13:37:11 +02:00
Markus Hitter 25c502d68b Configtool: save target candidate pins, not the metadata ones.
Previously, all the cancicates were replaced with the ones from
board.metadata, messing things up. Appears to work fine now,
candidates are preserved.
2015-07-17 13:37:04 +02:00
jbernardis fb922735fd Configtool: process a metadata file before reading header files.
This should allow for easier addition of defines as Teacup evolves.
2015-07-17 13:36:48 +02:00
Markus Hitter 6c7133792e Configtool: be helpful when trying to overwrite protected files. 2015-07-14 17:00:46 +02:00
Markus Hitter bf3dd74f54 Configtool: also try toolpaths in more recent OS Xs.
This should address one part of issue #165.
2015-07-13 10:59:01 +02:00
Markus Hitter a57ce1f046 Configtool: add nanoheart configuration to protected files list.
This was forgotten when adding this configuration.
2015-07-10 14:25:10 +02:00
Ruslan Popov aa401650a7 Configtool: add SD card select pin support.
For now on the general pinout page, may be moved to a separate tab
together with display stuff later. --Traumflug
2015-07-10 14:25:10 +02:00
Markus Hitter 80626eb528 Configtool: Add "Report problem" function.
The idea is to open the user's email client automatically, so
(s)he has not much more to do than to write a sentence about what
went wrong. As easy as possible!

This is work related to issue #159.
2015-07-01 16:42:36 +02:00
Markus Hitter 6f7a4122a0 Configtool: allow travel limits to be floats.
This is work related to issue #157.
2015-06-06 20:08:54 +02:00
Markus Hitter 75d110cb53 build.py: align sizes report.
No functional change.
2015-06-06 12:06:41 +02:00
Markus Hitter 0cab7ec540 Configtool: improve search for avrdude.conf.
Should now also work for Arduino 1.5.x and up.

This is work related to issue #158.
2015-06-06 12:06:41 +02:00
Markus Hitter f9d0a1bf35 Configtool: work around a ld.exe problem.
See committed comment for details.

This is related to issue #158.
2015-06-06 12:06:40 +02:00
Markus Hitter b74b066db5 Configtool: allow all Windows versions, not just "win32".
This is work related to issue #158.
2015-06-06 12:06:04 +02:00
Markus Hitter 8b63505d53 Configtool: find executables on Windows.
Probably no surprise for users of this platform, executables have
a .exe suffix :-)

This partially solves issue #158.
2015-06-06 12:05:13 +02:00
Markus Hitter eb122a96a5 Configtool: refine settings tooltips.
Most importantly, Arduino IDE tools can be used on any operating
system.
2015-05-31 21:50:08 +02:00
jbernardis 40c23e7970 Configtool: restore alignment of thermistor values in board file.
This should solve issue #154.
2015-05-31 12:53:57 +02:00
jbernardis 972e0cbb3d addsensordlg.py: fix a typo.
When choosing an SH preset, preset value 6 was assigned to both
parameter 6 and parameter 7.

This was mentioned in issue #155.
2015-05-31 11:44:53 +02:00
jbernardis 4597fd0c51 Configtool: reset/restore thermistor presets.
The sensor dialog now checks present values against the list of
presets. This means, if a preset is used and then modified, the
preset choice jumps to <none>. It also means presets are recognized
when modifying a temperature sensor.

This should solve issue #155.
2015-05-31 11:39:12 +02:00
Markus Hitter dbf43c8e78 Configtool: provide only free heater pins on heater creation. 2015-05-31 11:27:15 +02:00
Markus Hitter b813df95ff Configtool: add heater modify button.
Also turn PWM by default on.
2015-05-31 11:27:15 +02:00
Markus Hitter 0f5990b2eb Configtool: don't color heater/sensor list items.
Validation is no longer required, as we now validate in the
creation dialog already. And coloring one item in a two-item list
almost looks like this item were highlighted.
2015-05-31 11:27:12 +02:00
Markus Hitter b3bc26c6f4 Configtool: adjust background color of controls, too.
That is, buttons and choices. Coices apparently don't work. Tried
a bit on the table heaters of the sensor and heater lists, but
found nothing which would result in an effect. This control is
not exactly well documented.
2015-05-30 21:21:00 +02:00
Markus Hitter 9976640d92 Configtool: color background matching the background picture.
Actual color is easily changeable in Decoration, as this is a
Singleton.
2015-05-30 19:20:38 +02:00
Markus Hitter be16c98e59 Configtool: give the thing a nice background picture.
This is pure dessert topping, no functinal change. Well, eye candy
is important for acceptance. :-)
2015-05-30 18:41:02 +02:00
Markus Hitter da7a0d72a7 Configtool: improve search for avr-gcc & Co.
This should allow to build on any OS with Arduino IDE installed
and/or with avr-gcc & Co. available trough the normal shell.

Instead of looking at the current platform it's looked at wether
an Arduino IDE path is set. If yes, tools inside there are used.
If no such path is set, just the basename is used to let the OS
search for it ($PATH, etc.).

This is related to issue #152.
2015-05-30 18:40:04 +02:00
Markus Hitter 24b56b2bb1 Configtool: take account of Mac OS X's limited wildcard support.
According to documentation this shouldn't be neccessary, but
testing on Mac OS X 10.4.11 works only this way.

This helps a bit on issue #152.
2015-05-27 23:42:15 +02:00
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
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 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
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 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
jbernardis 452908afa9 Configtool: prevent negative numbers in thermistor tables. 2015-04-28 11:27:28 +02:00
jbernardis 05bfea40de Configtool: refresh data structures when saving.
Solves Issue #120.
2015-04-25 16:33:27 +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
jbernardis 48433a6254 Configtool: added logic to generate thermistor temp tables.
Also enable editing of temperature sensors.
2015-04-21 02:51:32 +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 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
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 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 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
Markus Hitter e2e77ae927 Configtool: remove version information.
Teacup doesn't do releases, it's a rolling release :-)
2015-04-21 02:11:01 +02:00