Commit Graph

91 Commits

Author SHA1 Message Date
Nico Tonnhofer bf72cb7f10 python3: pep8 all files.
e.g. 4 spaces for identation
using black for this:
https://github.com/ambv/black
2019-04-18 09:10:37 +02:00
Phil Hord 77d8583cca Add dynamic 3-point bed-leveling support
Adds G29 commands to register bed level points.  When three points
are registered, the plane of the bed is calculated and dynamic bed
leveling takes effect.

Add a warning if bed-leveling is enabled when MAX_JERK_Z is zero.
In this case lookahead will always fail when bed-leveling is active
since the Z-axis is not allowed to move during lookahead.
2018-08-20 10:38:10 -07:00
Markus Hitter 448a040f9a check_configtool.sh: don't ignore whitespace entirely.
Instead, any amount of whitespace is treated equally.

Example of a failure not noticed before:

  //#define Z_DIR_PIN  PA_8
  //#define Z_DIR_PINPA_8
2017-12-31 17:26:09 +01:00
Markus Hitter 00aab9f01d check_configtool.sh: show unified diffs.
They're clearer about which change version is in what file.
2017-12-31 17:23:15 +01:00
Nico Tonnhofer 4882d19215 heater: if pwm is set to 1, hardware pwm is forced, if available. 2017-03-21 15:04:26 +01:00
Nico Tonnhofer 4abc3aa2f0 heater: software pwm with delta sigma algorithm
@triffid points me to the delta sigma algorithm. This is pretty nice
for slow updating routines. Others than normal PWM, this scale better
for slow frequencies.

This algorithm is a mix of
https://www.mikrocontroller.net/topic/293454#3128867
and
https://github.com/Smoothieware/Smoothieware/blob/29e80/src/libs/Pwm.cpp#L55
2017-03-21 14:51:08 +01:00
Phil Hord ab2c355821 Factor out some boilerplate code from configs
Configs are always included via a config_wrapper.h now, and configs always
must include this safety-definition for a missing DEFINE_HEATER.  Let's
simplify the configs by moving it to a common location.
2017-03-21 14:48:19 +01:00
Nico Tonnhofer f8c78e6384 heaters: add max heater value
You can reduce the max. power of each heater.
With the max_pwm value between 1 and 100% you reduce the active pwm.
For example you could reduce the power of your hotend.

My hotend for example is 12V 30W but connected to 24V. So it has
normally 120W. This is very huge. Setting the max_pwm to 25, it has
again ~30W.
2017-03-21 14:48:15 +01:00
Nico Tonnhofer 2da993220e STM32F411: add CNC Shield V3 for Nucleo to the series of regression tests.
Now Nucleo F411RE based boards are covered as well :-)
2017-03-03 18:54:56 +01:00
Nico Tonnhofer e52b1d2a69 DDA:testing steps
start the simulation with ./parse_clean xyz, where 'xyz' can be anything to name the created files.

in the end you will get 3 pictures.
swan-reference-xyz.png how it should looks like.
swan-current-xyz.png how it will looks now.
swan-diff-xyz.png is the difference.

This 3 pictures show only the X-axis.

you will get also a forth file. pp-xyz.asc. you can open this file for example with meshlab and you can see that current model in 3d.

If you want to use your own gcode, please do the following:
Create a normal gcode. Delete any M116 (temp waitings). Maybe you want also deleting comments.
Then add M114 for every x line.
I do this with the swan-test.gcode:
sed '1~2 s/$/\nM114/g' < swan.gcode > swan-test.gcode
2017-02-13 19:03:21 +01:00
Nico Tonnhofer 2ce27fd5f7 run-in-simulavr.sh: repair report.
Use the CONFIG setup some lines before. So it will also work when running this script solely.
2017-02-11 23:59:58 +01:00
Phil Hord 1e9cb8b8e1 dda->id is needed even when !LOOKAHEAD
In `ACCELERATION_RAMPING` code we use the dda->id field even when we do
not enable `LOOKAHEAD`. Expose the variable and its related `idcnt`
when `ACCELERATION_RAMPING` is used.

Add a regression-test to catch this in the future.
2017-02-01 10:21:48 -08:00
Wurstnase 3c3500b388 Testcases: run them faster.
Simple trick: raise the feedrate, no need to care about a milling
bit when running a simulation. This reduces simulated time and as
such, duration of the simulation (by about 50%).

Also remove G-code which was never executed because simulations
are chopped at 1 minute of simulation time and smooth-curves.gcode
took about 1.5 minutes.

Step pulse measurements remain about the same:

  ATmega sizes               '168   '328(P)   '644(P)     '1280
  Program:  17944 bytes      126%       59%       29%       14%
     Data:   1920 bytes      188%       94%       47%       24%
   EEPROM:     32 bytes        4%        2%        2%        1%

  short-moves.gcode statistics:
  LED on occurences: 888.
  LED on time minimum: 202 clock cycles.
  LED on time maximum: 380 clock cycles.
  LED on time average: 232.092 clock cycles.

  smooth-curves.gcode statistics:
  LED on occurences: 22589.
  LED on time minimum: 194 clock cycles.
  LED on time maximum: 423 clock cycles.
  LED on time average: 254.425 clock cycles.

  triangle-odd.gcode statistics:
  LED on occurences: 1636.
  LED on time minimum: 220 clock cycles.
  LED on time maximum: 380 clock cycles.
  LED on time average: 245.575 clock cycles.
2016-12-15 20:12:41 +01:00
Markus Hitter 766bd52337 Testcases: add straight-speeds-Fsep.gcode.
Distinction between straight-speeds.gcode and
straight-speeds-Fsep.gcode is that the latter has all speed
changes in a seperate line. If queueing works properly and
nullmoves get removed, both should produce identical results.
2016-11-27 16:05:30 +01:00
Markus Hitter d03305b989 Renew GtkWave save file.
GtkWave has apparently changed its save file format without
backwards compatibility. Content should be the same as before.
2016-11-27 16:05:30 +01:00
Markus Hitter 92516b55ea run-in-simulavr.sh: enable size report.
Apparently this got forgotten earlier.
2016-11-21 19:56:19 +01:00
Markus Hitter 6e87ee5f96 Makefile-AVR: add a target for our standard performance test.
Our standard performance test is to run these three G-code files
in SimulAVR and recording step pulse timings. While this certainly
doesn't cover everything related to possible performance
measurements, it's a good basic standard to compare code changes.

Current performance:
  ATmega sizes               '168   '328(P)   '644(P)     '1280
  Program:  19808 bytes      139%       65%       32%       16%
     Data:   2191 bytes      214%      107%       54%       27%
   EEPROM:     32 bytes        4%        2%        2%        1%

  short-moves.gcode statistics:
  LED on occurences: 888.
  LED on time minimum: 308 clock cycles.
  LED on time maximum: 729 clock cycles.
  LED on time average: 317.393 clock cycles.

  smooth-curves.gcode statistics:
  LED on occurences: 23648.
  LED on time minimum: 308 clock cycles.
  LED on time maximum: 726 clock cycles.
  LED on time average: 354.825 clock cycles.

  triangle-odd.gcode statistics:
  LED on occurences: 1636.
  LED on time minimum: 308 clock cycles.
  LED on time maximum: 719 clock cycles.
  LED on time average: 336.327 clock cycles.
2016-11-21 19:54:59 +01:00
Markus Hitter e9b2bf45cb Config files: update comment/help text for USE_INTERNAL_PULLUPS. 2016-09-30 13:51:01 +02:00
Markus Hitter e49de09f58 Config files: introduce USE_INTERNAL_PULLDOWN. 2016-09-30 13:48:46 +02:00
Markus Hitter 0555299717 Regressiontests: add test for ACCELERATION_TEMPORAL. 2016-07-09 13:53:57 +02:00
Markus Hitter 76efe06284 Regressiontests: add a test for ACCELERATION_REPRAP. 2016-07-09 13:48:56 +02:00
wurstnase 66f06d20a2 Temp: change TEMP_EWMA to integer.
This allows to use EWMA_ALPHA in an #if clause, which is needed
for the next commit.

Review changes by Traumflug: made changes to comments more
complete, added rounding ("+ 500") and also adjusted Configtool
for the change.
2016-06-25 14:30:59 +02:00
Markus Hitter 11e907de03 Configtool: also deal with PS_INVERT_ON.
This partially solves issue #165.
2016-06-11 13:10:09 +02:00
Markus Hitter bcfb13d4e2 Regression tests: make sure we have a valid thermistor table.
So far it worked only if the user happened to have a table for
two thermistors. Having a table for only one thermistor made all
regression tests fail.
2016-06-07 20:15:10 +02:00
Markus Hitter d51edaf705 Regression tests: remove the script based integrity test.
Looks like it's obsolete now, superseeded by the one actually
running Configtool.
2016-06-06 14:18:08 +02:00
Markus Hitter fdf9534ed9 check_configtool.sh: comment on comment stripping. 2016-06-06 14:18:08 +02:00
Markus Hitter b3f77a89b2 check_configtool.sh: remove test files on success. 2016-06-06 14:18:02 +02:00
Markus Hitter e35fe22f74 check_configtool.sh: allow spaces in paths.
To the best of my bash script knowledge, this also means we have
to break on the first error, because pipe terms run in a subshell,
so they can't pass variables to the parent.
2016-06-06 14:15:14 +02:00
Phil Hord 21ac717d6d Configtool: add integrity tests for Configtool output.
Add a test that puts the stock config files through the
Configtool input/output parsers and verifies the output matches
the input.  If Configtool breaks down in the future and produces
different output, this should catch it.

If this fails because of some intentional change in the tool or
in the stock config files, then the tool or stock config files
should be updated to be compatible again before merging the result.
2016-06-06 12:36:53 +02:00
Markus Hitter 813bdf4452 Display: add regression test for 4-bit bus and HD44780 display.
(Ab)use the old Gen7 v1.3 configuration for this, as this is
rarely in use and because this board also happens to be the board
where the tested code was developed on.
2016-05-30 14:10:25 +02:00
Markus Hitter b9fe0a5dd0 Configtool: learn about 4-bit bus pins. 2016-05-30 13:41:13 +02:00
Markus Hitter 0947c5ba50 Configtool: learn about DISPLAY_TYPE_HD44780.
This replaces DISPLAY_TYPE_LCD1302, because LCD1302 has no
actual implementation, yet.
2016-05-30 11:05:50 +02:00
Phil Hord 92a303c607 Add testcase for corexy homing bug 2016-05-26 11:22:12 +02:00
Markus Hitter bb56874088 Regressiontests: add a test for ATmega328, I2C, SSD1306. 2016-05-06 20:34:18 +02:00
Markus Hitter 535fa0c171 check_integrity.sh: remove the -c option from awk invocations.
Ubuntu now (16.04) comes with 'mawk', which doesn't recognize the -c
option, so simply remove it. Its meaning was to switch into 'traditional'
mode.
2016-05-06 19:37:56 +02:00
Markus Hitter a97ec8a376 Display: introduce displaybus.h.
This is a broker for mapping display bus calls to the bus actually
in use.
2016-04-26 14:13:15 +02:00
Markus Hitter 4645715f18 Configtool: make KINEMATICS a set of booleans, too.
Reasons:

 - Less code, easier handling.

 - An entire case of configuration handling could be removed.

 - Better class-like encapsulation.
2016-04-20 22:02:07 +02:00
Markus Hitter 1fad0036a7 Configtool: replace DISPLAY_TYPE with a set of booleans, too.
Same reason, same procedure as the previous commit.
2016-04-20 22:00:47 +02:00
Markus Hitter 90969978df Configtool: replace DISPLAY_BUS parameter with a set of booleans.
Having a choice with a defined set of options is nice, but it
also requires these options to be #defined somewhere _before_
entering config.h. To keep class-like encapsulation, we'd need
two header files for each code unit, one for the options, another
one for the usual header.

That said, we use other examples of such options, e.g. CPU, F_CPU
or KINEMATICS. For CPU and F_CPU it works fine, because their
options are numbers or other values known by the compiler. For
KINEMATICS it kind of works, because this #define is used in only
one place ... and there it's suboptimal already, because no option-
set.

Anyways, I was unsure about this change and if it turns out to be
a poor decision later, it can be reverted.
2016-04-20 22:00:05 +02:00
Ruslan Popov 212eca7f8e Configtool: add display page implementation.
Most work by Ruslan Popov, collected from various commits and
made compatible with regression tests by Traumflug.

Display test code is now enabled by #defining DISPLAY_BUS to
i2c_twi.
2016-04-20 21:56:39 +02:00
Witold Sowa fdf6dbe849 Added support for MCP3008 and MCP3004 ADC for temperature read 2016-04-12 22:37:50 +02:00
Markus Hitter 67f0f6ef0e check_integrity.sh: move to a less user visible place.
No functional changes.
2016-04-12 00:11:43 +02:00
Markus Hitter 595dd017ea Fix config files which didn't pass the new regression test.
All the changes are pretty much dummies, no functional change
anywhere.
2016-03-28 01:34:07 +02:00
Markus Hitter 4c205704ad config.h.Profiling: add Z_AUTODISABLE here, too. 2016-03-27 20:41:36 +02:00
Phil Hord 6ef35a11f2 Add test for "no endstops defined" build
This configuration used to fail.  Now it's fixed.  Test the
configuration to ensure it doesn't break again in the future.
2015-11-18 14:53:12 -05: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 ab910ee1c4 ARM: add Gen7-ARM to the series of regression tests.
Now ARM based boards are covered as well :-)
2015-08-12 14:26:36 +02:00
Markus Hitter fa8ec35bc1 run-in-simulavr.sh: report LED on time in clocks instead of ns. 2015-08-04 23:03:51 +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