909 Commits

Author SHA1 Message Date
Kevin O'Connor
e4dac1039d docs: Update release notes for v0.7.0 release
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-20 09:15:24 -05:00
Kevin O'Connor
269305fa23 test: Add printer-creality-cr20-2018.cfg to printers.test
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-19 20:51:58 -05:00
Kevin O'Connor
e820ea3141 config: Add printer-micromake-d1-2016.cfg example config file
Reported by IRC user "Xantos".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-18 20:59:43 -05:00
Kevin O'Connor
531575651c bltouch: Document that bltouch "clones" may not work correctly
There is concern that the bltouch.py module may not perform adequately
on some bltouch "clones".  Document that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-18 17:12:44 -05:00
Kevin O'Connor
d0f09727a9 bltouch: Issue both a "reset" and a "pin_up" after a successful probe
Not all BLTouch clones raise the pin on a "reset" request, so
explicitly send a "pin_up" command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:46 -05:00
Kevin O'Connor
ccc25a03d5 bltouch: Add a config option to disable the bltouch sensor test
It appears some bltouch "clones" do not report the probe as triggered
when put in "touch mode" while the pin is raised.  Add a config option
to allow users to disable the test.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:41 -05:00
Kevin O'Connor
ce064e6e2d bltouch: Always make sure to check the endstop at least every 1ms
Some of the bltouch implementations may only respond to a probe event
with a 5ms pulse.  Make sure to check the signal pin at least every
millisecond to ensure no signal is lost.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:27 -05:00
Uri Shaked
79d65d8ead config: Fix CR-20 click pin polarity
Signed-off-by: Uri Shaked <uri@urishaked.com>
2018-12-15 18:38:03 -05:00
Uri Shaked
cc4227aec8 config: Add printer config for the CR-20 by Creality3D
Signed-off-by: Uri Shaked <uri@urishaked.com>
2018-12-15 17:42:23 -05:00
Yannic Schroeder
f100d75c19 stm32f1: Always read SPI receive buffer
Otherwise the first byte read via SPI may be the last byte
of the previous transfer

Signed-off-by: Yannic Schroeder <schroeder@ibr.cs.tu-bs.de>
2018-12-14 12:25:35 -05:00
TronskiFPV
ef4f84e3ae config: Update printer-creality-ender3-2018.cfg (#959)
Added options necessary for basic extruder calibration expected of a new install. Fixed bed size to correct 235x235. Removed 0.5 position_endstop setting as this crashes hot end into the bed on stock Ender 3's.

Signed-off-by: Troy nadeau <troyboy162@hotmail.com>
2018-12-05 16:43:14 -05:00
Kevin O'Connor
76b57ba05a bltouch: Fix typo in pin_move_time parsing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-04 11:43:04 -05:00
Kevin O'Connor
44aa5def73 bltouch: Allow the pin_move_time to be configured
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-04 10:34:54 -05:00
Kevin O'Connor
e0b2d7c51d bltouch: Add a BLTOUCH_DEBUG command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-03 22:52:32 -05:00
Kevin O'Connor
aac92ffb91 bltouch: Fix bug - must restore stepper position after homing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-01 22:09:06 -05:00
Kevin O'Connor
6df7356baa samd21: Fix gpio in support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 23:10:23 -05:00
Kevin O'Connor
e505ab0df1 samd21: Add support for flashing an application via the bossac tool
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 22:22:42 -05:00
Kevin O'Connor
f2179da8ad samd21: Add support for hardware pwm
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 20:00:59 -05:00
Kevin O'Connor
0fd2dd7c11 samd21: Minor simplification to timer init code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:50:50 -05:00
Kevin O'Connor
d6f3f6b664 samd21: Add support for SPI
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:50:50 -05:00
Kevin O'Connor
58d61c7887 samd21: Add support for basic i2c support (write only)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:50:50 -05:00
Kevin O'Connor
6d90ebe6f8 samd21: Use GPIO() macro when calling gpio_peripheral()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:50:50 -05:00
Kevin O'Connor
0af0bc946e samd21: Enable watchdog
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:50:50 -05:00
Kevin O'Connor
afa58de014 samd21: Try to clarify the "generic clock generator" configuration
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:50:50 -05:00
Kevin O'Connor
3a47d972db i2ccmds: Validate the i2c address
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:50:50 -05:00
Kevin O'Connor
db4f0c24cd spicmds: Check for an incorrect mode in spicmds.c
Check the mode parameter in spicmds.c so that the mcu code does not
need to check it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:50:48 -05:00
Kevin O'Connor
6b108aa885 stm32f1: Move ADC and SPI code from gpio.c to spi.c and adc.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:42:54 -05:00
Arksine
581b1439f3 config: Update bed_mesh in example-extras.cfg
Update documentation about the fade options. Also inform the user that it is recommended to home toward the center of the print area when using a probe for z homing.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-11-30 11:37:21 -05:00
Arksine
cf6a56cebf bed_mesh: Introduce fade_target option
To deal potential z scaling when fade is enabled, a fade_target option has been introduced.  This option may either be set to 0.0 or any z position within the range of the mesh.  A value of 0.0 will result in previous behavior, where z adjustment phases out until no further adjustment is added.  A non-zero value will phase out adjustment until the target has been reached, after which the rest of the print will be offset along the z axis by the fade_target.  By default the fade_target will be calculated as an average of the mesh.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-11-30 11:37:21 -05:00
Arksine
35f41b7402 bed_mesh: Disable z-adjustment fade by default.
Due to various potential issues with fading out z-adjustment, it is better to disable by default and allow users to opt-in.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-11-30 11:37:21 -05:00
Kevin O'Connor
824e55d75a bltouch: Add initial support for a bltouch "extras" module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:34:20 -05:00
Kevin O'Connor
f01ced8ed4 config: Rework sample-bltouch.cfg into sample-probe-as-z-endstop.cfg
The example configuration information is more useful for general probe
as z_endstop than as a bltouch example.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:34:20 -05:00
Kevin O'Connor
7699304f9b graphstats: Change stats filter to use print_time instead of bytes_write=0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-26 17:37:04 -05:00
ruevs
b8f92c73ed config: Make the Anycubic delta configurations as similar as possible
Signed-off-by: Peter Ruevski <dpr@ruevs.com>
2018-11-25 17:14:16 -05:00
Kevin O'Connor
a726c58671 mcp4451: Minor update - remove unnecessary mcu import
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-24 00:36:49 -05:00
Kevin O'Connor
147d805231 mcp4451: Use bus.py helper code for i2c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-24 00:33:22 -05:00
Kevin O'Connor
729a2e8306 avr: Add support for sending I2C messages
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-23 23:49:26 -05:00
Kevin O'Connor
e5150fe187 uc1701: Add support for SSD1306 in i2c mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-23 22:04:06 -05:00
Kevin O'Connor
043170265b i2ccmds: Minor whitespace changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-23 21:36:44 -05:00
Kevin O'Connor
d2aa78c16a uc1701: Cache icons and fonts in byte display order
This reduces the amount of bit manipulaton needed during screen
updates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor
065a8eb826 uc1701: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor
a79d87ca8e uc1701: Add all_framebuffers to reduce vram indexing in the code
Add a self.all_framebuffers variable and change self.vram to only
contain the new display data.  This allows the main code to access the
self.vram member variable without the need to index for current/old
data.  (It also updates the code to match the latest st7920 and
hd44780 code.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor
e231ac7422 uc1701: Add support for SSD1306 displays
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor
a00d7b418f display: Add a get_dimensions() method to lcd chip classes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor
cbbc6801a0 lpc176x: Enable full speed peripheral clocks on SPI and I2C
Scale the bus speed within the peripheral instead of on the system bus
as scaling on the system bus slows down general register access to the
peripheral.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:44:39 -05:00
Kevin O'Connor
4bbd631086 lpc176x: Add an enable_peripheral_clock() helper function
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:44:18 -05:00
Kevin O'Connor
9ba94ded9e tmc2660: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor
1c71ea27e0 uc1701: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor
5bb0bd755d tmc2130: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor
ab6a8ec76e ad5206: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor
be58c7f8ec replicape: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor
7cadd8d3f4 spi_temperature: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor
58890e32a2 bus: Add klippy/extras/bus.py module with SPI bus helper code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor
7bb9ce8436 avr: Minor comment update in hard_pwm.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-20 13:14:53 -05:00
Kevin O'Connor
7c65e76ad0 avr: Rework hardware pwm pin definitions
Simultaneously define the hardware pin and the timer registers.  This
makes the table a little easier to understand.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-20 12:58:33 -05:00
Kevin O'Connor
bf92ffb5bf avr: Split gpio.c into gpio.c, adc.c, hard_pwm.c, and spi.c
Split up gpio.c into multiple files in an effort to make the code a
little more understandable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-20 12:58:33 -05:00
Kevin O'Connor
2cc0313b72 avr: Add initial support for atmega32u4 chips
Signed-off-by: Trevor Jones <trevorjones141@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-20 12:58:33 -05:00
Kevin O'Connor
31687bc009 avr: Minor update to help text in Kconfig
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-19 22:05:26 -05:00
Kevin O'Connor
76f07979bb buildcommands: Make sure to not use 96 or more message ids
The mcu code assumes the encoder and parser id is always one byte.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-18 11:00:37 -05:00
Kevin O'Connor
150cae1d1f buildcommands: Remove unnecessary spaces from data dictionary
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-18 04:17:25 -05:00
Kevin O'Connor
9db0bec792 buildcommands: Detect duplicate strings when generating static string ids
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-18 03:13:31 -05:00
Kevin O'Connor
b3e8429b54 buildcommands: Move data dictionary generation to its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-18 03:11:00 -05:00
Kevin O'Connor
95e4c2d617 buildcommands: Move version generation to its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-18 03:06:52 -05:00
Kevin O'Connor
9f420f71a5 buildcommands: Move command/response code generation to its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-18 03:06:52 -05:00
Kevin O'Connor
67a5cd0409 buildcommands: Move DECL_CONSTANT code to its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-18 03:06:52 -05:00
Kevin O'Connor
334507306b buildcommands: Move DECL_STATIC_STR code to its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-18 03:06:52 -05:00
Kevin O'Connor
9cb98a00fc buildcommands: Move DECL_CALLLIST code to its own class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-18 03:04:18 -05:00
Kevin O'Connor
bb41765714 docs: Minor update to Code_Overview.md with further kinematics info
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-17 14:56:46 -05:00
Kevin O'Connor
cd1e669306 docs: Fix typo in command dispatch benchmarks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-16 20:38:30 -05:00
Kevin O'Connor
64a1837fec docs: Round pru command parsing benchmark
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-16 20:31:41 -05:00
Kevin O'Connor
c349863988 docs: Add information on command parsing benchmarks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-16 20:21:05 -05:00
Kevin O'Connor
52fa91fb9a docs: Update benchmarks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-16 18:59:55 -05:00
Kevin O'Connor
b161a69e98 timer_irq: Increase maximum busy wait time to 2us
Increase the amount of time to "busy wait" in the timer dispatch loop
to 2 micro-seconds.  This, in practice, causes stepper step and unstep
events to occur within a single hardware interrupt.  Doing that helps
stabilize the single active stepper performance benchmarks.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-16 17:16:50 -05:00
Kevin O'Connor
ac72f8ec78 console: Try to improve the description of the SUPPRESS command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-16 17:16:14 -05:00
Kevin O'Connor
f3c4deb1ab lpc176x: Convert i2c code to use standard i2ccmds.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-14 10:23:56 -05:00
Kevin O'Connor
f973886dac docs: Minor rewording in Endstop_Phase.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-14 09:46:21 -05:00
Jiri Dobry
e541466591 servo: This patch create ability to enable/disable attached servo. (#880)
Cheap mechanical servos have small flickering. When this servo stay on one position, this flickering slowly destroy internal potentiometer and make servo unusable. Many mechanisms need servo only to change position. Therefore I create this minor path to enable/disable servo. It stop pulses for this servo, that's all.

Corresponding G-code is:
SET_SERVO SERVO=config_name [WIDTH=] [ENABLE=<0|1>]
SET_SERVO SERVO=config_name [ANGLE=] [ENABLE=<0|1>]

For example:
SET_SERVO SERVO=touch ANGLE=80 ENABLE=1 ; enable servo and set position
G4 P200 ; wait 200ms
SET_SERVO SERVO=touch ENABLE=0 ; disable servo

This patch add one option to servo configuration:
enable: <False/True> # default True

It not have impact to user code existing already because it is optional parameter and default value is same as original behavior.

Signed-off-by: Jiri Dobry <jdobry@centrum.cz>
2018-11-14 09:38:09 -05:00
Kevin O'Connor
31730fa031 docs: Minor wording change to Endstop_Phase.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-13 18:44:33 -05:00
Kevin O'Connor
c55842b428 docs: Note when endstop phases are useful in Endstop_Phase.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-13 18:36:00 -05:00
Kevin O'Connor
8d4f7db66e docs: Fix typo in Bootloaders.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-13 14:41:51 -05:00
Kevin O'Connor
097e6c524b docs: Fix link in FAQ document
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-13 14:40:35 -05:00
Kevin O'Connor
077280bb62 config: Use consistent advice on flashing the Melzi board
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-13 14:32:52 -05:00
Kevin O'Connor
5f9ce32fae docs: Be more clear that a baud of 250000 is recommended
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-13 14:06:27 -05:00
ndupont-net
ccb660a0ea config: sample-macros.cfg creation and M300
Implementation of M300 "Play Tone"

Signed-off-by: Nicolas Dupont <ndupont@ndupont.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-13 12:42:10 -05:00
Kevin O'Connor
22f7be8b74 config: Add printer-velleman-k8200-2013.cfg example config
Based on config from @PerLangkjaer.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-13 10:46:57 -05:00
James
b45ccfea97 display: FR icon changed to "Feed Rate" (#860)
Signed-off-by: James Wood <j@j-w.co>
2018-11-13 10:14:01 -05:00
Lucas Fink
f6c2e8b4eb bed_mesh: Fix some fragile identity comparisons
Signed-off-by: Lucas Fink <software@lfcode.ca>
2018-10-31 16:02:45 -04:00
Florian Heilmann
3da7697c66 config: Add generic duet2 config and tests (#834)
This adds a generic duet config with quad-z and quad extruders which also tests TMC2660 and SX1509 extras

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-31 09:58:43 -04:00
Florian Heilmann
b98e12c19a sx1509: Relax restrictions on SX1509 pins (#836)
This allows SX1509 pins to be used as temperature fans and heater fans. Heaters are still disallowed.

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-30 18:08:12 -04:00
Florian Heilmann
3328ade194 tmc2660: Fix typo in TMC2660 extra (#830)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-29 12:44:45 -04:00
Kevin O'Connor
8432f6f40c avr: Add support for atmega328p
The atmega328p is basically the same as the atmega328 - add explicit
support for it so that avrdude doesn't complain while flashing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-29 11:55:15 -04:00
Florian Heilmann
90bc3be6a0 Add DUMP_TMC capabilities to the TMC2660 extra
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-28 18:45:49 -04:00
Florian Heilmann
4372d1812c Implement idle event support in the TMC2660 extra
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-28 18:45:49 -04:00
Kevin O'Connor
d25e02144c idle_timeout: Add printing/ready/idle tracking
Internally track the overall printer state.  Generate events on state
transitions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-28 18:39:45 -04:00
Kevin O'Connor
a5e55c2acc gcode: process_batch() should execute commands atomically
Update the process_batch() method so that it will not interleave
commands read from the input fd with the batched commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-28 18:39:45 -04:00
Kevin O'Connor
37b9a2442f config: Add lcd encoder pins to generic-rumba.cfg
Reported by @elJosho.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-28 14:34:22 -04:00
Kevin O'Connor
c4058f71fb docs: Clarify M109/M190 in G-Code documentation
Signed-off-by: Lucas Fink <software@lfcode.ca>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-28 14:22:30 -04:00
Kevin O'Connor
057acb07b7 docs: Add a Slicers.md document
Add some information on configuring a slicer for use with Klipper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-28 10:47:32 -04:00
Kevin O'Connor
47e45ab391 docs: Note the use of gcode_macro in G-Codes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-28 10:38:03 -04:00
Kevin O'Connor
4f89251f03 sx1509: Raise an error if a pin max_duration is not zero
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-27 12:22:23 -04:00
Kevin O'Connor
c3f916c60e delta: Make sure to clear limit_xy2 after a homing move
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-27 11:54:17 -04:00
Kevin O'Connor
936a4acd0d delta: Make sure to also exempt the homing retract move from boundary checks
Commit 459e5219 added a special case to the boundary checks to permit
homing moves.  In some cases, the second home retract could also be
outside the normal boundary checks - extend the special case to also
permit that move.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-27 11:43:24 -04:00
lf
a33792f07e util: Fix versioning when gitdir is absent (#809)
The gitdir previously could be absent and produce a version of "" in
spite of checks for it. Fixed.

Parent directories with shlex-interpreted characters in their names
could be misinterpreted. Removed shlex parsing.

Packagers may want to remove the git history to slim down the package
size, so add an option for using a file 'version' in the klippy
directory to set version without using git.

Signed-Off-By: Lucas Fink <software@lfcode.ca>
2018-10-27 10:44:38 -04:00
Florian Heilmann
f57c29442c Add SX1509 extra
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-27 10:34:28 -04:00
Florian.Heilmann
99989a668f Implement I2C support in the SAM4E8E port
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-27 10:34:28 -04:00
Florian.Heilmann
5a919c892a Add generic i2c interface
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-27 10:34:28 -04:00
Kevin O'Connor
24bbc43fd0 config: Add encoder pins to printer-anycubic-kossel-plus-2017.cfg
Reported by @obalado.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-25 21:34:49 -04:00
Kevin O'Connor
97590b8e0b extruder: Don't use max_extrude_cross_section in max_extrude_only defaults
Some users increase max_extrude_cross_section to avoid issues with
some slicers.  However, increasing that value also increases the
defaults for the max_extrude_only parameters which is not obvious.
Base the max_extrude_only defaults only on the configured nozzle
diameter.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-25 19:09:47 -04:00
Kevin O'Connor
ed13c5733d config: Update wording of extruder parameters in example.cfg
Try to improve the description of the extruder config limits.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-25 19:09:47 -04:00
Kevin O'Connor
a7c8476e98 docs: Update pressure advance doc to note it only impacts the extruder
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-25 19:09:47 -04:00
Kevin O'Connor
3d7e8fa5ec docs: Note impact of warping during pressure advance tuning
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-25 12:10:47 -04:00
Kevin O'Connor
ca7dd8bfd4 docs: Update Pressure_Advance.md - don't set square_corner_velocity=0
Setting the square corner velocity to zero would cause stuttering
during the test if a bed mesh is in effect.  It's possible to get the
desired effect by reducing the square corner velocity and setting the
pressure advance lookahead time instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-25 11:43:03 -04:00
Kevin O'Connor
363bcfb233 logextract: Make sure config files end with a newline
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-24 16:02:03 -04:00
Florian Heilmann
b6bf455155 tmc2660: Add endstop phase detection functionality to TMC2660 extra (#816)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-10-24 16:01:12 -04:00
Kevin O'Connor
1a437c1fd1 sam3x8e: Don't report an error if bossac errors during device restart
Sometime bossac reports an error during chip restart.  It appears this
error is spurious - just suppress it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 17:41:29 -04:00
Kevin O'Connor
04a12ec9bd docs: Update stm32f1.md - usb is now supported.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 13:22:58 -04:00
Kevin O'Connor
e4bb90a1ca bed_mesh: Do not automatically run G28 on BED_MESH_CALIBRATE / BED_MESH_MAP
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 11:26:01 -04:00
Kevin O'Connor
f382762962 bed_tilt: Do not automatically run G28 on BED_TILT_CALIBRATE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 11:26:01 -04:00
Kevin O'Connor
925562cfb1 delta_calibrate: Do not automatically run G28 on DELTA_CALIBRATE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 11:26:01 -04:00
Kevin O'Connor
ca04caa42c docs: Fix SAM4E8E benchmark test revision
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 11:21:43 -04:00
Kevin O'Connor
2b81b2935c docs: Update SAM4E8E benchmarks
New benchmark numbers reported by @FHeilmann.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 11:18:55 -04:00
Kevin O'Connor
34c3cb5c01 sam4e8e: Enable SAM4 cache at startup
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-22 11:16:18 -04:00
Kevin O'Connor
7fac0de1f8 config: Add display buttons to printer-creality-cr10s-2017.cfg
Reported on IRC by gueee.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-20 19:27:53 -04:00
Kevin O'Connor
b903f84c80 docs: Replace get_status example with get_clock in Protocol.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-20 11:53:32 -04:00
Kevin O'Connor
7efbc021a5 pid_calibrate: Add some comments on the calibration methodology
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-19 22:40:11 -04:00
Kevin O'Connor
e30053f2a9 test: Add printer-adimlab-2018.cfg to printers.test
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-19 11:12:20 -04:00
Jason Rahaim
c7f0d039ac config: ADIMlab Add support for LCD knob and caselight
Signed-off-by: Jason Rahaim <jason@jasonr.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-19 11:10:32 -04:00
Kevin O'Connor
29e0996858 display: Check for M117 inside of draw_status()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-18 20:43:43 -04:00
Kevin O'Connor
2549ccd722 klippy: No need to return anything from _connect() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-18 15:58:52 -04:00
Kevin O'Connor
530a37196c docs: Update LPC176x benchmarks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-18 09:55:02 -04:00
Kevin O'Connor
8fca908445 lpc176x: Divide system clock within timer; not on system bus
Scaling the timer on the system bus has a notable impact on
performance.  So, scale the timer within the timer hardware itself.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-18 09:37:47 -04:00
Kevin O'Connor
0079311b0b docs: Add an Endstop_Phase.md document
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:49 -04:00
Kevin O'Connor
1e71909d02 endstop_phase: Add support for an ENDSTOP_PHASE_CALIBRATE command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:49 -04:00
Kevin O'Connor
def524bdf4 endstop_phase: Add support for detecting phase via TMC stepper drivers
The Trinamic stepper motor drivers are capable of reporting the
stepper phase - add support for using that capability to the
enddstop_phases module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:23 -04:00
Kevin O'Connor
a2df01b88e endstop_phase: Move endstop phase homing code to new "extras" module
Move the endstop phase tracking code from stepper.py to a new
extras/endstop_phase.py module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:23 -04:00
Kevin O'Connor
216905ceca klippy: Add a basic event dispatch mechanism
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:23 -04:00
Kevin O'Connor
fedf90680e homing: Pass printer instead of toolhead object to Homing class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:23 -04:00
lf
e7498fa241 chelper: Add a quick __main__ to compile c helper (#782)
Signed-off-by: Lucas Fink <software@lfcode.ca>
2018-10-16 12:21:18 -04:00
Jason R
dd5695405f config: Add ADIMLab 3d printer (#781)
Configuration for ADIMLab printer. tested and working including LCD support. 

This printer was previously known as the HCmaker7

Signed-off-by: Jason Rahaim <jason@jasonr.com>
2018-10-16 12:07:47 -04:00
Kevin O'Connor
08d03ae0eb configfile: Strip trailing comments
The Python 2.x ConfigParser doesn't support stripping of trailing '#'
style comments.  Do that manually before parsing the config.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 11:45:20 -04:00
Kevin O'Connor
368703fd78 delta_calibrate: Perform coordinate descent in a background process
Run the coordinate descent in a background process so that the main
thread does not block.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-15 19:01:19 -04:00
Kevin O'Connor
46355f903e toolhead: Don't clear sync_print_time on a get_next_move_time() call
Only clear the internal sync_print_time flag if the code performs a
regular "lazy" flush of the look-ahead queue.  This helps build the
look-ahead queue even when running internal scripts.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-15 18:24:15 -04:00
Kevin O'Connor
21597f9b07 gcode: Report state message after any error in a STATUS response
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-13 17:24:37 -04:00
Kevin O'Connor
55eed2e9be gcode: Remove "Preparing to restart" message
Now that "Klipper state" messages are proactively sent, it is
redundant to send the "preparing to restart" message.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-13 17:21:15 -04:00
Kevin O'Connor
f5c99c1dec docs: Update benchmarks for Arduino Due
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-13 11:57:13 -04:00
Kevin O'Connor
67278a6d8a sam3x8e: Align loops to a 16 byte boundary
It appears the sam3x8e has a primitive cache prefetch mechanism (it
prefetches 32 bytes at a time aligned to a 16 byte boundary).
Aligning the main loop in timer_dispatch_many() to a 16 byte boundary
significantly improves performance.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-13 11:52:24 -04:00
Kevin O'Connor
fb798e3cba sched: Force sched_try_shutdown to be inlined
If sched_try_shutdown() is not inlined into timer_dispatch_many() it
can have a significant impact on benchmarks.  (Even though the
function isn't called in practice, the call causes gcc to organize the
function differently.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-13 11:47:00 -04:00
Kevin O'Connor
7a265f159a armcm_irq: Fix jump target alignment
The jump target needs to be 4 byte aligned (not 2^4 bytes).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-13 11:47:00 -04:00
Kevin O'Connor
0225d17343 stm32f1: Use __always_inline on timer_read_time
Some older versions of gcc need the __always_inline directive in order
to inline timer_read_time.  Inlining that function is important for
performance on the stm32f1.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-11 22:20:02 -04:00
Kevin O'Connor
aa693fbdc1 docs: Updates to stm32f103 benchmarks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-11 10:57:24 -04:00
Kevin O'Connor
7cbc44b8d3 stm32f1: Use -O2 optimization and inline timer_read_time()
As long as timer_read_time() is inlined, I get better performance with
gcc -O2 optimization.  The binary is also dramatically smaller and O2
better matches the other platforms.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-11 10:50:51 -04:00
Kevin O'Connor
102ec4938d stm32f1: Use the main lib/cmsis-core directory for cmsis includes
Use the main cmsis header files with stm32f1.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-11 10:50:51 -04:00
Kevin O'Connor
75fa74313c stm32f1: Add support for building with bootloader support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-11 10:50:51 -04:00
Kevin O'Connor
215b4c5a1e stm32f1: Move assembler build rules together
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-11 10:50:51 -04:00
Kevin O'Connor
b8745bc973 stm32f1: Pull the USB D+ line low briefly to signal a device connect
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-11 10:50:51 -04:00
Kevin O'Connor
bc5e961d73 stm32f1: Initial support for serial over USB
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-11 10:50:51 -04:00
Kevin O'Connor
1302514ea8 stm32f1: Serial should have a higher irq priority than timers
It's possible for the code to stay in the timer irq for up to 100ms,
so serial irqs should have a higher irq priority to prevent them from
being starved.  (The timer code disables irqs during event dispatch,
so serial irqs would only be permitted between events anyway.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-11 10:50:51 -04:00
Kevin O'Connor
d32506bd2e homing: Move homing offset adjustment logic to generic homing code
Move the "stepper phase" adjustment logic from the kinematic classes
to the generic homing.py code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-10 14:30:09 -04:00
Kevin O'Connor
770b92863f mcu: Add a set_commanded_position() method to MCU_stepper
Add the ability to directly set the "commanded" stepper position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-10 14:30:09 -04:00
Kevin O'Connor
459e521991 delta: Add a special case to the limit checks for the homing position
When a delta printer has different arm lengths or different endstop
positions then the homing position falls outside of the normal
printable area.  Add a special check to the range checking code to
permit this move instead of homing to a position near the actual
homing position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-10 12:18:22 -04:00
Kevin O'Connor
bd1ba86839 delta: Reorganize init()
Just code movement.  Move boundary check init to after tower init.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-10 12:18:22 -04:00
Kevin O'Connor
d4bf51231a homing: Implement second home from homing.py
Move the logic for performing the second home from the kinematics
classes to the generic homing code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-10 12:14:27 -04:00
Kevin O'Connor
3db483e270 delta: Wrap lines to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-10 12:14:27 -04:00
Kevin O'Connor
1146d228fa servo: Wrap lines to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-10 12:14:27 -04:00
Kevin O'Connor
1e07be4db4 docs: Add a "Lost communication with MCU" section to the FAQ
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-09 11:22:28 -04:00
Kevin O'Connor
e85f9473fc stepper: Wrap lines to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-09 11:17:39 -04:00
Kevin O'Connor
f7a7223b30 cartesian: Use homing_speed for homing retract speed
Commit b0d859f2 introduced a second_homing_speed parameter, and it
also changed the retract speed.  Revert the retract speed change (use
homing_speed when the head retracts).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-09 11:17:39 -04:00
Kevin O'Connor
36ae433b57 cartesian: Make sure to constrain second_homing_speed to max_z_velocity
Commit b0d859f2 introduced a second_homing_speed parameter; that
parameter needs to also be constrained to the max_z_velocity.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-08 10:52:46 -04:00
Kevin O'Connor
8eb1110aa8 logextract: Fix handling of clock reports at end of line
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-08 10:34:07 -04:00
alfsoft
909eef3978 display: Corrected Fan icon graphics (#753)
Added new Copyright string, corrected Fan icon graphics

Signed-off-by: Alexander Fadeev <alfsoft@gmail.com>
2018-10-07 13:38:11 -04:00
Chris Whiteford
c5d94a74a5 servo: Adding support for startup value for servos (#676)
Signed-off-by: Chris Whiteford <github@chrisandtennille.com>
2018-10-05 14:35:38 -04:00
Kevin O'Connor
852d1666bb docs: Fix typo in BED_MESH_PROFILE description in G-Codes.md
Reported by @fiveNinePlusR

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-04 19:01:18 -04:00
Chris Whiteford
b0d859f220 stepper: Adding support for a second_homing_speed parameter (#677)
Signed-off-by: Chris Whiteford <chris@chrisandtennille.com>
2018-10-04 18:55:58 -04:00
Kevin O'Connor
97927172f1 st7920: Use display xor capability when animating glyphs
Use the xor capability of the display to animate the glyphs, which
reduces the number of glyphs needed from 4 to 2.  This should make it
easier to add future animations if desired.

Suggested by @marcio-ao.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-04 13:49:00 -04:00
alfsoft
630989c0fe display: Change Extruder, Bed and Fan icons design (#740)
Based on replies from Issue 652 (https://github.com/KevinOConnor/klipper/issues/652) only Extruder, Bed and Fan icons are changed. Feedrate icon stays untouched.

Signed-off-by: Alexander Fadeev <alfsoft@gmail.com>
2018-10-04 13:25:29 -04:00
Arksine
d29eb731a9 bed_mesh: save mesh state to 'default' profile after calibration
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-10-04 12:53:03 -04:00
LazaroFilm
822616ae7f docs: Spelling error corrected in bed mesh comment (#735)
The comment for the algorithm setting had a spelling error, it said:
[...]May be either "langrange"[...]
Removed the n.

Signed-off-by: Victor Lazaro <lazarofilm@gmail.com>
2018-10-04 12:48:27 -04:00
Kevin O'Connor
978b321f80 avr: Disable usb serial interrupts while processing data
There's no need to keep taking interrupts if the high-level code is
busy processing messages.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-02 22:17:39 -04:00
Kevin O'Connor
7c7573f69f avr: No need to reset ep0 interrupts on a shutdown
The usb_cdc code will arrange to call usb_read_ep0_setup() after a
shutdown, so no need to have an explicit shutdown handler.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-02 21:41:36 -04:00
Kevin O'Connor
efd9e7a6df usb_cdc: Try to read new data before processing data blocks
Call usb_read_bulk_out() before calling command_find_and_dispatch() as
this optimizes the common case where each usb packet contains a single
new message block.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-02 21:38:58 -04:00
Kevin O'Connor
fe98dd3585 usb_cdc: Wake usb_bulk_out_task() on a shutdown
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-02 21:33:46 -04:00
Arksine
b261d31ec5 bed_mesh: Add ability to save mesh state to persistent memory
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-10-02 16:26:35 -04:00
Arksine
144868c600 bed_mesh: Extend BED_MESH_MAP to provide more information
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-10-02 16:26:35 -04:00
Kevin O'Connor
5c267e4f69 docs: Update Features.md document with tmc2660 support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-02 14:07:33 -04:00
Janar Sööt
50d1ad9019 menu.cfg: add fan glyph to __screen2004_static & __screen2004_input
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-10-02 12:49:12 -04:00
Janar Sööt
b2691d4730 hd44780: new text glyph - fan
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-10-02 12:49:12 -04:00
Kevin O'Connor
d348f0da87 avr: Allow the serial port to be selected on the atmega2560/1280
Allow the serial port to be selected on the atmega2560 and atmega1280
chips in Kconfig.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 22:30:58 -04:00
Kevin O'Connor
0820394e13 toolhead: M204 must update max_accel_to_decel
The max_accel_to_decel variable must not be greater than the max_accel
variable.  Make sure to check this when M204 changes max_accel.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 22:02:33 -04:00
Kevin O'Connor
357b2f477c buttons: Clear pressed/last_pressed state on new buttons_query command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 12:40:28 -04:00
Kevin O'Connor
820dd0b5e3 display: Don't error if M73 is missing a P parameter
Try to avoid raising an error on an M73 command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 12:31:31 -04:00
Kevin O'Connor
f49f298003 probe: Merge ProbeVirtualEndstop and ProbeEndstopWrapper wrapper classes
No need to have two wrappers around the mcu_endstop class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:14:23 -04:00
Kevin O'Connor
9f755750d3 test: Add a test case for probe:z_virtual_endstop support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
1940ba7062 config: Minor indentation fix to comments in example-extras.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
a698aef29b config: Note probe activate/deactivate must not move the toolhead
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
c5d4e14298 probe: Infer position_endstop when using probe:z_virtual_offset
Don't require (or permit) the user to specify a stepper_z
position_endstop when using the probe:z_virtual_offset mechanism.  In
that case the position_endstop should always equal the probe's
z_offset - so no need to have the user specify it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
a9a0bb87fa probe: Verify the toolhead moves at least some distance on a probe
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
31ec098577 config: The delta_calibrate bed radius uses nozzle coordinates
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
43f2eac239 z_tilt: Wrap lines to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
c3550158bb z_tilt: Take into account probe xy offset when calculating z_adjust
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
19d18c2bc1 bed_tilt: Take into account probe xy offset when calculating z_adjust
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
348a41c325 bed_tilt: Remove special probe:z_virtual_endstop handling
Remove the code to calculate and track the z_offset via
position_endstop updates.  It's simpler to always save and restore the
calculated z_adjust.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
33887b8c39 probe: Support manual probing at runtime
Don't require the config file to specify manual probing.  Instead,
allow the user to select manual probing on each ProbePointsHelper
invocation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
0e9b8abde2 probe: Perform multi-sample averaging in ProbePointsHelper class
Now that all the callers of ProbePointsHelper take a cartesian
coordinate for the probe locations, it's possible to perform averaging
of multi-sample probes within the class.  This simplifies the callers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
e5ef15ad0f probe: Separate out manual probing from automatic probing code
Only call cmd_NEXT() for manual probing.  This simplifies the code as
the automatic probing and manual probing have slightly different
probing mechanisms.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
cb3fede19a probe: Move move_next() method within ProbePointsHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
8e7eac9b08 probe: Implement ProbePointsHelper get_probed_position() locally
Now that all users of ProbePointsHelper use the same
get_probed_position() code, it is possible to implement that locally
within the ProbePointsHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
ae4eb35a70 delta_calibrate: Use kin.calc_position() in get_probed_position() callback
It's possible (and a little simpler) to use cartesian coordinates when
calculating a stable position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor
c68c0c6526 avr: Increase stack size to 256 for all AVR targets
Recent code additions have increased the stack usage and it is no
longer clear that everything will fit in 128 bytes.  Increase all
targets to 256 bytes (the atmega2560 was already at 256 bytes).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 10:33:18 -04:00
Kevin O'Connor
b3a6fbed74 usbstd: Force usb_string_descriptor data field to match unicode string
Fix travis-ci build failure by forcing the data field of the struct
usb_string_descriptor to be the same type as a 16bit unicode string.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 23:50:51 -04:00
Kevin O'Connor
9ec2ad0992 lib: Remove pjrc_usb_serial
The pjrc_usb_serial is no longer used.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 22:55:21 -04:00
Kevin O'Connor
d05aa81927 avr: Use generic usb_cdc code for usb serial support
Use the generic usb_cdc driver code instead of the "pjrc" usb driver
code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 22:55:21 -04:00
Kevin O'Connor
c0311bee33 usb_cdc: Perform basic request validation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 22:32:19 -04:00
Kevin O'Connor
93e4897044 usb_cdc: Add usb_read_ep0_setup() interface function
Use new usb_read_ep0_setup() function when reading a setup packet -
this allows the low-level usb hardware code to better handle errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 22:32:19 -04:00
Kevin O'Connor
731236cf20 usb_cdc: Add support for usb_send_ep0_progmem()
Add support for explicitly sending to the ep0 pipe from constant
"progmem" memory on the AVR.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 22:32:19 -04:00
Kevin O'Connor
92aea93500 usb_cdc: Fix handling of zero-length-packets
A zero length packet should only be sent at the end of a transmission
if the host is expecting more data.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 22:32:19 -04:00
Kevin O'Connor
be1effebc3 usb_cdc: Rework transfer state tracking code
Maintain the state tracking code entirely within a usb_do_xfer()
method.  This simplifies the callers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 22:32:19 -04:00
Kevin O'Connor
6ab16d2407 usb_cdc: Rename interface functions to avoid the term "setup"
Use "ep0" when referring to endpoint0 - don't use "setup" as that can
be confused with the low-level usb setup token.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 14:09:55 -04:00
Nikolai Ugelvik
50a8efe0a5 config: Add encoder and click pins for CR-10 mini
Signed-off-by: Nikolai Ugelvik <nikolaiu@gmail.com>
2018-09-30 12:52:06 -04:00
Kevin O'Connor
de7c1f76db gcode_macro: Provide more information on a formatting error
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 12:43:54 -04:00
Kevin O'Connor
b112cac47a config: Fix typo in gcode_macro default_parameter description
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 12:11:07 -04:00
Janar Sööt
68dc28580f gcode_macro: default parameter values
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 11:53:10 -04:00
Janar Sööt
d9e35481be configfile: add get_prefix_options method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-30 11:51:26 -04:00
Kevin O'Connor
8c2991ceac tmc2208: Improve error handling
Configure the tmc2208 during the 'connect' phase so that a problem
during configuration is properly raised as a config error.  Catch
errors during DUMP_TMC and raise them as g-code errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 10:57:47 -04:00
Kevin O'Connor
864918b1f9 verify_heater: Don't report a heater error if printer is shutdown
Don't log a heater verification error if that error is due to the
printer being shutdown for some other reason.  Those spurious error
reports can be confusing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-30 10:40:44 -04:00
Kevin O'Connor
47b6144ff6 logextract: Add support for extracting recent g-code from a shutdown
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-28 12:24:39 -04:00
Kevin O'Connor
cf79b3c342 config: Note gcode_macro string formatting in example-extras.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-26 08:25:44 -04:00
Kevin O'Connor
439f6684be config: Move some sections around in example-extras.cfg
Move the quad_gantry_level description closer to z_tilt section.  Move
the force_move section closer to the homing_override section.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-26 08:16:40 -04:00
Janar Sööt
d22b30342a gcode_macro: 2 lines wrapped at 80 chars
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-26 08:03:39 -04:00
Janar Sööt
51d64ad7f8 gcode_macro: macro improvement with parameters
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-26 08:03:39 -04:00
Kevin O'Connor
170b9678fb display: Don't error on an out of range M73 request
No need to report an error if the M73 is not between 0 and 100 - just
display the nearest valid value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 20:51:51 -04:00
Kevin O'Connor
364faf497b toolhead: Update look-ahead flush comment
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 15:44:45 -04:00
Janar Sööt
18b56c3cda menu: vsdcard - scroll long filenames (#694)
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-25 14:52:23 -04:00
Kevin O'Connor
95392595f6 config: Wanhao Duplicator 6 likely does not need "restart: command"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 14:29:05 -04:00
Kevin O'Connor
4b5db04f78 docs: Add Delta_Calibrate.md guide with "enhanced delta calibration"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Charlie
1165c0c9c5 docs: Additional images for enhanced calibration procedure reference (#639)
Signed-off-by: Charles Galant <cgalant@cogwheel.net>
2018-09-25 13:48:46 -04:00
Kevin O'Connor
0b2c89ecaf delta_calibrate: Initial support for enhanced delta calibration
Add support for an enhanced delta calibration routine that performs XY
dimension calibration.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Kevin O'Connor
929733f0a7 delta_calibrate: Support save/restore of delta_calibrate state
Support using SAVE_CONFIG to store the results of DELTA_CALIBRATE to
the printer config file.  Store the low level probe measurements in
the config as well.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Kevin O'Connor
ed0882dc10 delta: Move "stable position" logic to delta_calibrate.py
Move the "stable position" logic from the delta.py kinematics code to
the delta_calibrate.py calibration code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Kevin O'Connor
d48e8ea162 bed_tilt: Support saving calibration data via SAVE_CONFIG command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Kevin O'Connor
5a1b2d61ae pid_calibrate: Support saving calibration data via SAVE_CONFIG
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Kevin O'Connor
531134f092 configfile: Add support for rewriting the printer config file
Add support for writing back the main printer config file with
additional calibration data stored in it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Kevin O'Connor
f80456a698 configfile: Move config file code from klippy.py to new file
Add a klippy/configfile.py file with the code needed to read the main
printer config file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-25 13:48:46 -04:00
Janar Sööt
5144c5f01e menu: new fast step rate feature
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-21 19:29:30 -04:00
Kevin O'Connor
1379a59085 st7920: No need to clear glyph framebuffer before programming glyphs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor
7cca8d970a hd44780: Simplify framebuffer access
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor
742d6481a9 st7920: Simplify framebuffer access
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor
05ba62600c st7920: Support writing degrees symbol
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor
a4e2540f14 uc1701: Support writing degrees symbol
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor
30a49d3186 display: Use write_glyph() when writing special characters
Always use the write_glyph() method when writing special characters
during status screen updates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor
c8d9d575a1 display: Support writing single character glyphs using write_glyph()
Add write_glyph() support to hd44780.py.  Update uc1701.py and
st7920.py to support writing single character glyphs via
write_glyph().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor
2a5778be3a display: Move icon drawing from display.py to lcd_chip code
Move the st7920 icon rendering optimizations from display.py to
st7920.py.  This simplifies the code for other displays.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor
2857255ef1 icons: Add the bed to the bed heating animations
It isn't necessary to use the st7920's xor capabilities when drawing
the bed heating animations.  This makes it easier to use the icons for
other displays.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-21 16:39:38 -04:00
Kevin O'Connor
3d4ee9e962 docs: Add stm32f1.md link to Overview.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-20 20:11:04 -04:00
Kevin O'Connor
174754299a heater: Add new TURN_OFF_HEATERS command
Add a command that will turn off all heaters in the printer.  Run this
command in the default idle_timeout action.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-18 16:01:07 -04:00
Janar Sööt
7b6a44e8f9 menu: New Tune submenu (#653)
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-17 08:26:59 -04:00
Janar Sööt
f7f78433a2 gcode: modify get_status method to output more info (#651)
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-09-17 08:25:28 -04:00
Kevin O'Connor
48ddfba415 test: Add printer-wanhao-duplicator-6-2016.cfg to printers.test
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-16 22:45:31 -04:00
Clifford Raccani
67c6234907 config: Add printer-wanhao-duplicator-6-2016.cfg
Signed-off-by: Cliff Raccani <bramhall45@hotmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-16 19:52:41 -04:00
Maks Zolin
a9f2a1375a quad_gantry_level: Fix typo, add floating point error protection
Signed-off-by: Maks Zolin <mzolin@vorondesign.com>
2018-09-14 10:45:28 -04:00
Kevin O'Connor
390d549c0c delta: Fix maximum halt velocity calculation
If an arm is nearly parallel to the bed then that tower's carriage may
have a velocity up to 3 times greater than the toolhead's maximum
velocity (relative to the print).  Take that into account when
calculating the stepper's maximum halt velocity.

This fixes some rare "No next step" shutdowns on delta printers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 22:29:18 -04:00
Kevin O'Connor
094b9de69e gcode: Send proactive state messages
Send a g-code info message on printer state changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 21:31:27 -04:00
Kevin O'Connor
91691afdcf gcode: Catch errors on fd read and write
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 21:06:54 -04:00
Kevin O'Connor
d1da6100a6 klippy: Remove unneeded loop in run() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 21:06:54 -04:00
Kevin O'Connor
32b763efb1 config: Fix generic-re-arm.cfg encoder pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 14:43:10 -04:00
Kevin O'Connor
d459ae648d config: Update generic-re-arm.cfg with menu buttons
Reported by @J-charles-C.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-12 09:07:50 -04:00
Maks Zolin
e3a49dc692 quad_gantry_level: Add gantry leveling (ruled hyperbolic parabola correction) (#631)
Signed-off-by: Maks Zolin <mzolin@vorondesign.com>
2018-09-12 08:33:20 -04:00
Boffgithub
0c0087ce42 config: Update example-extras.cfg (#641)
Just correcting a couple of spelling errors I noticed.

Signed-off-by: Ben Warren <boffdroid@gmail.com>
2018-09-12 08:13:12 -04:00
Kevin O'Connor
5791a4d8c4 toolhead: Set commanded_pos[] to move.end_pos
Commit 4573932f allowed move.end_pos to differ from the requested end
position - the toolhead class should use the updated position when
storing its commanded position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-11 13:45:33 -04:00
Kevin O'Connor
4573932f89 toolhead: Handle rounding errors with extrude only moves
It's possible that a g-code transform class may make an extrude only
move appear as a kinematic move due to limitations of double precision
math.  Handle this by checking for an inconsequential move distance
instead of checking for a move distance of exactly zero.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-11 13:40:52 -04:00
Florian Heilmann
947a7b2b0f tmc2660: Implementation of TMC2660 extra (#621)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-09-11 12:34:05 -04:00
Kevin O'Connor
f15cd62587 docs: Update Pressure_Advance.md document
Update the document to recommend tuning with decreased acceleration
and with square_corner_velocity disabled. Using this approach makes it
possible to test with significantly higher pressure advance values.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-11 12:00:43 -04:00
Kevin O'Connor
ea7de3bcad config: Use fastest PWM time in mini-rambo PWM DAC config
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-11 09:40:48 -04:00
Kevin O'Connor
b595c3e423 config: Add example lcd section to smoothieboard config
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-10 15:29:54 -04:00
Arksine
d6f72eefa1 bed_mesh: Cache last position when get_position() is called.
Fixes issue #626.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-09-10 15:10:43 -04:00
Kevin O'Connor
ea129d869e config: Fix position_endstop typo in sample-bltouch.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-09 10:30:06 -04:00
alemorbel
aac2fee9de config: Add display buttons pins for anycubic kossel pulley 2016 (#614)
Signed-off-by: Alejandro <alemorbel@alemorbel.es>
2018-09-06 18:31:55 -04:00
Kevin O'Connor
c8dc47b162 docs: Note digipot support in Features.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 21:10:53 -04:00
Kevin O'Connor
ac3aa097fb docs: Features.md updates
Add information on new features in Klipper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 20:55:53 -04:00
Kevin O'Connor
ef6068dc42 mcu: Log MCU information before configuring
Log the details of the MCU prior to attempting to configure the MCU.
This way, the log contains the MCU information even if a configuration
error occurs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 18:34:10 -04:00
Kevin O'Connor
5801e6f4d0 pins: Verify the pin_map setting
Raise an error if pin_map is not set to a valid value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 18:16:44 -04:00
Kevin O'Connor
30013a1fb8 mcu: Rename add_config_object() to register_config_callback()
Change the name of the config registration method and pass an explicit
reference to the callback to the new method.  This makes the
relationship between mcu registration and build_config() more clear in
the calling code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-03 11:48:22 -04:00
Kevin O'Connor
a8d4a7ef46 config: Be clear that multi-line parameters must use indentation
Also, be clear that probe points are nozzle coordinates (not probe
coordinates).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 14:40:26 -04:00
Kevin O'Connor
8fe8a6deb3 statistics: Move stats handling to new "extras" module
Move the generation of statistics to its own module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 13:46:19 -04:00
Kevin O'Connor
18b04ffe68 klippy: Rename lookup_module_objects() to lookup_objects()
Rename the method and support returning all known objects.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:53:34 -04:00
Kevin O'Connor
50196c7141 klippy: Use reactor register_callback() mechanism
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:43:40 -04:00
Kevin O'Connor
ab4060e145 console: Use reactor register_callback() mechanism
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:31:36 -04:00
Kevin O'Connor
165317e33f toolhead: Support M204 with P and T instead of S
Recent versions of Slic3r now send M204 with P and T instead of with
S, so support that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:22:43 -04:00
Kevin O'Connor
5632cf6d77 serialqueue: Increase receive message debug queue to 100 messages
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:16:13 -04:00
Kevin O'Connor
ce79b6ca00 menu: Queue g-code commands to avoid command reordering
The gcode.run_script() code can pause which can result in the menu
code being called reentrant - avoid that by queuing the gcode commands
within the menu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 12:14:27 -04:00
Kevin O'Connor
b656792616 config: Add encoder pins to Creality Ender2 and CR10 configs
Reported by @faboaic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-09-02 11:52:20 -04:00
Kevin O'Connor
cf4f23ebf2 probe: Use probe speed for initial move to the Z height
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-30 16:20:23 -04:00
Kevin O'Connor
f3edea2943 toolhead: Forward original config error if raised in kinematics class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-30 10:19:08 -04:00
Arksine
40b7ba5111 probe: Add ability to multi-sample points to ProbePointsHelper
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2018-08-29 12:01:19 -04:00
Arksine
1588426229 probe: Refactor z lift code to its own function.
Call lift-z prior to the first move.  This prevents the nozzle from hitting the build surface in situations that home the nozzle off and below the bed.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2018-08-29 12:01:14 -04:00
Kevin O'Connor
4acda88e8d docs: Fix spelling error in example-extras.cfg
Fix "interally" spelling error - reported by @bistory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-28 15:36:53 -04:00
Kevin O'Connor
6b4e44011c test: Make white space error report more pronounced
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 13:21:15 -04:00
Kevin O'Connor
ca7a80a946 tmc2208: Initial support for configuring TMC2208 drivers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:51:27 -04:00
Kevin O'Connor
afd5d55c00 tmc2130: Minor code cleanup
Rework the code to use set_register() with the string name of the
desired register to set.  Add a get_register() method.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:47:24 -04:00
Kevin O'Connor
e5d95fdd00 stm32f1: Add support for gpio_x_reset()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:45:01 -04:00
Kevin O'Connor
983c84b12f pru: Add wrappers for gpio_x_reset()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:45:01 -04:00
Kevin O'Connor
75de9cb4c0 simulator: Add support for gpio_x_reset()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:45:01 -04:00
Kevin O'Connor
fa3d2b97bd samd21: Add support for gpio_x_reset()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:45:01 -04:00
Kevin O'Connor
eec58b99fe sam4e8e: Add support for gpio_x_reset()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:44:59 -04:00
Kevin O'Connor
109eff0191 sam3x8e: Add support for gpio_x_reset()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:40:38 -04:00
Kevin O'Connor
5a993b743e lpc176x: Add support for gpio_x_reset()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:40:38 -04:00
Kevin O'Connor
1ae67441c3 avr: Add support for gpio_x_reset()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:40:38 -04:00
Kevin O'Connor
34fe4cce14 sched: Don't require 2ms pad in sched_add_timer()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:40:38 -04:00
Kevin O'Connor
480415d2e8 docs: Update Bootloaders.md with AVR lfuse hints
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:34:37 -04:00
Kevin O'Connor
a5189f7c25 docs: Add some notes to Bootloaders.md on using the atmega168
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:08:55 -04:00
Kevin O'Connor
0bce44e1bb avr: Disable HAVE_GPIO_BITBANGING on atmega168
The atmega168 doesn't have enough flash space to fit all features -
disable the "bit banging" interfaces to make room.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 11:20:29 -04:00
Kevin O'Connor
a20d9d3bd5 samd21: Enable HAVE_GPIO_BITBANGING
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 11:11:28 -04:00
Kevin O'Connor
82a542faed Kconfig: Rename HAVE_USER_INTERFACE to HAVE_GPIO_BITBANGING
Rename the HAVE_USER_INTERFACE definition in preparation for other
"bit banging" interfaces.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 11:09:47 -04:00
Kevin O'Connor
ee67715e2b docs: Fix link in Bootloaders.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 09:16:27 -04:00
Kevin O'Connor
28fe6a5df0 docs: Update SAMD21 flashing information in Bootloaders.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 09:07:27 -04:00
Kevin O'Connor
9b56c4f780 docs: Update Bootloaders.md with updated bossac info for sam3x8e
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 08:54:43 -04:00
Kevin O'Connor
daf4d237c0 scripts: No longer require bossa-cli in install-octopi.sh
Now that there is a local copy of bossac in the lib directory, there's
no reason to require a system version of it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 08:54:43 -04:00
Kevin O'Connor
051e8724a0 sam4e8e: Use local copy of bossac for flashing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 08:54:43 -04:00
Kevin O'Connor
22f0db06a1 sam3x8e: Use local copy of bossac for flashing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 08:54:43 -04:00
Kevin O'Connor
2b9124f3c0 lib: Add bossac 1.9 code to lib directory
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 08:54:43 -04:00
cfelicio
79632878ac config: Updates to printer-wanhao-duplicator-i3-v2.1-2017.cfg
Add lcd encoder pins. Add comment on 10K pullups.

Signed-off-by: Carlos Felicio <cfeliciomobil@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 08:45:04 -04:00
Kevin O'Connor
22132a5516 config: Add encoder buttons to generic-ramps.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-26 23:08:27 -04:00
Kevin O'Connor
ad480bd470 mcu: Avoid adding the same stepper multiple times to an endstop
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-26 23:06:32 -04:00
Kevin O'Connor
96acfdc6d2 docs: Minor rewording of Marlin pin number section of FAQ
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-26 23:06:32 -04:00
Gonzalo Ramírez
e6208c6f02 config: Added pins for LCD encoder and button click on Creality Ender 3 (#574)
Signed-off-by: Gonzalo Ramírez <controla@gmail.com>
2018-08-26 23:05:13 -04:00
Kevin O'Connor
a27e82aef3 docs: Add a section to the FAQ on translating Marlin pin numbers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-24 21:43:53 -04:00
Romain “Artefact2” Dal Maso
11e9bb286e probe: Allow restarting an incomplete probe set
Signed-off-by: Romain “Artefact2” Dal Maso <artefact2@gmail.com>
2018-08-24 13:20:55 -04:00
Florian Heilmann
b065f51454 sam4e8e: Fix bug in sam4e gpio.c (#563)
The bank_id was calculated erroneously. Also unify gpio_in_setup and gpio_out_setup a bit. Also disable make flash for the sam4e8e port as it currently references a version of bossac that is not present on all systems.

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-08-24 13:17:53 -04:00
Florian Heilmann
a8a912fbb5 docs: Update sam4e8e docs and benchmarks (#562)
Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-08-22 19:17:43 -04:00
Arksine
e94f3b7827 gcode: M117 fix
Resolves issue where M117 is not correctly executed when the message begins with numeric or special character.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2018-08-22 12:53:42 -04:00
Janar Sööt
65f0fd6238 display menu module for klipper
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-08-20 22:33:05 -04:00
Arksine
3387cccdcf bed_mesh: move probe x and y offsets to the [probe] module
All probe offsets are now passed to the finalize() callback in the ProbePointsHelper Class.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-08-19 16:52:23 -04:00
Arksine
52df40dfbb bed_mesh: update z_offset check
Only check the probe's z_offset against the stepper_z endstop position if the probe is used as a virtual endstop.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-08-19 16:52:23 -04:00
Boffgithub
08aacec0b2 config: Update example-extras.cfg (#544)
Changed 'endstop' to 'stepper' in 'multi-steppers axes' section

Signed-off-by: Ben Warren <boffdroid@gmail.com>
2018-08-19 10:15:48 -04:00
Kevin O'Connor
1b07be070b heater_fan: Allow multiple heaters to be defined for a heater_fan
Support the case where a single cooling fan is used with multiple
extruders.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-17 10:20:12 -04:00
Kevin O'Connor
e88eab18d0 test: Update .travis.yml to list apt packages one per line
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-17 09:47:57 -04:00
Arksine
868a1f951b docs: Add Mesh Bed Leveling to G-Codes.md
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-08-17 09:22:55 -04:00
Arksine
f337fb1802 config: update examples-extra.cfg to include the bed_mesh module
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-08-17 09:22:55 -04:00
Arksine
e0bd221c57 bed_mesh: mesh bed leveling for Klipper
Initial implementation of configurable Mesh Bed Leveling.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-08-17 09:22:55 -04:00
Kevin O'Connor
be3131de3e docs: Update Config_checks.md to use STEPPER_BUZZ
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-09 13:46:07 -04:00
Kevin O'Connor
3f59c3dd48 docs: Add a Bootloaders.md document
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-08 20:47:04 -04:00
Kevin O'Connor
5fb1c76c0e samd21: Fix description of bootloader offset
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-08 19:56:43 -04:00
Kevin O'Connor
71063fe500 docs: Warn about possible pin conflicts in benchmarks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-08 13:52:08 -04:00
Kevin O'Connor
cbf019a468 docs: It's difficult to estimate real-world usage from the benchmarks
Remove the prediction on real-world usage as it's not really practical
to make a prediction.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-08 13:39:29 -04:00
Kevin O'Connor
fbec3ebb63 docs: Add benchmarking details to docs/Debugging.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-08 13:28:08 -04:00
Florian Heilmann
64e6d85898 sam4e8e: Add the SAM4e8e port
This can be flashed to e.g. the duet wifi using bossac. It requires a
later version as is currently included in the klipper repo (1.8
vs. 1.2). Comms are currently via UART0 only, USB serial is still TBD

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-08-08 10:44:49 -04:00
Florian Heilmann
d15c106288 lib: Add SAM4E CMSIS HAL
Obtained from Atmel.SAM4E_DFP.1.1.57.atpack

Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
2018-08-08 10:44:38 -04:00
Kevin O'Connor
f067d0cc78 samd21: Minor fixes to usbserial
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-08 10:43:57 -04:00
Kevin O'Connor
2eaf3510ab test: Add SAMD21 compile test case
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-07 00:14:16 -04:00
Kevin O'Connor
a5d27c55e1 docs: Update perf benchmarks with SAMD21 results
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-07 00:03:42 -04:00
Kevin O'Connor
0daf19c003 samd21: Add support for USB
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-07 00:03:41 -04:00
Kevin O'Connor
cf2393efc8 samd21: Add support for gpio pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-07 00:03:21 -04:00
Kevin O'Connor
74cf4dc9e0 samd21: Initial support for SAMD21 micro-controllers
Add initial support for the Atmel SAMD21 micro-controllers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-07 00:03:18 -04:00
Kevin O'Connor
71db5fbe31 lib: Update samd21 code with local changes
A minor change is necessary to work with GCC's -flto and to work with
common bootloaders.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-07 00:02:44 -04:00
Kevin O'Connor
5633e6c249 lib: Add Atmel SAMD21 cmsis headers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-06 23:36:05 -04:00
Kevin O'Connor
50142cc1b3 armcm_irq: Enhance clear_active_irq() so it works on cortex-m0
Minor rework of the assembler so that it does not require thumb-2
instructions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-06 23:36:05 -04:00
Kevin O'Connor
635a199a47 usb_cdc: Allow USB endpoint ids to be board specific
It's common for boards to have restrictions on the type of each
endpoint.  So, make it possible for the board to select the endpoint
ids for each endpoint.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-06 23:36:05 -04:00
Kevin O'Connor
f4910e119a lpc176x: Use common cmsis-core files
No need to include separate cmsis files from the mbed project - the
standard CMSIS_5 files work fine.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-06 23:36:05 -04:00
Kevin O'Connor
742048a08d lib: Remove the (now unused) cmsis-sam3x8e directory
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-06 23:36:05 -04:00
Kevin O'Connor
e1146c04fd sam3x8e: Use SAM3X CMSIS files instead of arduino CMSIS files
Update the sam3x8e port use the most recent SAM3X CMSIS files from
Atmel.  The Atmel files appear to have a more consistent license and
it is unclear if there were Arduino specific changes in the CMSIS
files obtained from the Arduino repo.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-06 23:36:05 -04:00
Kevin O'Connor
8572cae9a0 lib: Modify SAM3X CMSIS files to work with GCC's lto feature
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-06 23:36:05 -04:00
Kevin O'Connor
dd240f6471 lib: Add Atmel SAM3X CMSIS files
Add most recent SAM3X CMSIS files from Atmel.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-06 23:36:05 -04:00
Kevin O'Connor
454a873cb8 lib: Add CMSIS_5 files
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-06 23:36:05 -04:00
sillyfrog
ed011b5f25 dockerfile: Add a basic reference Dockerfile (#488)
Dockerfile: Add a basic reference Dockerfile

This is a sample of how to get Klipper running in Docker, because of the
virtual serial port, the user will have to modify things to include
something to send the GCode. I have included a link to my repo which has
OctoPrint up and running as an example.

Signed-off-by: Trent Davis <tgh@sillyfrog.com>
2018-08-06 13:11:01 -04:00
Kevin O'Connor
7783767c35 klippy: Move tracking of accessed config items into _read_config() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-03 18:54:23 -04:00
Kevin O'Connor
cd24d61515 docs: Minor change to wording of junction speeds
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-03 15:48:07 -04:00
Kevin O'Connor
1fefd695de docs: Note square corner velocity in lookahead description
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-03 15:43:46 -04:00
Kevin O'Connor
43179d7b6c config: Minor changes to example-extras.cfg documentation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-03 13:00:40 -04:00
Kevin O'Connor
82738955d2 virtual_sdcard: Check if other events need to run after each file read
Periodically check if other events need to run - this prevents the
virtual_sdcard processing from starving other events.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-02 20:27:34 -04:00
Kevin O'Connor
f2d232ef77 force_move: Provide defaults for SET_KINEMATIC_POSITION parameters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-02 08:58:18 -04:00
Kevin O'Connor
c5ecb37b4e test: Minor update to travis-build.sh mcu_compile start notifier
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-01 14:05:31 -04:00
Kevin O'Connor
ac5e207241 check_whitespace: Minor simplification of control char check
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-27 12:55:41 -04:00
Kevin O'Connor
7c7de85f01 test: Extend white space check to verify files are valid utf-8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 16:16:05 -04:00
Kevin O'Connor
09a64d24f1 docs: Remove the Todo.md file
The Todo.md file has gotten stale, and it is no longer an effective
mechanism for tracking changes.  Remove it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 12:51:01 -04:00
Kevin O'Connor
c0c892d524 force_move: Add support for FORCE_MOVE command
Add initial support for commands that will forcibly move a stepper
(without updating the kinematic classes with the new position).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 12:44:07 -04:00
Kevin O'Connor
a434341aa9 force_move: Simplify STEPPER_BUZZ code
Separate the setup and movement parts of cmd_STEPPER_BUZZ() into their
own functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 11:45:18 -04:00
Kevin O'Connor
2c5eba44ee force_move: Rename stepper_buzz.py to force_move.py
This is in preparation for extending the ability to make manual moves.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 11:15:51 -04:00
Kevin O'Connor
13ccb1a46f mcu: Minor whitespace changes
Wrap lines at 80 columns.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 10:54:31 -04:00
Kevin O'Connor
98580ac1c2 adc_temperature: Minor whitespace changes
Wrap lines at 80 columns.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 10:51:48 -04:00
Kevin O'Connor
334a839123 stepper: Minor whitespace changes
Wrap lines at 80 columns.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 10:18:10 -04:00
Kevin O'Connor
273a98d39a pins: Explicitly pass can_invert and can_pullup to lookup_pin()
Don't pass pin_type to lookup_pin() - instead, if a pin can be
inverted or can have a pullup, then the caller must explicitly specify
that when calling lookup_pin().  This simplifies the code for the
cases where it is not valid to invert or pullup.

Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin()
apply default pullup and invert flags.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-26 09:44:45 -04:00
Kevin O'Connor
7a9553b38a thermocouple: Minor fixes
Send the temperature before checking for an out of range error (that
makes it easier to debug).

The query_thermocouple clock parameter is unpredictable and a value of
zero can't be used to disable the query - use rest_ticks instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-25 09:06:50 -04:00
Kevin O'Connor
7d0f3649f3 spi_temperature: The query_thermocouple command is an init command
Make sure to use is_init=True when sending query_thermocouple -
otherwise, the config CRC is likely to mismatch on every connection.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 19:50:11 -04:00
Kevin O'Connor
63dffd9307 spi_temperature: Provide a default value for spi_speed
All of the Maxim chips support a 4Mhz spi transfer rate, so use that
as a default spi speed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 15:49:14 -04:00
Kevin O'Connor
5b124d59f2 spi_temperature: Remove spi_mode parameter
All of the Maxim chips can use SPI mode 1, so no need to configure it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 15:47:17 -04:00
Kevin O'Connor
70f765f62f spi_temperature: Don't raise error on a fault - invoke a shutdown
Raising an error from the background message reception thread isn't
well defined.  Instead, on a temperature fault, invoke a printer
shutdown.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 15:20:45 -04:00
Kevin O'Connor
a084c38b41 spi_temperature: Eliminate get_configs() callback
Those chips that require an spi init sequence can generate the message
directly in the chip specific class.

Also, don't send an spi init message for chips that are read-only.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 15:20:38 -04:00
Kevin O'Connor
c52c398ae8 spi_temperature: Eliminate self.chip_type variable
The chip type is now always unique in each class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 15:00:23 -04:00
Kevin O'Connor
f168032901 spi_temperature: Eliminate check_faults() callback
The faults can be checked from the calc_temp() method.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 14:54:31 -04:00
Kevin O'Connor
f20dd0c9be spi_temperature: Break up thermocouple code into individual classes
Break the Thermocouple() class into MAX31856(), MAX31855(), and
MAX6675() classes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 14:54:31 -04:00
Kevin O'Connor
7510efe827 spi_temperature: Use setup_minmax() to set the temperature range
Use setup_minmax() instead of directly reading the min/max temperature
from the config.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 14:12:00 -04:00
Kevin O'Connor
270080cd4c spi_temperature: Remove non-spi flags from SensorBase
The SensorBase class is used exclusively for SPI transfers, so no need
to track non-spi settings.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 14:05:35 -04:00
Kevin O'Connor
c0bf4327fd test: Add a test case for less common temperature sensors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 12:54:22 -04:00
Ricardo Amezquita
756514adef thermocouple: Add support for MAX6675 chip
The MAX6675 chip has a different read sequence than the MAX31855 chip.

Signed-off-by: Ricardo Amézquita <ramezquitao@cihologramas.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 11:16:05 -04:00
Kevin O'Connor
eba252d3fd thermocouple: Add initial support for common SPI temperature sensing chips
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 11:16:05 -04:00
Ricardo Amezquita
940db6bd70 linux: Add support for bi-directional SPI communication
Signed-off-by: Ricardo Amézquita <ramezquitao@cihologramas.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 11:16:05 -04:00
Kevin O'Connor
6a60fe998d mathutil: Log starting error in coordinate_descent()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-24 08:32:35 -04:00
Kevin O'Connor
fce993478c delta_calibrate: Fix typo in config output (radius should be delta_radius)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-22 11:47:49 -04:00
Kevin O'Connor
cb29143939 itersolve: Support calculating a stepper position from a cartesian coordinate
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-18 11:51:28 -04:00
Kevin O'Connor
e2b4b1616f lpc176x: Add support for SPI
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-18 10:11:29 -04:00
Kevin O'Connor
acefe26e0f idle_timeout: Move timeout handling from toolhead.py to new extras module
Move the "motor_off_timeout" tracking to a new module in the extras/
directory.  This makes it easier to customize the idle timeout
behavior.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-16 10:32:48 -04:00
Kevin O'Connor
0025fbf10d toolhead: Replace junction_deviation with square_corner_velocity
The junction_deviation configuration parameter has a number of quirks
that make it difficult to configure.  Replace it with a
"square_corner_velocity" configuration parameter.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-16 10:32:43 -04:00
Kevin O'Connor
ca505bf4ac kinematics: Convert get_rails() method to get_steppers()
All callers of get_rails() actually just want the steppers, so return
them directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-16 10:16:16 -04:00
Kevin O'Connor
89835940f7 query_endstops: Move QUERY_ENDSTOP command to it own extras/ module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-16 10:06:30 -04:00
Kevin O'Connor
28fa954487 delta: Store stable positions as integers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-15 22:05:13 -04:00
Kevin O'Connor
94dc8167c9 z_tilt: Don't default "points" parameter to "z_positions" parameter
It's rare to have all the Z stepper locations directly under the
printable surface, so using z_positions for points is not a good
default.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-15 10:30:27 -04:00
Kevin O'Connor
260d12af6d probe: Make sure there are at least 3 points even if using default_points
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-14 15:33:58 -04:00
Kevin O'Connor
ce0f4fe038 delta: Minor change to get_position_from_stable()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-14 11:55:15 -04:00
Pascal Albert
244d0aa65b atmega1284p: Add choice between UART0 or UART1 to Kconfig
Signed-off-by: Pascal Albert <lucky@foxserver.org>
2018-07-13 19:58:04 -04:00
Kevin O'Connor
2af73d1006 probe: Simplify mcu_probe stepper registration
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-13 17:14:33 -04:00
Kevin O'Connor
a31c31aed4 mcu: Enhance itersolve stepper kinematics allocation
Allocate the stepper_kinematics directly in mcu.py - that way the
kinematic classes don't have to interact with the chelper code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-13 11:37:36 -04:00
Kevin O'Connor
b988596519 toolhead: Fill cmove in toolhead instead of in each kinematic class
This simplifies the kinematic classes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-13 11:37:20 -04:00
Kevin O'Connor
8faab46ed2 toolhead: Move kinematic modules to new kinematics/ directory
Move extruder.py, cartesian.py, corexy.py, and delta.py to a new
kinematics/ sub-directory.  This is intended to make adding new
kinematics a little easier.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-12 22:50:25 -04:00
Kevin O'Connor
7d897d84d7 klippy: No need to pass printer reference to add_printer_objects()
The config reference already stores a reference to the printer object.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-12 22:26:32 -04:00
Kevin O'Connor
5cdba1fda8 mcu: Send mcu config and init immediately after building it
Don't issue a get_config command after building the config as the
built config may contain time sensitive initialization commands.
Instead, send the config and init commands immediately after invoking
the build_config() callbacks.  This avoids some rare "timer too close"
errors during configuration.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-12 12:54:12 -04:00
Kevin O'Connor
211e34e62b mcu: Add leading underscore to handle_shutdown() and handle_mcu_stats()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-12 12:19:04 -04:00
Kevin O'Connor
21563c5965 config: Minor updates to example-extras.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-12 12:18:31 -04:00
Kevin O'Connor
32a85edb16 spidev: Minor rework to spidev_transfer()
Gcc does a better job of inlining code if spidev_transfer() is
reworked slightly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-11 19:43:20 -04:00
Kevin O'Connor
733506dfb2 sam3x8e: Configure spi transfer in spi_prepare()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-11 19:40:51 -04:00
Kevin O'Connor
d9f960fb0c avr: Configure spi transfer in spi_prepare()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-11 19:40:21 -04:00
Kevin O'Connor
f60b0093b7 docs: Add a section with micro-controller porting tips to Code_Overview.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-11 14:40:39 -04:00
Kevin O'Connor
5294b3cd2d simulator: Rework dummy simulator code to user timer_irq / serial_irq
Change the simulator to use the generic timer_irq.c and serial_irq.c
code for (dummy) timer and io handling.  This is just to make the code
a better example for other developers (most micro-controllers will use
the timer_irq.c and serial_irq.c code).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-11 14:35:24 -04:00
Kevin O'Connor
00ea4428a3 test: Add recent printer config files to printers.test test case
Add printer-tronxy-x8-2018.cfg and printer-anycubic-kossel-plus-2017.cfg.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-10 12:04:39 -04:00
Seyed Seraj
70b5e1eb69 Add Printer Configuration File for the Tronxy X8
Added printer-tronxy-x8-2018.cfg for the Tronxy X8 with the CXY-V2-0508 board.

Signed-off-by: Seyed Seraj <s.seraj@hotmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-10 11:59:07 -04:00
Kevin O'Connor
68d78f0791 delta: Minor comment updates
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-09 18:00:58 -04:00
Kevin O'Connor
e1833e020a chelper: Use CLOCK_MONOTONIC_RAW
Switch the host code from the CLOCK_MONOTONIC clock to the Linux
specific CLOCK_MONOTONIC_RAW clock.  It's common for ntp to slew the
CLOCK_MONOTONIC clock to account for drift, and that can break the
host's ability to make accurate predictions of the micro-controller
clock.  This could lead to "move queue empty" errors.  The
CLOCK_MONOTONIC_RAW clock is not slewed and thus should not have this
problem.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-09 12:25:19 -04:00
Kevin O'Connor
4125e176b7 docs: Expand on why it is important to provide the log in Contact.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-08 20:30:35 -04:00
Kevin O'Connor
fa9b321991 docs: Update main documentation to not Smoothieboard support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-08 11:01:54 -04:00
Kevin O'Connor
f7c2d918b6 config: Update Smoothieboard configs with notes on flashing the devices
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-08 10:45:17 -04:00
Kevin O'Connor
f3ac1a2306 docs: Add M206 and M119 to G-Codes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-08 10:23:44 -04:00
Kevin O'Connor
b4f03e8363 docs: Add display g-code commands to docs/G-Codes.md
Add M117 and M73 to the list of supported G-Codes.

Also, remove M117 from the list of commands reported by the HELP
command as that command is typically only used to list "extended
g-code" commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-08 10:12:23 -04:00
Kevin O'Connor
649d7c54f0 travis-build: Narrow portions of test run with "set +x"
No need to include all the test preparation in the verbose output - as
that can make the output more confusing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-08 09:29:13 -04:00
Grigori Goronzy
2991c7a831 stm32f1: implement spi_prepare
Implement spi_prepare to fix the undefined behavior on SPI transaction
start.

Tested with the following command sequence:

allocate_oids count=2
config_spi oid=0 bus=0 pin=PA8 mode=3 rate=1000000 shutdown_msg=
config_spi oid=1 bus=0 pin=PA8 mode=1 rate=1000000 shutdown_msg=
spi_send oid=0 data=30313233343536373839
spi_transfer oid=1 data=3031

Discussion about this here:
https://github.com/KevinOConnor/klipper/pull/453#issuecomment-403131149

Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
2018-07-08 09:25:11 -04:00
Grigori Goronzy
ebd9035325 SPI: introduce spi_prepare function
The SPI interface needs to be enabled and configured to the correct
settings of a given oid before CS is asserted. The new function
spi_prepare() allows ports to do that.

This port only introduces the new function in all ports with no
implementation and adds the call to the Klipper generic firmware code.
That means everything still works as before. Ports need to be changed
to fix the underlying issue.

Discussion about the motivation here:
https://github.com/KevinOConnor/klipper/pull/453#issuecomment-403131149

Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
2018-07-08 09:25:11 -04:00
Grigori Goronzy
5c7c8c984b stm32f1: add SPI support
Add basic SPI support and associated documentation.

v2: remove baud rate check, fix baud rate calculations
v3: finish transaction with BSY check, disable SPI when not in use

Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
2018-07-07 11:05:33 -04:00
Kevin O'Connor
b0ee323e2e heater: Introduce smooth_time config option; remove pid_deriv_time
Add generic temperature smoothing to the Heater class.  This is useful
to avoid min_extrude_temp and verify_heater errors due to measurement
noise.

Rename the pid_deriv_time config option to smooth_time so that the
smoothing amount need only be specified once.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-06 13:47:10 -04:00
Kevin O'Connor
32175bc66a test: Minor comment update in travis-build.sh
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-05 15:19:37 -04:00
Kevin O'Connor
bbd3f18178 test: Clean up travis-ci build output
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-05 11:49:10 -04:00
Kevin O'Connor
85797a1f76 test: Add additional commands to test in commands.test
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-05 11:02:48 -04:00
Kevin O'Connor
295a6f48fc test: Add additional movement commands to move.gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-05 11:02:09 -04:00
Kevin O'Connor
1eb416002b sam3x8e: Read from the SPI_RDR on SPI send even if no data needed
Be sure to read the SPI_RDR as that clears the RDRF flag.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-05 10:29:52 -04:00
Kevin O'Connor
7e9ee6aef7 docs: Minor updates to Code_Overview.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-03 13:33:48 -04:00
Kevin O'Connor
80bcafda77 test: Add a test case for common g-code configuration and status commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-03 12:34:33 -04:00
Eric Callahan
b91b0f24db gcode: fix for GET_POSITION (#454)
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-07-03 12:22:55 -04:00
Kevin O'Connor
0dbfa915de adccmds: Add support for min/max temperature check filtering
Extend the ADC out of range check so that it is possible to sample
multiple times before going into a shutdown state.  This reduces the
chance that measurement noise will cause an error.  In an actual over
temperature (or under temperature event) it is expected that the
sensor will consistently report the problem, so extra checks for an
additional second or two should not substantially increase risk.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-02 13:56:34 -04:00
Hans Raaf
5b3444c060 config: Add Anycubic Kossel plus size delta printer config
Signed-off-by: Hans Raaf <hr-klipper@oderwat.de>
2018-07-02 12:28:19 -04:00
Kevin O'Connor
bae094eac3 test: Expand whitespace checks to test files and test compile configs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-01 10:52:30 -04:00
Kevin O'Connor
58b77e783f test: Expand whitespace checks to *.lds files
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-01 09:50:42 -04:00
Kevin O'Connor
997719af13 test: Fix typo in whitespace check - there is no src/lib/ directory
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-01 09:46:07 -04:00
Kevin O'Connor
f767bee8ff test: Expand whitespace checks to docs/ and test/ directories
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-01 09:42:09 -04:00
Kevin O'Connor
e08bb4f196 docs: Fix whitespace error in stm32f1.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-01 09:41:35 -04:00
Janar Sööt
3a1d9e779c buttons: Improve rotary encoder handler by using Ben Buxton state machine. (#445)
https://github.com/brianlow/Rotary

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2018-07-01 08:41:14 -04:00
Kevin O'Connor
b41770caa6 tmc2130: Add a DUMP_TMC helper command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-30 19:01:56 -04:00
Kevin O'Connor
38d7b9ada0 buttons: Add initial support for detecting button presses
Add mcu support for periodically polling for a button press.  Add host
code support for registering buttons and invoking callbacks for them.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-30 14:28:51 -04:00
Kevin O'Connor
4061026c25 reactor: Add ability to register callbacks
Add the ability to register callbacks - both asynchronous (ie, from
another thread) and synchronous.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-30 14:13:47 -04:00
Kevin O'Connor
ecf53e6194 gcode: Add run_script() method that is valid from non-command contexts
Add an ability to run a series of g-code commands from a reactor
callback that isn't part of the normal g-code command processing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-30 14:13:06 -04:00
Kevin O'Connor
4ad44e3e83 gcode: Rename run_script() to run_script_from_command()
Emphasize that the run_script() method is only valid when run from a
g-code command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-30 14:08:02 -04:00
Kevin O'Connor
53b718a621 pins: Strip pin names before trying to parse them
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-30 14:05:27 -04:00
Kevin O'Connor
0cbfcfd3d1 test_klippy: Add option to not remove temporary files
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-30 12:31:49 -04:00
Kevin O'Connor
d725160706 mcp4451: Add initial support for programming the mcp4451 on lpc176x
Add support for programming smoothieboard current.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-29 21:20:12 -04:00
Kevin O'Connor
cc6b416660 test: Add support for testing klippy with multi-mcu configs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-29 13:52:23 -04:00
Kevin O'Connor
5922a1ea1b test: Add example kinematic config files to printers.test testcase
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-29 13:16:50 -04:00
Kevin O'Connor
fe676fa099 test: Add Ender2 and ReArm configs to printers.test testcase
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-29 13:14:14 -04:00
Kevin O'Connor
cda08a844a test: Add a build test case for the PRU
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-28 17:01:12 -04:00
Kevin O'Connor
6aba3c552b build: Build pru gcc in travis-ci scripts and then cache it for later use
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-28 17:01:11 -04:00
Kevin O'Connor
52ab93be6d build: Collect travis build files travis build specific directories
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-28 15:03:41 -04:00
Arksine
640169310f display: fix for 128 x 64 pixel displays
Right justify fan speed and feed rate, keep progress centered.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-28 13:11:44 -04:00
Kevin O'Connor
154397b92c test: Add a whitespace check to the travis build
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-28 13:02:55 -04:00
Kevin O'Connor
efb27f095c build: Cleanup whitespace errors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-28 13:00:20 -04:00
Arksine
e11851276d display: uc1701 spi fix
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-28 10:01:57 -04:00
Arksine
f529d7476d config: update Creality Ender 2 configuration to include display
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-27 19:46:38 -04:00
Arksine
696ee69f2c config: update example-extras.cfg to include uc1701 display
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-27 19:46:38 -04:00
Arksine
593b4d2656 display: add UC1701 graphics controller support
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-27 19:46:38 -04:00
Arksine
19d6205492 display: add VGA font
Font from fntcol16.zip package:
ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
(c) Joseph Gil
Font is public domain

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-27 19:46:38 -04:00
Grigori Goronzy
6078145dcd stm32f1: fix ADC pin list
For some reason, the upper two pin definitions were missing. Found while
writing the port documentation.

Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
2018-06-27 18:22:06 -04:00
Grigori Goronzy
eb02043943 stm32f1: add port documentation (#425)
Fixes #412.

Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
2018-06-27 18:21:23 -04:00
Kevin O'Connor
4889e8241d pid_calibrate: Update the heater's target temperature during calibration
Update the target temperature during the pid calibration.  This gives
additional feedback to the user and it makes it less likely that a
verify_heater error will be raised during calibration.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 14:39:20 -04:00
Kevin O'Connor
7e497af184 heater: Don't peak into Heater class member variables
The control classes should not peak into the heater member variables.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 14:32:10 -04:00
Kevin O'Connor
483c51e864 display: Move icons to their own module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 13:18:03 -04:00
Kevin O'Connor
e907253dba display: Move st7920 code to its own module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 13:18:03 -04:00
Kevin O'Connor
f85b43a789 display: Move hd44780 code to its own module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 13:18:03 -04:00
Kevin O'Connor
373c7ff301 display: Move klippy/extras/display.py to klippy/extras/display/display.py
Move the display code into its own directory.  This is in preparation
for splitting it up into its own modules.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 13:18:03 -04:00
Kevin O'Connor
2622b439fc klippy: Allow extras modules to be directories
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 13:01:48 -04:00
Arksine
af1cd3c4ce config: add configuration for Creality Ender 2
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 12:35:08 -04:00
Arksine
d350e2c617 display: add M117 "show message" support
When M117 is followed by an empty string, the display will reset to
Klipper's default.

Internal modules may look up the display and directly call
set_message(), with a timeout if desired.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-27 12:33:25 -04:00
Arksine
8a0c9a457a display: M73 Updates
- Add M73 support for HD44780
- Include HD44780 USB and SD glyphs to differentiate progress type
- Fix bug that prevented M73 from updated when virtual_sd is enabled
- Add 5 second timeout to reset display when not Printing

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-06-27 12:32:30 -04:00
Kevin O'Connor
06ef60011e gpiocmds: Add update_digital_out command
Add a command that can immediately set the value of a digital output
pin created with config_digital_out.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 12:10:39 -04:00
Kevin O'Connor
7aec52dfb3 avr: Don't set SS high on spi_init()
The AVR requires that the SS pin be an output pin for correct SPI
operation.  Some boards use the SS pin to control devices separate
from SPI, however.  Don't change the output level if the pin is
already an output, and prefer setting it low if it is not already an
output pin.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 12:10:25 -04:00
Kevin O'Connor
d651851567 pru: Disable ADC reading directly from the PRU
The PRU code size has grown too close to the maximum - remove the ADC
code to reduce its overall size.  (On the beaglebone, the Linux
process can, and typically does, do the ADC reading.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-27 12:10:25 -04:00
Kevin O'Connor
41058d22a6 toolhead: Disable all extruder motors on a motor_off()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-23 20:41:43 -04:00
Kevin O'Connor
f08a0c5e93 lcd_st7920: Use a longer delay at the start of each command/data
It appears the st7920 requires a longer delay when switching from
command to data mode (and vice-versa).  Slower MCUs don't show a
problem because the klipper command processing time results in a
sufficient delay.  However, some of the faster MCUs can process
klipper commands fast enough that the next st7920 transfer is sent too
fast.  Add an additional delay to account for this.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 23:47:09 -04:00
Kevin O'Connor
74de181e59 delta: Don't peak into PrinterRail class from get_calibrate_params()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 15:42:20 -04:00
Kevin O'Connor
d9a32f75fa probe: Rename get_position() callback to get_probed_position()
The different uses of get_position() can be confusing, so choose a
different name for the ProbePointsHelper callback.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 15:33:12 -04:00
Kevin O'Connor
3e88ffabf1 mathutil: Move trilateration code from delta.py to mathutil.py
Move the trilateration algorithm to mathutil.py.  It may be useful
outside of delta kinematics, and it complicates the delta code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:12:09 -04:00
Kevin O'Connor
77a2c95b5e delta: Remove the unnecessary StepList constant
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
4e01ab4ef0 corexy: Remove the unnecessary StepList constant
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
13acdf7832 cartesian: Remove the unnecessary StepList constant
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
890298d34d itersolve: Support setting the stepper position via a cartesian coordinate
Add support for an itersolve_set_position() function that sets a
stepper position from a cartesian coordinate.  This eliminates the
need for both the python and C code to be able to translate from a
cartesian coordinate to a stepper position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
0216201cb6 delta: Rename get_position() to calc_position()
Calculating the cartesian position from the stepper positions can be
complex and cpu intensive, so rename it to calc_position() to be more
descriptive.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
20b404ecf5 probe: No need to call kin.get_position() to report position
After a probe operation, homing_move() will already have recalculated
the toolhead position.  The get_position() method can be slow, so use
the already calculated position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
0791c69499 stepper: Replace PrinterHomingStepper with PrinterRail
Update the code to use the term "rail" when dealing with a motor
controlled "axis".  A rail has a series of steppers and endstops that
control that motor controlled "axis".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
93d0526a77 stepper: Add a get_homing_info() method to PrinterHomingStepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
968ed58b61 stepper: Add a get_range() method to PrinterHomingStepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
b96542f0e5 stepper: Don't peak into PrinterStepper members
Add additional wrapper functions so that no outside callers need to
peak into the member variables of PrinterStepper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
9a97a348ae stepper: Add a is_stepper_enabled() method to PrinterStepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
28b7a28651 stepper: Don't store step_dist in PrinterStepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
544f8c1e85 stepper: Add a get_name() method to PrinterStepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
Kevin O'Connor
d0590ccb0e stepper: No need to pass printer reference to kinematic/stepper constructors
The config reference already stores a reference to the printer object.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 14:09:01 -04:00
AxMod 3D Print
76e2b041b4 config: Add generic config for Re-Arm (LPC1768)
Signed-off-by: Ax Smith-Laffin (ax@darknetweb.co.uk)
2018-06-21 15:51:40 -04:00
Kevin O'Connor
d94c856118 display: Allow the ST7920_DISPLAY parameter to be configured
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-21 09:58:35 -04:00
Kevin O'Connor
3ac9fc6e63 docs: Update documentation with iterative solver changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
926829e737 itersolve: Move tracking of commanded position to itersolve code
Track the commanded position in just the itersolve.c code instead of
in mcu.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
8f747e2720 kin_cartesian: Remove stepcompress_push_const()
All the kinematic code now uses the iterative solver to generate
steps.  Remove the old stepcompress_push_const() mechanism.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
eb73b5d0b0 stepper_buzz: Convert to iterative solver
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
bbe53cf8e5 extruder: Convert to using iterative solver
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
7148ebd565 cartesian: Convert cartesian kinematics to use the iterative solver
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
fc4a9e7564 corexy: Convert corexy to use the iterative solver
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
ca0d0135dc delta: Convert delta kinematics to use iterative solver
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
2511471b0d itersolve: Add kinematic iterative solver code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
ba3428822d stepcompress: Allow stepcompress_alloc() to be called early
Don't require an mcu connection to allocate the stepcompress object.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
9a2eb4bedd chelper: Move cartesian and delta kinematics code to their own C files
Move the cartesian and delta specific code to new files
kin_cartesian.c and kin_delta.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
8a830ff0ce chelper: Compile with gcc -fwhole-program option
Use the -fwhole-program option when compiling the host C code.  This
makes it easier to support inlining across C files.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
189ebb4c7d chelper: Add compiler.h header
Add the compiler.h header file to the chelper code - this adds a
number of useful gcc definitions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
bedbfceafc stepper_buzz: Move STEPPER_BUZZ command from stepper.py to new file
Add a klippy/extras/stepper_buzz.py file to handle the STEPPER_BUZZ
command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
Kevin O'Connor
c60c9ee302 klippy: try_load_module() should return the module loaded
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00
pyr0ball
995367bd52 scripts: Add installation script for CentOS (#367)
The purpose of this PR is to add an installation script to klipper for use on Centos. Several packages names are different from debian based installs, and the system service is handled via systemd rather than LSB.

Signed-off-by: Alan Weinstock <pyroballpcs@gmail.com>
2018-06-19 15:57:21 -04:00
Douglas Hammond
9519e05394 temperature_fan: Fix issue 403 use max_speed
Signed-off-by Douglas Hammond  <wizhippo@gmail.com>
2018-06-19 11:51:07 -04:00
Oli
7a606633fa config: anet e10 update
Signed-off-by: Zsolt Olah <beer.olius@gmail.com>
2018-06-19 11:36:52 -04:00
Kevin O'Connor
d887a403ff test: Try to cache gcc arm download during travis-ci builds
The gcc arm download sometimes fails - try to cache it within the
travis-ci system to prevent that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-18 13:19:12 -04:00
Kevin O'Connor
4fbecfa1fc lpc176x: Build with LCD support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-18 12:46:08 -04:00
Kevin O'Connor
711a69396f test_klippy: Default to only showing log information on an error
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-17 11:48:06 -04:00
Kevin O'Connor
c89983fd96 scripts: Add additional explicit dependencies to install-octopi.sh
Add virtualenv, build-essential, gcc-arm-none-eabi, and
binutils-arm-none-eabi packages - just in case they aren't already
installed.  Reported by @AxMod3DPrint.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-17 10:49:06 -04:00
Kevin O'Connor
d94dc44e98 test: Add a dual_carriage test case
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-17 10:03:43 -04:00
Kevin O'Connor
ea18034258 test: Add STEPPER_BUZZ and DELTA_CALIBRATE tests to delta.test
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-17 09:55:30 -04:00
Kevin O'Connor
6841f0b5a8 test_klippy: Use verbose output when running klippy
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-17 09:55:30 -04:00
Kevin O'Connor
9972db5a2a test: Add multi_z test case
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-17 09:47:34 -04:00
Kevin O'Connor
eb801631b9 test: Add basic klippy regression tests
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-16 16:20:49 -04:00
Kevin O'Connor
780e3c3022 klippy: Return an error code if batch input results in an error
When reading from a debug input file, propagate any errors to the
program return status.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-16 16:18:01 -04:00
Kevin O'Connor
efe63d5efe toolhead: Add support for the M204 command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-15 12:05:45 -04:00
Hans Raaf
4ec1244c31 Extras: Probing does reply with the z position where the probe triggers.
This change will make the "PROBE" command actually reply with the
z-position where the probe triggers. As this command is called
internally for the BED_TILT_CALIBRATE and Z_TILT_ADJUST those commands
will also give a response while probing, which I see as advantage over
the silent operation.

This change also lets one define some gcode for a repeatable probing
test to meassure the quality of the sensor and overall probing accuracy.

Signed-off-by: Hans Raaf <hr-klipper@oderwat.de>
2018-06-13 22:34:25 -04:00
Kevin O'Connor
268e39fe52 config: Add "axes: z" and "G4 P100" to sample-bltouch.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-13 22:32:45 -04:00
Kevin O'Connor
064212a191 logextract: Detect clock field even if it is last field on line
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-13 22:32:41 -04:00
Kevin O'Connor
3819ad2986 probe: Catch and propagate errors raised during ProbePointsHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-11 21:35:53 -04:00
Hans Raaf
e110e1fecc homing_override: Add axes config parameter
Added a config parameter to define the homing override axes. This way
one can still home x and y axis without the z-probe cycle coming in the
way.

Signed-off-by: Hans Raaf <hr-klipper@oderwat.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-11 20:41:18 -04:00
Kevin O'Connor
5f640699b7 scripts: Add python-dev dependency to install-octopi.sh
The python-dev package is usually already installed, but there's no
harm in stating it explicitly.  Reported by @yschroeder.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-09 19:12:52 -04:00
Kevin O'Connor
4367a985e2 verify_heater: Disable when writing output to a debug file
Disable the verify_heater checks when debugging, as otherwise it can
cause failures when processing files in batch mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-08 23:51:41 -04:00
ruevs
e90edc0447 config: Add configuration file for the Anycubic Kossel delta printer
The printer uses the TriGorilla board which is an
AVR ATmega2560 Arduino + RAMPS compatible board.
The diplay is a RepRapDiscount Smart Controller 2004 compatible one.

Signed-off-by: Peter Ruevski <dpr@ruevs.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-07 13:46:33 -04:00
Kevin O'Connor
1ace688ea3 extruder: Report max_extrude_ratio in log
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-05 20:48:55 -04:00
Kevin O'Connor
183e0decf8 output_pin: Fix SET_PIN max_val check
The maxval should be self.scale.  Reported by @mvturnho.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-05 09:12:31 -04:00
Michael Barbour
a748cf39eb stepcompress: Fix comment typo.
Signed-off-by: Michael Barbour <barbour.michael.0@gmail.com>
2018-06-04 09:41:55 -04:00
Kevin O'Connor
f020ed179e config: Add sample voron2 config file
Add config/kit-voron2-2018.cfg - a sample configuration file for the
Voron2 printer.  Based on config file from "Maglin".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-01 21:38:19 -04:00
Kevin O'Connor
2c4ca88887 docs: Update documentation to note use of /dev/serial/by-path/
When using multiple micro-controllers it may be necessary to use an id
from /dev/serial/by-path/ instead of /dev/serial/by-id/.  Also,
emphasize that in config/example-multi-mcu.cfg.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-01 17:22:03 -04:00
cruwaller
404cd376b5 gcode: mux command is already registered error print fixed
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-06-01 16:05:10 -04:00
cruwaller
26378c2564 mcu: config_reset_cmd typo fixed
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-06-01 09:49:55 -04:00
Kevin O'Connor
ff9543eee2 clocksync: Simplify is_active() check
In some rare circumstances it was possible for the host software to
become so busy that it does not transmit a get_clock request for
several seconds.  (In particular, this could occur with some complex
calls to coordinate_descent.)  If that happened, it was possible for
the code to incorrectly report a "Timeout with MCU" error.  Rework the
is_active() check to prevent that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-31 18:20:30 -04:00
Kevin O'Connor
1b1d2adb31 gcode: Apply SET_GCODE_OFFSET to next move command
Apply the changes made by a SET_GCODE_OFFSET command to the next move,
even if the move is relative to the last movement.  This allows the
command to implement "babystepping" requests.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-29 14:09:04 -04:00
Kevin O'Connor
b93fd5b1b5 basecmd: Rename get_status to get_clock
Change the get_status command to get_clock.  Don't report the shutdown
status in the new get_clock command.

The primary purpose of this change is to force the host code to report
a firmware version mismatch with older firmwares as recent changes
(namely the ordering of message block acks) have subtle
incompatibilities if different host/mcu code is used.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-29 10:57:29 -04:00
Kevin O'Connor
879c45db19 mcu: Do not automatically restart MCU with new config if it is shutdown
Normally, the MCU is restarted on a config change.  However, that
should not be done automatically if the MCU is in a shutdown state.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-29 10:57:29 -04:00
Kevin O'Connor
d798fae20b serialqueue: Limit message transmission to available receive buffer size
If the mcu is using a traditional serial port, then only send a new
message block if there is space available in the mcu receive buffer.
This should make it significantly less likely that high load on the
mcu will result in retransmits.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-28 11:12:30 -04:00
Kevin O'Connor
0728c1a8be msgproto: Add support for a get_constant_int() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-28 10:43:40 -04:00
Kevin O'Connor
75f8709947 command: Wait to send ack until after processing commands
Send the ack after processing commands - this gives the host code more
information on serial buffer utilization.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-28 10:43:40 -04:00
Kevin O'Connor
528f9f7604 command: Add command_find_and_dispatch() helper
Add a helper function that calls command_find_block() followed by
command_dispatch().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-28 10:43:39 -04:00
Kevin O'Connor
c8af3feee6 command: Add a command_encode_and_frame() helper
Add a helper function that calls command_encodef() followed by
command_add_frame().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-28 10:43:39 -04:00
Kevin O'Connor
cb4e165071 command: Prefer uint8_t* for buffers; prefer uint8_fast_t for lengths
Prefer using 'uint8_t' buffers as it is too easy to run into C sign
extension problems with 'char' buffers.  Prefer using 'uint_fast8_t'
for buffer lengths as gcc does a better job compiling them on 32bit
mcus.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-28 10:43:39 -04:00
Zsolt Olah
2a55741ea8 config: Anet E10 config added
Signed-off-by: Zsolt Olah <beer.olius@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-28 09:46:15 -04:00
Kevin O'Connor
c9dfdf21e5 docs: Remove lpc176x item from Todo
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 13:56:54 -04:00
Kevin O'Connor
20ddd842b7 klippy: Fix detection of mixed case section names
If a section name had mixed case it would cause an incorrect error
during the section/option config checking.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 12:47:51 -04:00
Kevin O'Connor
c38a63d4db gcode_macro: Add the ability to define custom g-code macros
Add the ability to add a custom g-code command that in turn executes
one or more configured g-code commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 12:40:06 -04:00
Kevin O'Connor
2994638380 lpc176x: Add a dummy "make flash" command to advise users on how to flash
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:58:23 -04:00
Kevin O'Connor
ef7d4dd3cb config: Add example generic-smoothieboard.cfg config file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:52:13 -04:00
Kevin O'Connor
4344f7fc10 lpc176x: Add build rules for smoothieware bootloader support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:52:13 -04:00
Kevin O'Connor
c381d03aad lpc176x: Initial support for serial over usb
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:52:13 -04:00
Kevin O'Connor
c812a40a37 lpc176x: Add ADC support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:52:13 -04:00
Kevin O'Connor
65613aeddf lpc176x: Enable watchdog
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:52:13 -04:00
Kevin O'Connor
83d3c17280 docs: Add LPC1768 benchmarks to Features.md document
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:52:13 -04:00
Kevin O'Connor
141bd0ce9b test: Add LPC176x compile test case
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:52:13 -04:00
Kevin O'Connor
c78b90767f lpc176x: Add support for GPIO pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:52:13 -04:00
Kevin O'Connor
970831ee0d lpc176x: Add initial support for LPC176x processors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:52:13 -04:00
Kevin O'Connor
5ae22a5e51 tmc2130: Allow the PWMCONF register to be configured
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:38:27 -04:00
Kevin O'Connor
1e6fa5722a tmc2130: Initial support for sensorless homing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:38:23 -04:00
Kevin O'Connor
26246b1f28 tmc2130: Use an SPI rate of 4Mhz
The spec recommends 4Mhz for SPI, so use that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:38:18 -04:00
Kevin O'Connor
3799f40f29 tmc2130: Configure stealthchop velocity limit
Change stealhchop config option to a stealthchop_threshold
configuration option.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-25 11:38:12 -04:00
Hans Raaf
739d37feac config: Add printer config for the Ender 3 by Creality3D
- Changed max positions
- Tuned PIDs for my stock Ender 3 heaters (using 200/50)
- Added the serial device as 'by-id'. Not sure if that is working as I
expect it :)
- I did set the position endstop to 0.5 .. Not sure if people like that.

Signed-off-by: Hans Raaf <hr-klipper@oderwat.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-24 18:04:25 -04:00
Kevin O'Connor
c4fe43ffce tmc2130: The default TOFF time should be 4
The recommended TOFF time in "standalone mode" according to the
tmc2130 is 4, so use that as the default.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-24 10:44:45 -04:00
Kevin O'Connor
ee4f37fe0c stepper: Add STEPPER_BUZZ command
Add a new command that can help diagnose stepper motor connectivity.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-24 09:49:17 -04:00
Kevin O'Connor
e50c2aa38d docs: Remove "touch panel" item from Todo document
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-23 22:31:45 -04:00
FeepingCreature
237c242d65 Display M73-indicated progress plus linear ETA on ST7920 displays.
Signed-off-by: Mathis Beer <mathis_beer@yahoo.de>
2018-05-23 20:46:17 -04:00
Kevin O'Connor
d7b29eca47 temperature_fan: Don't write "temperature_fan " to prefix stats
Just write the user provided name in the stats.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-23 18:22:02 -04:00
Kevin O'Connor
bf301a977e graphstats: Make check for stats prefixes more robust
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-23 18:19:50 -04:00
Kevin O'Connor
3e1febce78 temperature_fan: Don't always enable stats generation
Don't return True from the stats() method - that keeps stats logging
on permanently.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-23 00:27:32 -04:00
Kevin O'Connor
3025638b9b z_tilt: Add support for Z_TILT_ADJUST
Add new module to support independent adjustments to multiple Z
steppers to account for bed tilt.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-22 22:23:44 -04:00
Kevin O'Connor
4bf1b042b1 console: Report timestamp on each read message
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-21 12:01:26 -04:00
Kevin O'Connor
c2d48aba87 byteorder: Add a header file defining common byteswap functions
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-21 09:44:40 -04:00
Kevin O'Connor
e3e3aa63d7 build: Add gcc option -std=gnu11
Some older versions of gcc require this flag in order to compile the
code correctly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-21 09:43:48 -04:00
Kevin O'Connor
42ca985bef docs: Add reference to homing_override in FAQ
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 19:33:54 -04:00
Kevin O'Connor
2db5415d09 config: Add example config file for the Einsy-Rambo board
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 18:11:26 -04:00
Kevin O'Connor
680c92de40 tmc2130: Add initial support for TMC2130 stepper motor drivers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 18:03:06 -04:00
Kevin O'Connor
61fbd193f9 gcode: Reset extrude_factor and extruder position on a tool change
The extrude_factor and extruder position are specific to the current
extruder, so reset them to default values on a Tn command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 13:47:00 -04:00
Kevin O'Connor
33c2c8f1bd gcode: Raise an error if a duplicate command is registered
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 13:08:22 -04:00
Kevin O'Connor
2ab47cd20c extruder: Fix SET_PRESSURE_ADVANCE so that it works with multiple extruders
Use the new gcode.register_mux_command() so that SET_PRESSURE_ADVANCE
works correctly with multiple extruders.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 12:52:19 -04:00
Kevin O'Connor
75a1e9ea21 output_pin: Use new gcode.register_mux_command()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 12:44:02 -04:00
Kevin O'Connor
5a88a14afc servo: Use new gcode.register_mux_command()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 12:40:10 -04:00
Kevin O'Connor
abe79056c9 gcode: Add ability to register a "mux" command
It's common to add commands that dispatch to a particular object
instance depending on the value of a command parameter.  (For example,
the command "SET_SERVO SERVO=xyz" wants to be handled by the
particular "xyz" servo instance.)  Add a register_mux_command() helper
to gcode.py make it easier to do this.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 12:33:43 -04:00
Kevin O'Connor
6869e7d1ec probe: Verify horizontal_move_z not less than probe's z_offset
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 11:41:28 -04:00
Kevin O'Connor
c5bff88943 probe: Move code from bed_tilt and delta_calibrate into ProbePointsHelper
Move the common config reading and probe object lookup from the
bed_tilt.py and delta_calibrate.py code into the ProbePointsHelper
class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-20 11:41:07 -04:00
Kevin O'Connor
11816295e7 stepper: Raise an error if position_endstop is not in min/max range
Raise an error during config parsing if the position_endstop is not
between the position_min and position_max.  This avoids a confusing
error message during homing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-18 19:41:03 -04:00
Kevin O'Connor
2740838b2e fan: Allow the fan shutdown_speed to be configured
Add a shutdown_speed config option to fans so that users can specify
the speed on a shutdown event.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-18 19:12:03 -04:00
Douglas Hammond
5712283e91 Add temperature controlled fans
Signed-off-by Douglas Hammond  <wizhippo@gmail.com>
2018-05-17 12:50:21 -04:00
Kevin O'Connor
6d376017bc config: Fix printer-tronxy-x5s-2018.cfg file flags
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-17 12:47:08 -04:00
Kevin O'Connor
a11add60e2 config: Add example config file for the creality cr10 mini
The cr10 mini is the same as the cr10, but with different Y and Z
dimensions.  Reported by @cassianoleal.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-17 12:43:25 -04:00
Kevin O'Connor
c331406774 util: Change the /tmp/printer pty to be group readable
For some reason, Linux creates the pseudo tty with group writable
permissions, but not group readable.  Use chmod to allow the device to
also be group readable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-16 13:25:21 -04:00
Kevin O'Connor
3505a0727d config: Update printer-creality-cr10s-2017.cfg to use z position_max=400
The cr10s should has a z length of 400mm.  Reported by @nic-str.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-15 18:53:40 -04:00
Kevin O'Connor
70068985a7 stepper: Introduce and use gpio_out_toggle_noirq()
The gpio_out_toggle() function in the sam3x8e and stm32f1 code was
only valid if it was called with irqs disabled.

Commits 018c5daa and 9c52ad43 enabled the lcd code which called
gpio_out_toggle() with irqs enabled.  This could cause corruption of
the gpio state.

Introduce a gpio_out_toggle_noirq() function that will only be invoked
with irqs disabled, and fix gpio_out_toggle() on sam3x8e and stm32f1
so that it safe to call even if irqs are enabled.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-15 17:09:11 -04:00
Kevin O'Connor
907cfb9105 stepper: Fix typo in error report - name should be self.name
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-14 12:31:28 -04:00
Kevin O'Connor
6c3db80d89 homing: Apply speed rounding after calling home_prepare()
The step speed rounding and the cpu delay must be run after running
the endstop specific preparation code.  Otherwise, a delay in the
home_prepare() code could undo those calculations.  Specifically, this
could lead to errors on a multi-mcu setup when the Z is homed using a
virtual_z_offset and there is a delay in the activate_gcode section.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-14 11:40:35 -04:00
Michael Barbour
bf3c41cd06 temperature_fan: Add support for temperature-triggered fan.
Signed-off-by: Michael Barbour <barbour.michael.0@gmail.com>
2018-05-10 19:32:23 -04:00
Lukas Wingerberg
6ad344c8a6 config: Add example generic-radds.cfg config file
Signed-off-by: Lukas Wingerberg <lukas@wingerberg.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-10 11:40:09 -04:00
Kevin O'Connor
2e3fa8da13 console: Fix handling of bad commands
Don't return early on a command error - continue to process remaining
commands and pop commands from the queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-08 11:31:25 -04:00
Kevin O'Connor
f70fefa06f linux: Convert linux SPI code to use the generic spicmds.c code
Use the generic spi send/receive code on Linux.  Update the replicape
code to use the updated command format.

Also, update the replicape code to turn off the stepper motors on a
shutdown event.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-07 09:10:34 -04:00
Kevin O'Connor
31ae74c56c sam3x8e: Add SPI support
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-07 09:10:34 -04:00
Kevin O'Connor
22487d95e9 spicmds: Rework SPI message transmission
Improve the SPI message transmit system.  Add support for bus speed
and bus mode.  Add support for sending SPI messages on shutdown.

Signed-off-by: Petri Honkala <cruwaller@gmail.com>
Signed-off-by: Douglas Hammond <wizhippo@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-07 09:10:34 -04:00
Kevin O'Connor
838da992e8 msgproto: Support sending empty strings from create_message()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-07 09:07:22 -04:00
Kevin O'Connor
9c52ad4310 stm32f1: Enable lcd chip support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-07 01:03:25 -04:00
Kevin O'Connor
018c5daa94 sam3x8e: Enable lcd chip support
Testing shows the hd44780 and st7920 chips do work on the Due.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-07 01:03:01 -04:00
Kevin O'Connor
99b233df3f serialqueue: Fix batching of BACKGROUND_PRIORITY_CLOCK messages
In order to properly delay BACKGROUND_PRIORITY_CLOCK messages, they
must be 5ms beyond the minimum defined by MIN_REQTIME_DELTA.  So, add
both MIN_REQTIME_DELTA and MIN_BACKGROUND_DELTA to the timing of these
messages.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-05 20:59:33 -04:00
Kevin O'Connor
640ff1ad56 clocksync: Change timer frequency to avoid resonating with other timers
If the clock querying messages occur at a similar frequency to other
events on the micro-controller or host, then it's possible for the
load created by those other events to skew the clock synchronization.
In particular, the 500ms lcd screen update could resonate with the 1
second clock query.  Use an unusual clock querying frequency to avoid
this issue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-05 20:14:46 -04:00
Kevin O'Connor
cd9e21e3aa FAQ: Add item on TMC2208 being disabled in the middle of a print
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-05-05 13:06:55 -04:00
cruwaller
7fd14848ca chelper: Fix hub-ctrl compilation
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-05-05 11:23:18 -04:00
Kevin O'Connor
1f11c171c7 thermistor: Add Honeywell 100K and MGB18 thermistor definitions
Add two additional thermistors (as suggested by Tim Miller).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-30 16:08:17 -04:00
Kevin O'Connor
461390ac87 config: Add exaple generic-rumba.cfg config file
Add config file for the RUMBA board (from config provided by Tim
Miller).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-30 15:48:14 -04:00
Kevin O'Connor
15248706ae chelper: Move the host C code to a new klippy/chelper/ directory
Move the C code out of the main klippy/ directory and into its own
directory.  This reduces the clutter in the main klippy directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-30 11:44:53 -04:00
Kevin O'Connor
8e1b516eb6 config: Fix typo in adc_temperature section (Ohms vs Volts)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-30 10:31:39 -04:00
Kevin O'Connor
4a8f9407b8 avr: Do not use Idle mode
The AVR chips (bizarrely) start an ADC conversion when entering Idle
mode.  This behavior can cause the ADC to be busy when a sample is
required.  Worse, if a series of events cause the cpu to enter and
leave Idle mode with a timing similar to the ADC checking rate then it
can cause the ADC to show as busy for extended periods.  This could
cause high MCU load and possibly lead to a "Rescheduled timer in the
past" shutdown.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-28 21:26:42 -04:00
Kevin O'Connor
46cf3ef145 avr: Explicitly set ADCSRA on each conversion start
Don't logically or the ADSC bit on the start of a conversion -
explicitly set the full contents of the register.  Also, clear the
ADIF flag on each write.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-25 19:13:44 -04:00
Kevin O'Connor
cf475a9a39 avr: Clean up serial port register aliases
Define unique register aliases for all of the hardware serial port
definitions.  This makes it easier to deal with the AVR chips that use
different register names.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-25 10:55:18 -04:00
Kevin O'Connor
22c49a7c3f docs: Improve FAQ update software entry (use make menuconfig ; make clean)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-25 10:29:55 -04:00
Kevin O'Connor
76bafadb71 virtual_sdcard: Add logging on start, stop, stats, and shutdown
Add additional logging to the virtual_sdcard support.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-23 18:35:15 -04:00
Kevin O'Connor
3ef7c00b73 docs: Fix internal link description in Code_Overview.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-23 18:23:39 -04:00
Kevin O'Connor
bdd26e421b toolhead: Add a SET_VELOCITY_LIMIT command
Add a command to adjust the maximum velocity, acceleration, and
junction deviation parameters.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 22:36:05 -04:00
Kevin O'Connor
d5dc6b785d gcode: Add minval/maxval/above/below options to get_X parsers
Add value checking to gcode parameter parsing code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 22:24:36 -04:00
Kevin O'Connor
8f4f5da11c fan: Add a set_shutdown_speed() method
Add a set_shutdown_speed() method so that the heater_fan code does not
need to peek into the fan object's internal members.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 22:16:08 -04:00
Kevin O'Connor
6d03dee104 gcode: Add a SET_GCODE_OFFSET command
The M206 command is confusing (it uses negative offsets) and isn't
very flexible.  Add a new SET_GCODE_OFFSET command to make it easier
to add virtual offsets to gcode commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 20:04:41 -04:00
Kevin O'Connor
93262919ed gcode: Rename homing_add to homing_offset
The M206 command is confusing as positive values in that command
result in negative offsets to future g-code commands.  Perform the
parameter negation in the M206 command instead of storing it that way
internally.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 19:46:19 -04:00
Kevin O'Connor
68864333f3 probe: Limit Z lift speed to be the same as the probing speed
When using an automatic probe, limit the Z lift speed to be no greater
than the Z probing speed.  This can reduce Z jerks during probing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 14:00:41 -04:00
Kevin O'Connor
eff1c8604d klippy: Reword the error messages during config file parsing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 13:38:08 -04:00
Kevin O'Connor
85e6cd865c fan: Scale fan speed requests between 0 and max_power
If the fan's max power is limited by the config, then scale speed
requests between 0 and max_power.  This makes more sense for typical
g-code fan speeds.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 13:15:03 -04:00
Kevin O'Connor
48e9fa04e7 toolhead: Allow max_accel_to_decel to be greater than max_accel in config
If max_accel_to_decel is greater than max_accel in the config, then
just internally limit max_accel_to_decel to max_accel.  This makes it
easier to completely disable the max_accel_to_decel feature (as it can
just be set to a high value in the config).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 12:50:04 -04:00
Kevin O'Connor
832c0bc017 docs: Add more hints to use /dev/by-id/ for the serial device
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 11:57:49 -04:00
Kevin O'Connor
6793970198 serial_irq: Add new generic/serial_irq.c code
Extract out common code from avr/serial.c, sam3x8e/serial.c, and
stm32f1/serial.c into a new generic/serial_irq.c file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 11:19:37 -04:00
Kevin O'Connor
606222da5b docs: Add STM32F103 benchmarks to the Features document
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 11:19:37 -04:00
Kevin O'Connor
add370230f stm32f1: Use generic timer_irq.c dispatch code
With the optimized timer_read_time() it is no longer necessary to
implement custom timer dispatch code - use the generic mechanism in
timer_irq.c.  This simplifies the code and provides a small
performance increase.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 11:19:37 -04:00
Kevin O'Connor
2bf9e27b9e stm32f1: Use different method for handling 16bit -> 32bit timer conversion
Implement 32bit timer conversion without disabling interrupts.  This
uses the 16th bit of timer_high as a rollover detection flag.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 11:19:37 -04:00
Kevin O'Connor
06a4753f73 stm32f1: Prefer uint32_t over uint16_t in timer.c
The ARM architecture handles 32bit values faster than 16bit values -
use uint32_t where possible.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-20 11:19:37 -04:00
Kevin O'Connor
bf4e851e21 config: Update sample-bltouch.cfg with recent probe changes
Commit e3f9ff67 changed the probe code to require a z_offset parameter
- update the config/sample-bltouch.cfg file with the new parameters.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-18 18:04:21 -04:00
Kevin O'Connor
35f3f6506b scripts: Add stm32flash to octopi-install.sh package list
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-12 13:58:30 -04:00
Kevin O'Connor
c539fed8bb docs: Add additional information to FAQ on heater checks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 22:00:26 -04:00
Kevin O'Connor
b5b365289c test: Add STM32F1 compile test case
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 19:23:55 -04:00
Grigori Goronzy
75d5737211 Add STM32F103 port
Add a fully functional STM32F1 port, currently mostly targeting STM32F103
microcontrollers. This requires an 8 MHz XTAL. The maximum possible step rate
is around 282K steps per second.

This uses stm32flash to burn the firmware. The bootloader needs to be started
by setting BOOT0 to 1 and resetting the MCU. There is no automatic bootloader,
unlike on Arduino.

Signed-off-by: Grigori Goronzy <greg@kinoho.net>
2018-04-09 18:08:29 -04:00
Grigori Goronzy
e097b08520 config: add display support for Anet A8
Signed-off-by: Grigori Goronzy <greg@kinoho.net>
2018-04-09 16:24:14 -04:00
Kevin O'Connor
6466af6313 adc_temperature: Support defining custom sensors in the config file
Allow the user to define a custom sensor with their own set of
temperature/voltage measurements.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 15:44:34 -04:00
Kevin O'Connor
c463893a5e adc_temperatures: Add "PT100 INA826" sensor type
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 15:12:35 -04:00
Kevin O'Connor
b2caa486c5 adc_temperature: Support multiple ranges for ADC lookup
Instead of supporting a single linear range for the temperature
lookup, allow multiple ranges to be defined.  This makes the lookup
more accurate when a full lookup table is available.

Update the AD595 sensor to use the full table defined in its spec.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 15:06:53 -04:00
Kevin O'Connor
75b89f5261 thermistor: Fallback to using beta if Steinhart-Hart c3 is negative
If the c3 coefficient is negative it can cause the adc calculations to
fail.  The c3 shouldn't be negative in practice, so fallback to a
simple beta calculation in that case.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 12:35:18 -04:00
Kevin O'Connor
8c8261ba80 thermistor: Add support for defining custom thermistors
Add the ability to define a new thermistor type in the config file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 12:17:39 -04:00
Kevin O'Connor
f8a28401c0 config: Update indentation of display section in example-extras.cfg
Use the same indentation as the other sections.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 12:02:23 -04:00
Kevin O'Connor
97f30765a1 docs: Update installation document for OctoPrint 1.3.7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 11:39:36 -04:00
Arkadiusz Gluszyk
f616a88b15 Adjusted Tronxy X5s settings
Signed-off-by: Arkadiusz Gluszyk <agluszyk@cs.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-09 11:24:31 -04:00
Kevin O'Connor
7c5f9ee458 config: Add display section to default Creality CR10s config
The CR10s uses a "12864" type display on the standard RAMPS pins.
Reported by @jm493.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-08 11:14:48 -04:00
Kevin O'Connor
460cc88f3d pid_calibrate: Make sure to unregister new control class on error
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-06 11:39:24 -04:00
Kevin O'Connor
06d73207e7 heater: Move Thermistor and Linear to their own files in extras/
Move the Thermistor code to a new thermistor.py module.  Move the
Linear code to a new adc_temperature.py module.  This simplifies the
heater.py code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-04 23:14:55 -04:00
Kevin O'Connor
0fc4f0946e heater: Move adc logic into Thermistor class
The Thermistor (and Linear) class should handle all the details of
reading the ADC values and converting them to temperatures.  So, move
that logic out of the Heater() class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-04 23:14:33 -04:00
Kevin O'Connor
7e78b2665e heater: Merge ThermistorBeta class into Thermistor class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-04 23:13:55 -04:00
Kevin O'Connor
aed958eb5c heater: Add PrinterHeaters class that stores all sensors and heaters
Add a PrinterHeaters class that can stores references to available
temperature sensors and stores references to instantiated heaters.

Add a extras/heater_bed.py file and delay instantiation of the
heater_bed object.  This allows the heater.py module to be imported
earlier during the setup phase, and allows the PrinterHeaters class to
be available for registering sensors and heaters.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-04 23:13:53 -04:00
Kevin O'Connor
4eeb43b191 pins: Remove module level get_printer_pins() and setup_pin() functions
Most callers did a lookup of the pins module via
printer.lookup_object("pins").  Use that as the standard method and
remove these less frequently used methods.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-04 12:26:39 -04:00
Kevin O'Connor
a4439b93b7 toolhead: Limit junction speed of short moves
The existing junction algorithm limits the speed between two moves by
determining the maximum speed an arc between those two moves would
have if the cetripetal acceleration of that arc did not exceed the
printer's maximum acceleration.

However, should the slicer send an actual arc to the printer, then the
existing junction algorithm would not impose any significant limit on
the travel speed of that arc.  This would permit the head to travel in
a circle at high velocity and with a greater centripetal acceleration
than the printer's maximum acceleration.  To avoid this, impose a
limit on the junction velocity of short moves so that an approximate
centripetal acceleration of that move does not exceed the move's
acceleration limit.

Suggested by Michael Barbour.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-03 13:35:10 -04:00
Kevin O'Connor
5e060c3c65 bed_tilt: Apply bed_tilt_calibrate settings to current session
Apply the bed tilt settings immediately after finding them.  This
makes it easier for users to perform automatic tilt calibration at the
start of every print.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-03 13:18:53 -04:00
Kevin O'Connor
0f1a142779 extruder: Log SET_PRESSURE_ADVANCE changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-03 13:18:53 -04:00
Kevin O'Connor
bb8926d67a klippy: Automatically clear rollover_info on each restart
Automatically clear the information printed at the start of each log
file rollover on a klippy internal restart.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-04-03 13:18:52 -04:00
Michael Barbour
a301713361 extruder: Add SET_PRESSURE_ADVANCE command.
Signed-off-by: Michael Barbour <barbour.michael.0@gmail.com>
2018-04-03 00:00:41 -04:00
Kevin O'Connor
bee179eab4 docs: Update release notes for v0.6.0 release
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-31 14:04:39 -04:00
Kevin O'Connor
039bb9f10f docs: Add Patreon link to FAQ page
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-31 13:55:41 -04:00
Kevin O'Connor
b0b4bc8958 heater: Add some comments to the thermistor math
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-29 16:40:26 -04:00
Kevin O'Connor
a6553538e6 docs: Update G-Codes.md with recent output_pin changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-28 15:11:10 -04:00
Kevin O'Connor
019666a6f6 docs: Add a section on adding new host modules to Code_Overview.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-28 13:12:41 -04:00
Kevin O'Connor
7579b9671b stepstats: Add documentation clarification
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-23 10:51:11 -04:00
Kevin O'Connor
99f3c99238 display: Round temperature and position to nearest whole number
The "%d" formatting truncates a floating point number - use "%.0f" to
show a rounded number.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-19 15:17:53 -04:00
Kevin O'Connor
aba04bf3bd display: Remove unneeded semicolons from file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-19 15:16:01 -04:00
Kevin O'Connor
f5c67baac2 docs: Recommend running PID_CALIBRATE in Config_checks.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-18 12:43:41 -04:00
Kevin O'Connor
973ef97143 pid_calibrate: Move PID calibration logic from heater.py to new file
Drop support for M303 and PID_TUNE, and replace it with a new
PID_CALIBRATE command.  Move the logic for this command from heater.py
to a new pid_calibrate.py file in the extras/ directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-18 12:02:30 -04:00
Kevin O'Connor
310cdf88cc config: Remove tabs from printer-wanhao-duplicator-i3-v2.1-2017.cfg
Remove tabs from example config file and replace with spaces.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-18 11:44:56 -04:00
Kevin O'Connor
5c05a24947 docs: Fix typo in M220 description in G-Codes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-18 11:44:56 -04:00
Kevin O'Connor
c93dad8eba config: Update generic-cramps.cfg with P9_23 machine enable
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-18 10:33:40 -04:00
Kevin O'Connor
fb3065cfa7 config: Change pullup_resistor to 2000 in generic-cramps.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-17 14:18:49 -04:00
Kevin O'Connor
e3f9ff6701 probe: Add z_offset parameter
Move the probe_z_offset parameter from delta_calibrate and
bed_tilt_calibrate to a z_offset parameter within the probe config
section.  It's easier to understand the z offset setting when it is in
the probe config section.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-17 14:07:15 -04:00
Kevin O'Connor
c95cc3fb66 bed_tilt: Take into account the XY position used with z_virtual_endstop
If a z_virtual_endstop is in use, then record the last XY position
that is used when the Z is homed.  Use that XY position to report what
change is needed to the z position_endstop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-17 13:47:31 -04:00
Kevin O'Connor
1dda4628a0 bed_tilt: Require at least 3 probing points for bed_tilt_calibrate
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-17 13:47:31 -04:00
Kevin O'Connor
36612fd544 probe: Default z_position to the configured minimum position on Z axis
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-17 13:47:31 -04:00
Kevin O'Connor
ef8c464d97 output_pin: Move pwm and digital output pins to new module in extras/
Rename the digital_output, pwm_output, and static_pwm_output config
sections to output_pin and move to a new module in the extras/
directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-17 13:46:36 -04:00
Kevin O'Connor
66eefa1da8 static_digital_output: Add static_digital_output section to extras/
Move the code for the static_digital_output config section from
chipmisc.py to a new file in the extras/ directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-17 13:06:51 -04:00
Kevin O'Connor
e78377eebd replicape: Add config controls for the servo[01]_enable lines
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-17 12:55:48 -04:00
Kevin O'Connor
451f7d5672 gcode: Position returned by M114 should be relative to last G92
It looks like OctoPrint is expecting the result from M114 to be
relative to the last G92 command.  Also, introduce GET_POSITION to
report the actual location that the printer is at.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-15 20:00:51 -04:00
Kevin O'Connor
ef820d98f6 docs: Add "will heaters be turned off on a crash" item to FAQ
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-13 11:36:45 -04:00
Kevin O'Connor
9dfe612516 verify_heater: Provide additional information on a heater error
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-12 23:31:17 -04:00
Kevin O'Connor
830cfc5414 klippy: Rework starting error message
Commit 9bc4239e now emphasizes the first line of a multi-line error
message, so rework startup_message to conform to that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-12 23:15:22 -04:00
Kevin O'Connor
45afa04578 probe: Add some hints for common errors during PROBE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-12 23:00:50 -04:00
Kevin O'Connor
9bc4239e9c gcode: On a multi-line error message, report the first line twice
Report the first line of a multi-line error message twice - once as
part of the informational content, and once with the "!!" error
prefix.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-12 22:56:31 -04:00
Kevin O'Connor
3a1cdc7d70 virtual_sdcard: Fix typo in seek error handling
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-12 22:36:39 -04:00
Kevin O'Connor
3a75748762 config: Reword the min_temp/max_temp description in example.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-12 14:37:02 -04:00
Kevin O'Connor
e336c24665 heater: Allow min_temp to go below zero
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-12 14:36:45 -04:00
Kevin O'Connor
849f4ed25f verify_heater: Scale hysteresis duration check
If a heater falls out of the target range, accumulate the temperature
differences to determine if an error should be raised.  This should
make it less likely to report an error for heaters that drift slightly
out of range, and it should make error reporting faster for heaters
that rapidly fall out of range.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-11 19:21:32 -04:00
Kevin O'Connor
57d342b455 verify_heater: Change default hysteresis to 10 degrees
A default of 4 degrees and 10 seconds may be too aggressive - change
the default to 10 degrees and 15 seconds.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-11 13:29:28 -04:00
Kevin O'Connor
5208fc38ed verify_heater: Add initial support for verifying heaters and sensors
Add runtime checks to heaters and temperature sensors to check for
possible hardware faults.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-11 00:49:11 -05:00
Kevin O'Connor
b549c3927e klippy: Allow external callers of try_load_module()
It can be useful to automatically pull in a module in the extras/
directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-11 00:04:30 -05:00
Kevin O'Connor
e53a589ac3 docs: Add SET_DUAL_CARRIAGE command to G-Codes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-10 20:22:13 -05:00
Kevin O'Connor
4d48c111d8 cartesian: Initial support for dual carriages
Add support for additional carriages on cartesian printers.  This is
used by some printers to handle multiple extruders.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-09 10:26:21 -05:00
Kevin O'Connor
6c1e1dcc8d display: Use separate hd44780 screen drawing
Separate out the hd44780 screen drawing from the st7920 code.  Use a
layout that takes advantage of the 20 columns.  Add custom hd44780
fonts.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-08 22:44:40 -05:00
Kevin O'Connor
ddcf9a7ff7 docs: Add Tx command to G-Codes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-08 14:40:26 -05:00
Kevin O'Connor
05ec7ca7ff docs: Add a G-Codes.md file with the list of available commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-08 14:11:20 -05:00
ghandye
ef0c80af51 config: Add working printer configuration for Wanhao Duplicator i3 v2.1
Working printer configuration for a Wanhao Duplicator i3 v2.1 and its
clones, including Monoprice Maker Select and Cocoon Create. Includes a
working config for the st7920-based front panel LCD.

Signed-off-by: Andy Ellsworth <andy+github@dar.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-08 10:26:21 -05:00
christian mock
d997821e58 config: Add LCD configuration to printer-trony-x5s-2017.cfg
I've added the LCD configuration for the Tronxy X5S printer and its
Melzi board and 128x64 LCD. This is tested and works.

I've also added the pins for the encoder, but that is untested.

Signed-off-by: christian mock <cm@tahina.priv.at>
2018-03-07 15:56:07 -05:00
Kevin O'Connor
385e6b67d9 config: Add display section to creality cr10 config
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-07 13:40:33 -05:00
Marcio Teixeira
04602b2470 display: Choose arrow character based on display
Choose the arrow character based on whether the display is ST7920 or
HD44780.

Signed-off-by: Marcio Teixeira <marcio@alephobjects.com>
2018-03-06 14:01:10 -05:00
cruwaller
923954772f homing: allow to disable homing retract
Homing retract can be disabled by setting homing_retract_dist to 0.

Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-03-06 13:45:48 -05:00
Kevin O'Connor
5a16863465 config: Fix hd44780 typo in rambo and ramps example configs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-06 13:15:09 -05:00
Kevin O'Connor
08a5f8a5ff display: Add initial support for LCD screens attached to an MCU
Add support for displaying basic status information on ST7920 and
HD44780 based LCDs that are attached directly to a micro-controller.

Signed-off-by: Marcio Teixeira <marcio@alephobjects.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-06 11:30:46 -05:00
Kevin O'Connor
43ac56766e serialqueue: Support sending messages at a background priority
Support low-priority message transmits.  This may be useful for bulk
commands that should be delayed util the comms are otherwise idle.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-06 11:30:41 -05:00
Kevin O'Connor
afc9bcf27b lcd_hd44780: Add micro-controller code for the HD44780 LCD chip
Add support for passing messages to an HD44780 chip via a 4-bit
bit-banging interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-06 11:30:34 -05:00
Kevin O'Connor
9140f36d99 lcd_st7920: Add micro-controller code for the ST7920 LCD chip
Add support for passing messages to an ST7920 chip via a SPI
bit-banging interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-06 11:30:30 -05:00
Kevin O'Connor
fa07be9346 mathutil: Move coordinate_descent() to new file
Add a new python file (mathutil.py) and move the coordinate_descent()
code to it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-04 09:56:50 -05:00
Kevin O'Connor
7290ed5f73 clocksync: Fix multi-mcu frequency adjustments with long moves
Commit 02ae2ab9 had a typo causing the new long move handling logic to
not take effect.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-03 21:54:25 -05:00
Kevin O'Connor
fc60bda4d1 virtual_sdcard: Remove trailing '*' checksum indicator from M23 command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-02 11:58:00 -05:00
Kevin O'Connor
82a65e9f4a docs: Note the use of the virtual_sdcard feature
Note that virtual_sdcard helps on slower machines.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-03-02 11:28:01 -05:00
Kevin O'Connor
b139a8561f serialhdl: Add a wrapper around the results of lookup_command()
Add a lookup_command() method to the SerialReader class that provides
a wrapper that stores the serial and commandqueue references.  This
makes it easier to run the send() method.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-27 21:06:16 -05:00
Kevin O'Connor
8518da9824 config: Move description of phase adjusted endstops to config-extra.cfg
Move the description of stepper phase adjusted endstops to a new
section in config-extra.cfg.  This keeps the main example config file
a little more concise.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-27 09:34:25 -05:00
Kevin O'Connor
656cb2c417 build: Use git describe --always
Add --always flag to "git describe" command to get a build identifier
even if one checks out the repo with a depth parameter that prunes out
the last tagged version.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-26 21:50:05 -05:00
Kevin O'Connor
239c1ad5c9 serialqueue: Don't clear must_exit flag at start of pollreactor_run()
Avoid a timing race where must_exit is set before pollreactor_run() is
started.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-26 16:21:10 -05:00
Kevin O'Connor
7733e1d832 test: Add travis_fold markers to build output
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-26 15:21:39 -05:00
Kevin O'Connor
99b4122901 test: Add compile tests for at90usb1286 and atmega1284p chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-26 15:03:05 -05:00
Kevin O'Connor
28d70eaf0c test: Update travis build to include a basic klippy host test
Move the travis installation steps from the travis-build.sh script to
a new script (scripts/travis-install.sh).  Move the travis-build.sh
script to the scripts/ directory as well.

The data dictionaries built in the compile tests are useful during
host software testing, so run all the compile tests sequentially in a
single VM and save the data dictionaries after each build.  Also,
build all the config files found in the test/configs/ directory.

Create the python virtualenv environment during the install phase and
invoke the klippy.py host software in the build phase to perform a
basic host software sanity check.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-26 14:58:49 -05:00
Kevin O'Connor
5d635c5252 config: Use .0025 as the default z step_distance in sample configs
Don't use tiny step distances on the Z as that could cause a surprise
to users that copy the config without updating all the settings.  (A Z
step distance that is too small would cause a high motor velocity.)  A
step distance of .0025 is very popular in practice, so change the
default example configs to use that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-25 16:00:55 -05:00
Kevin O'Connor
22d7e48aa2 config: Add an example config file that uses multiple MCUs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-25 12:59:09 -05:00
Sebastian Meyer
a6b0649cb1 test: Add travis CI
Signed-off-by: Sebastian Meyer <ich@sebmeyer.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-25 10:54:59 -05:00
Sebastian Meyer
58dd6d9106 build: Link objects ahead of libraries to avoid failures on some platforms
Signed-off-by: Sebastian Meyer <ich@sebmeyer.de>
2018-02-25 10:39:06 -05:00
Douglas Hammond
d139389267 avr: Add at90usb646 support
Signed-off-by: Douglas Hammond wizhippo@gmail.com
2018-02-25 10:23:00 -05:00
Kevin O'Connor
e99c0f53f8 graphstats: Support selecting an mcu to graph from the command-line
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-19 23:12:14 -05:00
Kevin O'Connor
02ae2ab984 clocksync: Rework multi-mcu adjust to better handle long moves
The multi-mcu clock syncing code relies on the ability to periodically
update the mcu clock adjustments.  If a series of very long moves are
submitted then it is possible the adjustments could become unstable.
For example, if an adjustment is made to reduce a clock error over the
next couple of seconds, but it is applied to a longer period because
the next move lasts many seconds, then this would result in a bigger
adjustment for the following move, which would result in an even
bigger error when that move lasts many seconds.  This can repeat until
the system destabilizes.

Check for cases where the print_time is far in the future of the
current estimated print time and average over a longer period in that
case.  That should reduce the possibility of the adjustment code
becoming unstable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-19 22:13:28 -05:00
Kevin O'Connor
97f7735c6a graphstats: Set size on frequency graph
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-18 20:42:28 -05:00
Kevin O'Connor
69486e45c1 ad5206: Warn if ad5206 enable pin is inverted
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-17 23:18:10 -05:00
Kevin O'Connor
5e8aaed41f docs: Add tips for porting to new kinematics to Code_Overview.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-17 13:48:53 -05:00
Kevin O'Connor
c128a9dfd5 probe: Increase calibration log level from debug to info
Output more information by default from the bed_tilt and
delta_calibrate commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-16 13:30:49 -05:00
Kevin O'Connor
6dc623b35d config: Expand homing_override description in sample-bltouch.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-13 15:29:49 -05:00
Kevin O'Connor
8fc3487a8a config: Reword description of set_position_x paramter in homing_override
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-11 15:35:10 -05:00
Kevin O'Connor
82db072151 config: Add a config snippet for the BLTouch probe
Add an example to help users with a BLTouch probe.  This is based on
information from @mediumo and @riddlez666.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-11 15:11:11 -05:00
Kevin O'Connor
41f73d0c8c config: Add a "printer-" prefix to example printer config files
Add a prefix to the example printer config files so that a sorted
directory listing shows all the samples bundled together.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-11 14:58:48 -05:00
Kevin O'Connor
08a1183a01 virtual_sdcard: Initial support for virtual sdcard
Add support for directly printing from a local file on the host.  This
may be useful if the host cpu is not fast enough to run OctoPrint
well.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-11 14:13:12 -05:00
Kevin O'Connor
f77e1b67f6 gcode: Introduce request_restart() method
Use request_restart() method instead of prep_restart() and
motor_heater_off().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-11 14:11:33 -05:00
Kevin O'Connor
11c7c110a1 gcode: Extract special cases from process_data()
Handle the unlikely case of pending commands in a new method
process_pending().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-11 14:10:09 -05:00
Dave Bacon
5abea041b4 mcu: Fix PWM static start value setup
config_setup uses ._start_value instead of ._static_value which isn't defined.

Signed-off-by: Dave Bacon <drb.github@mrbacon.com>
2018-02-10 13:00:22 -05:00
Dave Bacon
268d1cb27c docs: Update Config_checks.md
Navigation should be to the temperature tab to find the Tool temperature box.

Signed-off-by: Dave Bacon <drb.github@mrbacon.com>
2018-02-07 22:24:32 -05:00
Kevin O'Connor
561c84dd93 pins: Warn on invalid pin format
Raise an error if a pin description isn't formatted correctly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-07 16:09:25 -05:00
Kevin O'Connor
955d940b60 bed_tilt: Negate parameters reported by bed_tilt_calibrate
The bed_tilt_calibrate command determines the tilt of the bed.
However, we need to report the tilt compensation which is the negative
of the bed tilt.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-05 14:52:38 -05:00
Kevin O'Connor
6ea36de9f2 config: Add a pointer to example-extras.cfg at the end of example.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-05 14:34:05 -05:00
Kevin O'Connor
e0cedfb853 heater: Report stats whenever the heater is active
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-05 13:55:59 -05:00
Kevin O'Connor
0a5b07f9da klippy: Allow any stats producer to determine when stats are needed
Instead of using the toolhead class to determine if stats should be
reported, allow every printer object with a stats() callback to
determine if stats are needed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-05 13:52:05 -05:00
Kevin O'Connor
08874b9c91 clocksync: Respond faster to clock changes
Average clock sync times over approximately 30 seconds instead of 120
seconds so that the clock prediction responds to changes faster.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-05 12:33:29 -05:00
Kevin O'Connor
8121a4a29f avrsim: Rework pacing mechanism
Rework the pacing mechanism to make it more stable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-05 11:38:13 -05:00
Kevin O'Connor
d1c209c689 graphstats: Fix multi-mcu parsing with reordered stats
The mcu stats (that contain a prefix) may occur before some other
stats - make sure to only apply the stats prefix to those stats that
need it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-03 18:43:52 -05:00
Kevin O'Connor
f4bfce260a klippy: Introduce load_config_prefix() for modules that take parameters
Use both load_config() and load_config_prefix() functions when
dynamically loading a module from the extras directory - if the config
section name has parameters in it then use load_config_prefix().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-03 12:53:11 -05:00
Kevin O'Connor
7e3adde542 klippy: No need to store fileconfig in main printer object
Just pass the fileconfig reference to the ConfigWrapper instances.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-03 12:17:42 -05:00
Kevin O'Connor
33bdc2fc32 util: Call set_nonblock() in create_pty()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-02 18:32:03 -05:00
Kevin O'Connor
0b76864453 gcode: Make sure need_ack is always restored on run_script()
Restore need_ack even on a G-Code exception.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-02 18:32:03 -05:00
Kevin O'Connor
56bfb3280a gcode: Keep reading input to check for M112 (emergency stop)
OctoPrint (and other software) will sometimes send additional commands
even if the previous command has not yet responded with an "ok".
Change the g-code input reading code to keep reading input so that an
M112 can be detected (and processed out-of-order).  To avoid the
extreme case where one writes an entire g-code file to the input
without any pacing, disable the input reading if more than 20 commands
are pending.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-02 11:00:46 -05:00
Kevin O'Connor
3ddbd34a7c gcode: Propagate errors from run_script()
If the script being run raises an error, then stop running that script
and return the error to the caller.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-01 12:18:47 -05:00
Kevin O'Connor
67f9c4948d gcode: Ack even empty lines
An empty input line should still return an "ok" message.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-02-01 11:03:49 -05:00
Kevin O'Connor
7d3600f918 docs: Add github issue template
Add an issue template requesting the klippy log file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-31 14:30:05 -05:00
Kevin O'Connor
21df21b7af fan: Clarify hardware_pwm and allow cycle_time to be set on software pwm
Specify hardware pwm cycle times using the same method as software pwm
(in seconds, not clock ticks).  Allow the fan code to be configured
with an explicit cycle time even when using software pwm.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-29 13:08:15 -05:00
Kevin O'Connor
b7b216af7f avr: Round hardware pwm clock ticks to nearest divisor
Instead of rounding down to the nearest supported pwm divisor, round
to the nearest divisor.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-29 11:54:15 -05:00
Kevin O'Connor
077a56c2ca mcu: Default the restart method to 'command' on non-serial ports
If the mcu supports command restarts and it does not appear to use a
real serial port, then default the restart method to 'command'.  This
is a better default on boards with native USB support.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-29 10:25:25 -05:00
Kevin O'Connor
a67306c76b msgproto: Support default values in get_constant() calls
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-29 10:10:27 -05:00
Kevin O'Connor
6eefbe5e30 heater: Add stats reporting
Report the current temperature, current pwm setting, and target
temperature as statistics in the log.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 23:37:56 -05:00
Kevin O'Connor
650d55d7b2 docs: Remove bed level probe from todo
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 20:36:04 -05:00
Kevin O'Connor
03bcae8a98 config: Add SeeMeCNC Rostock Max V2 Delta Printer Config
As provided by @FEsmondeWhite

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 20:31:15 -05:00
Kevin O'Connor
1a67902858 homing_override: Allow moves prior to homing an axis
Add support for disabling homing checks via the homing_override
mechanism.  This may be useful to move an axis prior to homing it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
01bb4b291e probe: Create a probe:z_virtual_endstop pin
Create a virtual pin that may be used as the z endstop pin on
cartesian printers that use the probe in place of a z endstop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
e38c7df064 probe: Support activate/deactivate scripts on each probe
Allow a set of g-code scripts to be run on each probe invocation.
This may be useful for probes that need to be setup before they are
useful (eg, with servo actuated probes).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
3001a089c0 homing_override: Add basic support for running custom g-code on G28
Allow users to override the behavior of G28 using a new
"homing_override" config section.  This may be used on printers that
require specific steps during the homing process.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
39d62556b1 bed_tilt: Add support for automatic bed tilt move transformation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
434341d074 delta_calibrate: Add initial support for a DELTA_CALIBRATE command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
ce9db609ad probe: Initial support for Z-Probe hardware
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
6c252d30f5 delta: Allow the user to specify a minimum z position
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
978777f09f replicape: Move the replicape code from chipmisc.py to extras directory
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
5db84779c6 ad5206: Move the ad5206 code from chipmisc.py to extras directory
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
1e3a03fbee servo: Move the servo code from chipmisc.py to extras directory
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
01a89b951a multi_pin: Move the multi_pin code from chipmisc.py to extras directory
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
d166d1f692 fan: Move fan code to extras directory
The print cooling fan and printer heater_fan are independent modules
that can reside in the extras directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
9399911490 klippy: Add support for dynamic loading of python modules
Check if a config section matches a python filename in the
klippy/extras/ directory.  If it does, load that python code to handle
the config section.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
d3665699f1 klippy: Support generic printer_state() and stats() callbacks
Instead of hardcoding which objects are called on state transitions,
allow any "printer object" to be invoked if it has a printer_state()
method.  Convert connect, ready, shutdown, and disconnect callbacks to
this mechanism.

Similarly, allow all printer objects to provide a stats() callback.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
81013ba5c8 klippy: Add access methods and avoid peeking into the printer classes
Add get_reactor(), lookup_object(), lookup_module_objects(), and
set_rollover_info() to the main Printer class so that callers do not
need to peek into the class' members.  Similarly, add get_printer()
and get_name() methods to the ConfigWrapper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
f0a754e496 gcode: Add a run_script() helper method to run g-code scripts
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
51e1085dbc gcode: Extend register_command() so that it can also unregister a command
If register_command() is passed None as the function to call, then
treat it as an unregister command request.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 12:19:26 -05:00
Kevin O'Connor
47bb8b7cc2 graphstats: Fix for print_stall detection
The print_stall logic could cause large portions of the graph to show
up as 100% host utilized.  Rework the logic to avoid that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 10:50:52 -05:00
Kevin O'Connor
33893ece1d logextract: Fix error in config file name print
Fix typo causing an error during the printing of the config file name.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-28 10:50:43 -05:00
Kevin O'Connor
1b3ef8a8fb config: Update anycubic-i3-mega-2017.cfg with stepstick fan
Based on conversation with Marcin Jedliński.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-22 11:28:20 -05:00
Kevin O'Connor
09eec3710d extruder: Add support for extruders sharing the same heater
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-21 23:25:11 -05:00
Kevin O'Connor
6fa95e12ea config: Update wanhao-duplicator-i3-plus-2017.cfg heater settings
Update config based on discussion with Max Holden and Josh Sutinen.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-21 18:52:14 -05:00
Kevin O'Connor
7a11b78fd4 config: Update anycubic-i3-mega-2017.cfg heater settings
Updates to heater settings.  Based on discussion with @bartolomeus and
Marcin Jedliński.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-21 18:47:34 -05:00
Kevin O'Connor
3d26bf6635 logextract: Better handle the case of a missing config section
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-21 15:56:13 -05:00
Kevin O'Connor
08444a8b89 docs: Try to make the klippy.log bug reporting more clear
Emphasize that the log file needs to be attached to the issue.
Encourage M112 to be issued on every bug report.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-21 13:08:31 -05:00
Kevin O'Connor
84c623e705 config: Add example generic-mini-rambo.cfg config file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-17 01:00:20 -05:00
Douglas Hammond
72074078f9 config: Add tronxy x5s config
Signed-off-by: Douglas Hammond <wizhippo@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-16 22:20:55 -05:00
Kevin O'Connor
1d11c4e74d gcode: Use reset_last_position() from cmd_G28()
Use the existing reset_last_position() code in cmd_G28() instead of
manually implementing the logic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-16 21:46:42 -05:00
Kevin O'Connor
f8bb383e9a extruder: Remove unused variable self.config
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-16 21:40:53 -05:00
Cymen Vig
8e5d228555 Add a CR-10S configuration file.
Signed-off-by: Cymen Vig <cymenvig@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-16 18:29:45 -05:00
Kevin O'Connor
6770aa96c9 graphstats: Use alpha transparency when plotting the stats
Use an alpha transparency on each of the stats, so that it is possible
to see how the values overlap.

Also, always enable the "awake time" stat - just use a lower alpha
transparency for it.

Also, explicitly set the graph size as some version of matplotlib have
a different default.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-14 10:46:48 -05:00
Kevin O'Connor
896c31fd05 graphstats: Fix filtering of normal buffer_time runoff stats
Update the mechanism to filter out cases where buffer_time is below
MAXBUFFER so that it works with the statistics currently generated.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-14 10:16:16 -05:00
Kevin O'Connor
054cbbe094 docs: Add a FAQ item on steps to upgrade the software
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-12 18:38:49 -05:00
Kevin O'Connor
0d8ddcadbb toolhead: Improve tracking of print_stall
The previous code increases print_stall if a move is proactively
flushed due to buffer_time_low and a follow up move is ready to send
before the existing moves are fully retired.  However, this would not
track the case where a move is proactively flushed and it takes an
extended amount of time to get sufficient moves to refill the queue.

Change the code so that print_stall increases anytime a new move is
queued after a proactive flush and there are existing moves not yet
fully retired.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-12 16:56:31 -05:00
Kevin O'Connor
d3eda337a9 logextract: Fix parsing of "is_shutdown" messages
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-12 16:44:21 -05:00
Kevin O'Connor
138f3c2646 config: Update avrsim.cfg to use unique pins
Commit 3833669c added checking that each pin is used once in the
config.  This exposed an error in the avrsim.cfg testing config -
analog1 conflicts with ar25.  Use analog7 to avoid this.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-12 16:44:21 -05:00
Kevin O'Connor
f1222565b8 docs: Update Debugging.md with information on logextract
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-11 13:48:40 -05:00
Kevin O'Connor
5caff594c5 heater: Report PID tuning results via the g-code terminal
Determine the median period from the pin tuning tests and use that to
recommend a set of PID parameters.  Report the results over the g-code
terminal.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-10 22:58:12 -05:00
Kevin O'Connor
5a68c636da chipmisc: Enable replicape steppers dynamically
Enable all the steppers via the shift registers when the first stepper
is enabled, and disable all the steppers once all steppers are
disabled.  This avoids having to enable all the steppers all of the
time.  Note that, this support is independent from the current control
for each stepper, which is still done individually.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-10 19:30:57 -05:00
Kevin O'Connor
02b141ac43 chipmisc: Fix replicape enable line setup
The enable lines are not one per stepper - instead there are 5
distinct enable settings.  Handle them properly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-10 19:30:51 -05:00
Kevin O'Connor
47e458210e chipmisc: Support start values on pca9685 pins
Default the pca9685 enable line on if any of the pins attached to it
have a non-zero start value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-10 19:30:47 -05:00
Kevin O'Connor
3833669c3a pins: Check if the same pin is referenced via different aliases
Change the update_command() call to use a new PinResolver class.  In
that new class, verify that the same pin isn't referenced in two
different parts of the config using different aliases for the pin.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-10 19:26:06 -05:00
Kevin O'Connor
df6528715e stepper: Automatically detect and handle shared stepper enable lines
It's common for multiple steppers to use the same stepper enable
line.  Detect this and only create a single digital_out oid on the
micro-controller.

Also, prohibit any other pin from being used multiple times in the
config file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-10 19:10:26 -05:00
Kevin O'Connor
265b9097d5 pins: Rename parse_pin_desc() to lookup_pin()
Always set the pin_params['type'] field on a pin lookup.  Rename
parse_pin_desc() to lookup_pin() to make the change more clear.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-10 14:21:25 -05:00
mjedlinski
a6025686b6 config: Config file for Anycubic i3 Mega
Signed-off-by: Marcin Jedliński <mjedlinski@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-08 23:11:41 -05:00
Kevin O'Connor
ed80b92b59 mcu: Setup static values via setup_start_value() call
Add an "is_static" setting to setup_start_value() and remove the
setup_static() method.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-08 21:21:30 -05:00
nerobot
45e65580f7 config: Create creality-cr10
Signed-off-by: Steven Daglish <s.c.daglish@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-08 18:48:03 -05:00
Kevin O'Connor
f6f174ab36 extruder: Fix pressure advance on tiny moves with over extrusions
The extruder check_move() code will permit moves with huge extrusion
ratios if the amount extruded is tiny.  (Some slicers emit these silly
moves - they are allowed because they are harmless.)  Unfortunately,
the pressure advance code did not handle the huge extrusion ratios -
it would result in a massive, near instantaneous, extruder move in an
attempt to build pressure in the extruder.  Catch this case and limit
the impact to the pressure advance code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-08 14:39:19 -05:00
Kevin O'Connor
0cf06ee69a docs: Note pressure_advance over 0.20 is unlikely to improve quality
Update the pressure advance tuning document to note that 0.20 is
likely the ceiling of a useful pressure advance setting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-08 11:07:26 -05:00
Kevin O'Connor
ed9dee4602 mcu: Only report an MCU timeout once
Don't flood the log with timeout messages.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-08 10:55:37 -05:00
tilsonm
f183871e28 config: Adopt Anet A8 cfg, Anet v1.0-1.5 Boards
This configuration file should work as a base for Anet A8 printers
using the stock Anet v1.0-1.5 boards from late 2016-2017, which are
based around the AVR atmega1284p. Minor tweaks may be required to such
things as /dev/serial/by-id/, thermistor sensor types, and offsets for
carriage and bed.

Signed-off-by: Matt Tilson <tilsonm09@gmail.com>
2018-01-07 22:22:08 -05:00
Kevin O'Connor
d891baa860 avr: Clear the TCNT1 register on timer startup
Just to be safe, clear the TCNT1 register during init.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-07 22:22:08 -05:00
Kevin O'Connor
f6cd51bfb7 avr: Clear the ADCSRA/ADCSRB registers on ADC init
When initializing the ADC, explicitly clear the registers (instead of
logically or'ing them with their previous values).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-07 22:13:39 -05:00
Kevin O'Connor
83e9e92b9a docs: Add a table of contents to the FAQ
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-05 11:42:00 -05:00
Kevin O'Connor
9e4eb050f9 config: Note the need to flash a bootloader on the Melzi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-05 10:23:58 -05:00
Kevin O'Connor
5a86391f78 avr: Only use the avrdude "wiring" protocol on atmega2560 devices
It appears the most common type of avrdude protocol for devices other
than the atmega2560 is the "arduino" protocol.  Update the build to
select a different protocol based on the avr processor type.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-05 10:02:15 -05:00
Kevin O'Connor
29c83cec22 docs: Update installation document with pointers to FAQ
Add some pointers to the FAQ for common pitfalls during installation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-04 13:29:17 -05:00
Josh Sutinen
db927bd822 config: Added Wanhao Duplicator i3 Plus configuration
The Wanhao Duplicator i3 Plus (aka Maker Select Plus,
Microcenter Powerspec Plus, and others) uses an
atmega2560 AVR. The config is based on generic-ramps.cfg
with pin numbers updated from the official Wanhao Marlin
sources at https://github.com/garychen99/Duplicator-i3-plus

Signed-off-by: Josh Sutinen <josh@damagedgoodz.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-04 12:10:01 -05:00
Chris Lee
cb969527bc config: Update TAZ6 defaults for hotend
Use values from Lulzbot fork of Marlin.

Signed-off-by: Chris Lee <clee@mg8.org>
2018-01-04 10:58:47 -05:00
Kevin O'Connor
3ab9a8d26c gcode: Add support for M221 (set extrude factor) g-code command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-03 17:12:31 -05:00
Kevin O'Connor
5db4886c9c gcode: Add support for M220 (set speed factor) g-code command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-03 17:12:26 -05:00
Andy Silverman
b22a81cd34 heater: Added config for heater PWM cycle time.
Added the pwm_cycle_time option for heater config sections.  Defaults
to previous value of 0.100 seconds, but may be reduced to shorter times
at the expense of MCU workload and possible MOSFET heating, depending on
controller design.  Some printers that need bed PID to be enabled,
notably the Felixprinters series, are known to benefit from shorter
cycle times, as the default 10hz rate results in excessive voltage
supply droop.

While this option can be used on extruder heaters as well, there
is not expected to be any particular benefit from doing so unless
the extruder heater presents a particularly large load.

Signed-off-by: Andy Silverman <andrewsi@outlook.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-03 12:32:11 -05:00
Chris Lee
9fc5506c83 config: Add Lulzbot TAZ6 printer configuration
Signed-off-by: Chris Lee <clee@mg8.org>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-03 12:10:40 -05:00
Kevin O'Connor
bba22ab7f0 heater: Provide symbolic names for pid check_busy (aka M109 / M190)
Add PID_SETTLE_DELTA and PID_SETTLE_SLOPE constants to the code to try
and make it a little more clear how the wait for temperature code
works.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-03 10:44:01 -05:00
Kevin O'Connor
a0b4cdb5c4 gcode: Don't wait for temperature if the temperature is disabled
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-03 10:33:10 -05:00
Kevin O'Connor
e4129a7e53 docs: Minor update to square.scad
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-02 21:56:29 -05:00
Kevin O'Connor
00ea3934ee logextract: Add support for extracting shutdown info on multiple mcus
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-01-02 21:48:25 -05:00
Kevin O'Connor
cf4c31cb88 graphstats: Add support for generating a graph of mcu frequency
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-30 18:29:58 -05:00
Kevin O'Connor
f10bd5726d graphstats: Use a smaller font in the graph legend
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-30 18:27:44 -05:00
Kevin O'Connor
7db6fa7bfc graphstats: Fix case where an Xwindows display may not be available
Matplotlib will try to open a display by default - tell it not to do
that so that it can run in batch mode on headless machines.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-30 18:26:49 -05:00
Kevin O'Connor
b05eb1e8e3 logextract: Fix handling of messages with retransmits
Properly handle the case where the original sequence number of a
message is not known.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-29 15:25:39 -05:00
Kevin O'Connor
1bdebeaebf docs: Add an initial configuration checklist document
Provide a document with basic steps that a user can run to verify that
the pins in the configuration file are set correctly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-26 20:54:37 -05:00
Kevin O'Connor
479772ca00 docs: Add a CONTRIBUTING document
Add an initial document detailing best practices for contributing to
the document.  Add the "developer certificate of origin" document.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-24 12:33:01 -05:00
Kevin O'Connor
1d276d160f gcode: Dump internal g-code state in dump_debug()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-21 22:27:49 -05:00
Kevin O'Connor
9313e58123 gcode: Group similar G-Code commands together
Group commands by category instead of listing them in numerical
order.  This is just code movement; no code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-21 20:58:25 -05:00
Kevin O'Connor
d778ae1846 build: Add gcc and binutils version to mcu data dictionary
Store the gcc and binutils versions used in the compilation of the
firmware in the firmware data dictionary.  Forward that information to
the log so it is available during debugging.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-21 20:32:10 -05:00
Kevin O'Connor
522093ef00 docs: Offer alternatives to ssh/scp/sftp
Try to make the Installation document more friendly to users not
familiar with the Linux command-line.  Offer some hints on how to
obtain ssh and how to edit the config file remotely.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-21 17:34:35 -05:00
Kevin O'Connor
d303e556ad sched: Interrupts must be disabled during setjmp() call
On the AVR platform (and possibly others) the longjmp() call will
restore the interrupt state saved during the setjmp() call.  So, the
setjmp() call must be invoked with interrupts disabled to ensure that
shutdown handling is run with interrupts disabled.  This fixes
potential corruption of the shutdown processing on AVR.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-21 12:54:33 -05:00
Kevin O'Connor
1d21bf66c6 homing: Handle speed rounding when homing speed greater than max_velocity
Commit 002dc0df added rounding to the homing speed, but it did not
work if the configured homing speed was less than the printer's
maximum velocity.  Move the speed rounding from stepper.py to
homing.py and make sure the rounded speed is less than the maximum
speed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-20 14:41:20 -05:00
Kevin O'Connor
1b07505973 chipmisc: Add multi_pin capability
Add the ability to alias multiple output pins from a single pin alias.
This makes it possible to support some cases where a single logical
output is driven by multiple output pins.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-18 21:00:06 -05:00
Kevin O'Connor
3c5649219f chipmisc: Add support for output pins set at runtime
Add the ability to define output pins that may be set at runtime with
a new SET_PIN extended g-code command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-18 20:59:07 -05:00
Kevin O'Connor
68d03e4a3e mcu: Allow both shutdown and startup values to be set for output pins
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-18 20:45:00 -05:00
Kevin O'Connor
e6e0a21b06 toolhead: Allow junction_deviation to be set to zero
Allow lookahead to be effectively disabled by setting
junction_deviation to zero.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-18 20:44:59 -05:00
Kevin O'Connor
0e0780a460 logextract: Update file comment
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-18 12:14:10 -05:00
Kevin O'Connor
9a4425c85a docs: Update square test print to contain notches on inside of square
Add additional notches and move them to the inside of the square where
they will not impact the outside perimeter test.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-17 12:18:25 -05:00
Kevin O'Connor
57c27f75ae gpiocmds: Clear SPF_NEXT_* flags on new schedule_soft_pwm_out
Properly handle the (unlikely) case that a schedule_soft_pwm_out
command is received before a previous command is fully processed,

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-16 20:21:38 -05:00
Kevin O'Connor
8d62318c5f clocksync: The clock estimate should add the rtt time not subtract it
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-16 20:21:38 -05:00
Kevin O'Connor
add528532e logextract: Rename extractconfig.py to logextract.py and add shutdown parsing
Add initial support for extracting out shutdown information from a
klippy.log file.  The shutdown dump will be reordered into the
sequence that they occurred, and timestamps/sequence numbers in the
mcu message dump will be expanded.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-16 20:21:34 -05:00
Kevin O'Connor
8944e2104d docs: Add FAQ item on AVR watchdog restart failures
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-11 18:17:14 -05:00
Kevin O'Connor
319221ee23 docs: Provide additional information on "make flash" failures
Add some additional information on "make flash" problems.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-11 17:33:29 -05:00
Kevin O'Connor
4a5801bb2e pins: Fix atmega168/328 mappings
The atmega168 and atmega328 need to define PE0 and PE1 in order to
support the 2 extra analog pins.

Also, support the arduino mappings for the atmega328.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-09 11:48:26 -05:00
Kevin O'Connor
f8acf0f54f delta: Default stepper_b/c position_endstop to stepper_a's
If the position_endstop is not set for stepper_b or stepper_c then use
the value from stepper_a.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-08 18:20:04 -05:00
Kevin O'Connor
bc5d900e61 delta: Support different arm lengths for each tower
Change the config file so that the delta arm length is specified
per-tower.  This makes it possible to support advanced calibration.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-08 18:20:04 -05:00
Kevin O'Connor
efb4a5daa1 delta: Rework actuator_to_cartesian() using trilateration
Use the formulas for trilateration (instead of the circumcenter
formulas) when calculating the position of the nozzle from the
position of the carriages.  The trilateration formula is more general
and it allows each tower to have a different arm length.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-08 18:09:19 -05:00
Kevin O'Connor
e0c947e188 mcu: Store MCU_stepper commanded_pos as a float
It's valid to consider the stepper at a position that is not on a step
interval - only the "mcu position" needs to be an integer.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-07 18:14:50 -05:00
Kevin O'Connor
3ffab763c0 stepper: Only align the stepper motor to a full step when requested
Add a new config option 'homing_endstop_align_zero' to enable the
alignment of the endstop to a stepper full step.  It's possible one
may wish to specify a homing_endstop_phase while not aligning the
endstop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-07 17:35:19 -05:00
Kevin O'Connor
ef09ac5a7f extractconfig: Add helper script that extracts config files from a log
Add a helper script that can read a klippy.log file and extract the
printer.cfg files from it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 21:23:24 -05:00
Kevin O'Connor
f6d4284d5c homing: Directly interact with the kinematic class on query_endstops()
Move the query_endstop logic out of toolhead.py and into homing.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 19:13:54 -05:00
Kevin O'Connor
8d9ca6f2dd homing: Directly interact with the kinematic class when homing
Move the homing logic out of toolhead.py and into homing.py.  This
simplifies the toolhead logic and centralizes the homing code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 19:13:54 -05:00
Kevin O'Connor
1d6af72de5 mcu: Remove unneeded MCU_digital_out.get_last_setting() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 19:13:54 -05:00
Kevin O'Connor
2a8dd5c51f mcu: Reset the stepper step clock on init - not after each motor on
Reset the last step clock during the init phase and after each home -
this simplifies the runtime code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 19:13:54 -05:00
Kevin O'Connor
c78f66b8e8 mcu: Be sure all moves are completed before raising a home timeout
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 19:13:54 -05:00
Kevin O'Connor
b340fdcc4a homing: Make sure to clean up homing state even if homing fails
Make sure to always call MCU_endstop.home_wait() if
MCU_endstop.home_start() is invoked.  Rename
MCU_stepper.note_homing_triggered() to note_homing_end() and make sure
it is always called if MCU_stepper.note_homing_start() is invoked.

With these changes, MCU_endstop.home_finalize() is no longer needed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 19:13:53 -05:00
Kevin O'Connor
7785d3a87d homing: Pass list of endstops (not steppers) to the homing code
The homing code wants the list of endstops to enable during a homing
operation - it's confusing to pass the steppers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 18:49:14 -05:00
Kevin O'Connor
31db4cc772 mcu: Make sure steppers added to an endstop are on the same mcu
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 18:35:51 -05:00
Kevin O'Connor
7932de11a7 mcu: Make sure all endstop objects are disabled on a reconnect
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 18:35:51 -05:00
Kevin O'Connor
bc9cbc8133 gcode: Move SET_SERVO command from gcode.py to chipmisc.py
Now that commands can be registered dynamically, move the code for
SET_SERVO from gcode.py to the PrinterServo() class in chipmisc.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 18:35:51 -05:00
Kevin O'Connor
b5a41d0dd1 gcode: Rework gcode handler setup to allow dynamic command registration
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 18:35:51 -05:00
Kevin O'Connor
64a091fb98 gcode: Add a get_str() method
Add a get_str() method that can extract a required parameter from a
g-code command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 18:35:51 -05:00
Kevin O'Connor
80f23441dd gcode: Simplify exception handling
Translate caught exceptions into a gcode.error() exception.  This way
there is one standard place to invoke respond_error().  Also, always
reset the last_position on a handled error.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 18:35:51 -05:00
Kevin O'Connor
3a2d16abb3 gcode: Always allow M112 command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-06 18:35:49 -05:00
Kevin O'Connor
c70cc8fadb klippy: Always recommend a FIRMWARE_RESTART on a shutdown event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-03 19:52:25 -05:00
Kevin O'Connor
10e11950ae stepper: get_homed_offset() should return a float
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-12-03 19:48:47 -05:00
Kevin O'Connor
37788c1e55 docs: Add a FAQ document
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-30 15:19:40 -05:00
Kevin O'Connor
6d6638826c stepcompress: Fix proactive queue flushing on move with 64K+ steps
Commit e05c6354 changed the internal step compress queue from 64bit
integers to 32bit integers.  However, that commit broke the proactive
flushing of moves that could produce more than 64K steps.  This could
lead to large memory allocations and cpu slow downs on printers that
had a very large Z axis - possibly leading to a "Timer too close" mcu
shutdown.  Correct the code so that it properly generates a 64bit
flush clock.

Also, be sure to only expand / memmove the queue when there is no room
for a new element at the end.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-29 20:24:50 -05:00
Kevin O'Connor
6930a7de8d homing: Base homing cpu delay on estimated number of steps needed
Instead of adding 250ms to each homing operation add a time relative
to the number of estimated steps that are to be generated.  This
scales the delay to really large axes without adding a delay for
normal users.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-29 19:55:25 -05:00
Kevin O'Connor
6bbb84326d docs: Add further details on how to report a bug
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-21 18:27:22 -05:00
Kevin O'Connor
8c2fa2e2d6 stepper: Support for multiple steppers controlling a single axis
Allow multiple steppers to be defined for a single cartesian axis.
This adds support for dual-z setups.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-18 17:37:04 -05:00
Kevin O'Connor
38643f52c9 stepper: Add get_endstops() / set_position wrappers
Add wrappers around mcu_endstop and mcu_stepper so that the kinematic
classes do not need to directly access these low-level classes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-18 17:36:45 -05:00
Kevin O'Connor
eecf3b6ea8 stepper: Store pointers to step_const and step_delta in PrinterStepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-18 17:29:23 -05:00
Kevin O'Connor
fc1d690d75 stepper: Remove unused variables from PrinterStepper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-18 17:29:23 -05:00
Kevin O'Connor
d10380e73f stepper: Additional code comments
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-18 17:29:23 -05:00
Kevin O'Connor
aaeda540b6 stepper: Calculate the stepper name directly from the config section
There is no need to pass the name to the PrinterStepper class as it
can determine the name itself.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-18 17:29:22 -05:00
Kevin O'Connor
fda988889b heater: Avoid math errors on extreme ADC readings
Avoid log(0) and divide by zero errors in the thermistor calc_temp()
method.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-13 11:07:20 -05:00
Kevin O'Connor
b58a897b70 config: List E1 micro-step pins in order in generic-rambo.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-11-08 11:14:37 -05:00
Kevin O'Connor
84d8cf9b7e config: Add a generic-printrboard.cfg file
Add an example config file for the Printrboard board.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-10-30 10:56:08 -04:00
Kevin O'Connor
8463a83324 graphstats: Fix graphing script
Update the graphstats.py graphing script so that it works with recent
stats changes - the stats can now contain groups that end with a ':'
and the print_time is no longer reset to zero on a new print.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2017-10-29 20:36:33 -04:00
944 changed files with 393440 additions and 19655 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ out
*.pyc
.config
.config.old
klippy/.version

26
.travis.yml Normal file
View File

@@ -0,0 +1,26 @@
# This is a travis-ci.org continuous integration configuration file.
language: c
addons:
apt:
packages:
# AVR GCC packages
- gcc-avr
- avr-libc
# PRU GCC build packages
- pv
- libmpfr-dev
- libgmp-dev
- libmpc-dev
- texinfo
- libncurses5-dev
- bison
- flex
cache:
directories:
- travis_cache
install: ./scripts/travis-install.sh
script: ./scripts/travis-build.sh

View File

@@ -32,7 +32,7 @@ dirs-y = src
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
; then echo "$(2)"; else echo "$(3)"; fi ;)
CFLAGS := -I$(OUT) -Isrc -I$(OUT)board-generic/ -O2 -MD -g \
CFLAGS := -I$(OUT) -Isrc -I$(OUT)board-generic/ -std=gnu11 -O2 -MD -g \
-Wall -Wold-style-definition $(call cc-option,$(CC),-Wtype-limits,) \
-ffunction-sections -fdata-sections
CFLAGS += -flto -fwhole-program -fno-use-linker-plugin
@@ -80,12 +80,12 @@ $(OUT)%.o.ctr: $(OUT)%.o
$(OUT)compile_time_request.o: $(patsubst %.c, $(OUT)src/%.o.ctr,$(src-y)) ./scripts/buildcommands.py
@echo " Building $@"
$(Q)cat $(patsubst %.c, $(OUT)src/%.o.ctr,$(src-y)) > $(OUT)klipper.compile_time_request
$(Q)$(PYTHON) ./scripts/buildcommands.py -d $(OUT)klipper.dict $(OUT)klipper.compile_time_request $(OUT)compile_time_request.c
$(Q)$(PYTHON) ./scripts/buildcommands.py -d $(OUT)klipper.dict -t "$(CC);$(AS);$(LD);$(OBJCOPY);$(OBJDUMP);$(STRIP)" $(OUT)klipper.compile_time_request $(OUT)compile_time_request.c
$(Q)$(CC) $(CFLAGS) -c $(OUT)compile_time_request.c -o $@
$(OUT)klipper.elf: $(patsubst %.c, $(OUT)src/%.o,$(src-y)) $(OUT)compile_time_request.o
@echo " Linking $@"
$(Q)$(CC) $(CFLAGS_klipper.elf) $^ -o $@
$(Q)$(CC) $^ $(CFLAGS_klipper.elf) -o $@
################ Kconfig rules

View File

@@ -46,7 +46,7 @@ nozzle_diameter: 0.500
filament_diameter: 3.500
heater_pin: ar4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog1
sensor_pin: analog7
control: pid
pid_Kp: 22.2
pid_Ki: 1.08

View File

@@ -35,7 +35,7 @@ homing_speed: 50
step_pin: ar46
dir_pin: ar48
enable_pin: !ar62
step_distance: .01
step_distance: .0025
endstop_pin: ^ar18
position_endstop: 0.5
position_max: 200

View File

@@ -16,12 +16,22 @@ dir_pin: ar55
enable_pin: !ar38
step_distance: .01
endstop_pin: ^ar2
homing_speed: 50
position_endstop: 297.05
# Distance (in mm) between the nozzle and the bed when the nozzle is
# in the center of the build area and the endstop triggers. This
# parameter must be provided for stepper_a; for stepper_b and
# stepper_c this parameter defaults to the value specified for
# stepper_a.
arm_length: 333.0
# Length (in mm) of the diagonal rod that connects this tower to the
# print head. This parameter must be provided for stepper_a; for
# stepper_b and stepper_c this parameter defaults to the value
# specified for stepper_a.
#angle:
# This option specifies the angle (in degrees) that the tower is
# at. The default is 210 for stepper_a, 330 for stepper_b, and 90
# for stepper_c.
homing_speed: 50
# The stepper_b section describes the stepper controlling the front
# right tower (at 330 degrees).
@@ -31,7 +41,6 @@ dir_pin: ar61
enable_pin: !ar56
step_distance: .01
endstop_pin: ^ar15
position_endstop: 297.05
# The stepper_c section describes the stepper controlling the rear
# tower (at 90 degrees).
@@ -41,7 +50,6 @@ dir_pin: ar48
enable_pin: !ar62
step_distance: .01
endstop_pin: ^ar19
position_endstop: 297.05
[extruder]
step_pin: ar26
@@ -91,11 +99,33 @@ max_z_velocity: 150
# maximum speed of up/down moves (which require a higher step rate
# than other moves on a delta printer). The default is to use
# max_velocity for max_z_velocity.
delta_arm_length: 333.0
# Length (in mm) of the diagonal rods that connect the linear axes
# to the print head. This parameter must be provided.
#minimum_z_position: 0
# The minimum Z position that the user may command the head to move
# to. The default is 0.
delta_radius: 174.75
# Radius (in mm) of the horizontal circle formed by the three linear
# axis towers. This parameter may also be calculated as:
# delta_radius = smooth_rod_offset - effector_offset - carriage_offset
# This parameter must be provided.
# The delta_calibrate section enables a DELTA_CALIBRATE extended
# g-code command that can calibrate the tower endstop positions and
# angles.
[delta_calibrate]
radius: 50
# Radius (in mm) of the area that may be probed. This is the radius
# of nozzle coordinates to be probed; if using an automatic probe
# with an XY offset then choose a radius small enough so that the
# probe always fits over the bed. This parameter must be provided.
#speed: 50
# The speed (in mm/s) of non-probing moves during the calibration.
# The default is 50.
#horizontal_move_z: 5
# The height (in mm) that the head should be commanded to move to
# just prior to starting a probe operation. The default is 5.
#samples: 1
# The number of times to probe each point. The probed z-values will
# be averaged. The default is to probe 1 time.
#sample_retract_dist: 2.0
# The distance (in mm) to retract between each sample if sampling
# more than once. The default is 2mm.

File diff suppressed because it is too large Load Diff

186
config/example-menu.cfg Normal file
View File

@@ -0,0 +1,186 @@
# This file serves as documentation for config parameters. One may
# copy and edit this file to configure a new menu layout.
# The snippets in this file may be copied into the main printer.cfg file.
# See the "example.cfg" file for description of common config parameters.
# Available menu elements:
# item - purely visual element
# command - same like 'item' but with gcode trigger
# input - same like 'command' but has value changing capabilities
# list - menu element container, with entry and exit gcode triggers
# vsdcard - same as 'list' but will append files from virtual sdcard
# deck - special container for custom screens (cards) has entry and exit gcode triggers.
# card - special content card for custom screens. Can only be used in 'deck'!
#[menu item1]
#type: item
# Type will determine menu item properties and behaviours:
#name:
# This is mandatory attribute for every menu element.
# You can use Python output formatting for parameter and transform values.
# Quotes can be used in the beginning and end of name.
#cursor:
# It allows to change cursor character for selected menu element.
# The default is >
# This parameter is optional.
#width:
# This attribute accepts integer value. Element name is cut to this width.
# This parameter is optional.
#scroll:
# This attribute accepts static boolean value. You can use it together with 'width'.
# When this is enabled then names longer than width are scrolled back and forth.
# The default is disabled. This parameter is optional.
#enable:
# This attribute accepts static boolean values and parameters (converted to boolean).
# It accepts multiple logical expressions. Values separated by comma will return True if all elements are true.
# Values on different lines will return True if any element is true.
# You can use logical negation by using character ! as parameter prefix.
#parameter:
# This attribute accepts float values or special variables. Multiple values are delimited by comma.
# All available parameter variables can be listed by 'MENU DO=dump' gcode, menu itself must be running.
# This value is available for output formatting as {0}..{n} Where n is count of parameters.
#transform:
# This attribute allows to transform parameters value to something else.
# More than one transformation can be added. Each transformation must be on separate line.
# These transformed values are available for output formatting as {n+1}..{x}
# Where n is count of parameters and x is count of transformations.
# In order to transform the value of a particular parameter, you must add
# an parameter index as prefix. Like this "transform: 1.choose('OFF','ON')"
# If the index is not set then the default index 0 is used.
#
# map(fromLow,fromHigh,toLow,toHigh) - interpolate re-maps a parameter value from one range to another.
# Output value type is taken from toHigh. It can be int or float.
#
# choose(e1,e2) - boolean chooser, converts the value of the parameter to the boolean type (0 and 1),
# and selects the corresponding value by the index from the list.
#
# choose(e1,e2,...) - int chooser, converts the value of the parameter to the int type
# and selects the corresponding value by the index from the list.
#
# choose({key:value,..}) - special dictionary chooser, parameter value cast type by first key type.
# Selects the corresponding value by the key from the dictionary.
#
# int(), float(), bool(), str(), abs(), bin(), hex(), oct(), days(), hours(), minutes(), seconds()
# These will convert parameter value to the special form.
# int,float,bool,str,abs,bin,hex and oct are python functions.
# days,hours,minutes,seconds will convert parameter value (it's taken as seconds) to time specific value
#
# scale(xx) - Multiplies parameter value by this xx. Pure interger or float value is excpected.
#[menu command1]
#type:command
#name:
#cursor:
#width:
#scroll:
#enable:
#parameter:
#transform:
#gcode:
# When menu element is clicked then gcodes on this attribute will be executed.
# Can have multiline gcode script and supports output formatting for parameter and transform values.
#action:
# Special action can be executed. Supports [back, exit] menu commands
# and [respond response_info] command. Respond command will send '// response_info' to host.
#[menu input1]
#name:
#cursor:
#width:
#enable:
#transform:
#parameter:
# Value from parameter (always index 0) is taken as input value when in edit mode.
#gcode:
# This will be triggered in realtime or on exit from edit mode.
#reverse:
# This attribute accepts static boolean value.
# When enabled it will reverse increment and decrement directions for input.
# The default is False. This parameter is optional.
#readonly:
# This attribute accepts same logical expression as 'enable'.
# When true then input element is readonly like 'item' and cannot enter to edit mode.
# The default is False. This parameter is optional.
#realtime:
# This attribute accepts static boolean value.
# When enabled it will execute gcode after each value change.
# The default is False. This parameter is optional.
#input_min:
# It accepts integer or float value. Will set minimal bound for edit value.
# The default is 2.2250738585072014e-308. This parameter is optional.
#input_max:
# It accepts integer or float value. Will set maximal bound for edit value.
# The default is 1.7976931348623157e+308. This parameter is optional.
#input_step:
# This is mandatory attribute for input.
# It accepts positive integer or float value. Will determine increment
# and decrement steps for edit value.
#input_step2:
# This is optional attribute for input.
# It accepts positive integer or float value. Will determine fast rate
# increment and decrement steps for edit value.
# The default is 0 (input_step will be used instead)
#[menu list1]
#type:list or vsdcard
#name:
#cursor:
#width:
#scroll:
#enable:
#enter_gcode:
# Will trigger gcode script when entering to this menu container.
# This parameter is optional.
#leave_gcode:
# Will trigger gcode script when leaving from this menu container.
# This parameter is optional.
#show_back:
# This attribute accepts static boolean value.
# Show back [..] as first element.
# The default is True. This parameter is optional.
#show_title:
# This attribute accepts static boolean value.
# Show container name next to back [..] element.
# The default is True. This parameter is optional.
#items:
# Menu elements listed in this container.
# Each element must be on separate line.
# Elements can be grouped on same line by separating them with comma
#
# When element name stars with . then menu system will add parent
# container config name as prefix to element name (delimited by space)
#[menu infodeck]
#type: deck
#name:
#cursor:
#width:
#scroll:
#enable:
#enter_gcode
#leave_gcode
#longpress_menu:
# Entry point to menu container. When this attribute is set then
# long press > 1s will initiate this menu container if not in edit mode.
# The default is disabled. This parameter is optional.
#items:
# It accepts only 'card' elements. You are able to switch between different card screens
# by using encoder or up/down buttons.
#[menu card1]
#type: card
#name:
#content:
# Card screen content. Each line represents display line.
# Quotes can be used in the beginning and end of line.
# Rendered elements are available for output formatting as {0}..{x}. It's always string type.
#items:
# List of elements in card. Each line represents a single index for content formatting.
# It's possible to show multiple elements in one place by separating them with comma on single line.
# If first element is integer then timed cycle is used (integer value is cycle time in seconds)
# If no integer element then first enabled element is shown.
# In cycler multiple elements can be grouped into one postition by separating them with |
# This way only simple menu items can be grouped.
# Example: 5,prt_time, prt_progress - elements prt_time and prt_progress are switched after 5s
# Example: msg,xpos|ypos - elements xpos and ypos are grouped and showed together when msg is disabled.

View File

@@ -0,0 +1,87 @@
# This file contains an example configuration with three
# micro-controllers simultaneously controlling a single printer.
# See both the example.cfg and example-extras.cfg file for a
# description of available parameters.
# The main micro-controller is used as the timing source for all the
# micro-controllers on the printer. Typically, both the X and Y axes
# are connected to the main micro-controller.
[mcu]
serial: /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0-port0
pin_map: arduino
# The "zboard" micro-controller will be used to control the Z axis.
[mcu zboard]
serial: /dev/serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0
pin_map: arduino
# The "auxboard" micro-controller will be used to control the heaters.
[mcu auxboard]
serial: /dev/serial/by-path/platform-3f980000.usb-usb-0:1.4:1.0-port0
pin_map: arduino
[stepper_x]
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
step_distance: .0125
endstop_pin: ^ar3
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: ar60
dir_pin: !ar61
enable_pin: !ar56
step_distance: .0125
endstop_pin: ^ar14
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: zboard:ar46
dir_pin: zboard:ar48
enable_pin: !zboard:ar62
step_distance: .0025
endstop_pin: ^zboard:ar18
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: auxboard:ar26
dir_pin: auxboard:ar28
enable_pin: !auxboard:ar24
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: auxboard:ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: auxboard:analog13
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: auxboard:ar8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: auxboard:analog14
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: auxboard:ar9
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

View File

@@ -51,32 +51,16 @@ position_max: 200
# is 5mm/s.
#homing_retract_dist: 5.0
# Distance to backoff (in mm) before homing a second time during
# homing. The default is 5mm.
# homing. Set this to zero to disable the second home. The default
# is 5mm.
#second_homing_speed:
# Velocity (in mm/s) of the stepper when performing the second home.
# The default is homing_speed/2.
#homing_positive_dir:
# If true, homing will cause the stepper to move in a positive
# direction (away from zero); if false, home towards zero. The
# default is true if position_endstop is near position_max and false
# if near position_min.
#homing_stepper_phases: 0
# One may optionally set this to the number of phases of the stepper
# motor driver (which is the number of micro-steps multiplied by
# four). When set, the phase of the stepper driver will be used
# during homing to improve the accuracy of the endstop switch.
#homing_endstop_accuracy: 0.200
# Sets the expected accuracy (in mm) of the endstop. This represents
# the maximum error distance the endstop may trigger (eg, if an
# endstop may occasionally trigger 100um early or up to 100um late
# then set this to 0.200 for 200um). This setting is used with
# homing_stepper_phases and is only useful if that parameter is also
# configured.
#homing_endstop_phase: 0
# This specifies the phase of the stepper motor driver to expect
# when hitting the endstop. This setting is only meaningful if
# homing_stepper_phases is also set. Only set this value if one is
# sure the stepper motor driver is reset every time the mcu is
# reset. If this is not set, but homing_stepper_phases is set, then
# the stepper phase will be detected on the first home and that
# phase will be used on all subsequent homes.
# The stepper_y section is used to describe the stepper controlling
# the Y axis in a cartesian robot. It has the same settings as the
@@ -116,29 +100,28 @@ nozzle_diameter: 0.500
# Diameter of the nozzle orifice (in mm). This parameter must be
# provided.
filament_diameter: 3.500
# Diameter of the raw filament (in mm) as it enters the
# The nominal diameter of the raw filament (in mm) as it enters the
# extruder. This parameter must be provided.
#max_extrude_cross_section:
# Maximum area of the cross section of an extrusion line (in
# mm^2). This setting prevents excessive amounts of extrusion during
# relatively small XY moves. If a move requests an extrusion rate
# that would exceed this value it will cause an error to be
# returned. The default is: 4.0 * nozzle_diameter^2
# Maximum area (in mm^2) of an extrusion cross section (eg,
# extrusion width multiplied by layer height). This setting prevents
# excessive amounts of extrusion during relatively small XY moves.
# If a move requests an extrusion rate that would exceed this value
# it will cause an error to be returned. The default is: 4.0 *
# nozzle_diameter^2
#max_extrude_only_distance: 50.0
# Maximum length (in mm of raw filament) that an extrude only move
# may be. If an extrude only move requests a distance greater than
# this value it will cause an error to be returned. The default is
# 50mm.
# Maximum length (in mm of raw filament) that a retraction or
# extrude-only move may have. If a retraction or extrude-only move
# requests a distance greater than this value it will cause an error
# to be returned. The default is 50mm.
#max_extrude_only_velocity:
# Maximum velocity (in mm/s) of the extruder motor for extrude only
# moves. If this is not specified then it is calculated to match the
# limit an XY printing move with a max_extrude_cross_section
# extrusion would have.
#max_extrude_only_accel:
# Maximum acceleration (in mm/s^2) of the extruder motor for extrude
# only moves. If this is not specified then it is calculated to
# match the limit an XY printing move with a
# max_extrude_cross_section extrusion would have.
# Maximum velocity (in mm/s) and acceleration (in mm/s^2) of the
# extruder motor for retractions and extrude-only moves. These
# settings do not place any limit on normal printing moves. If not
# specified then they are calculated to match the limit an XY
# printing move with a cross section of 4.0*nozzle_diameter^2 would
# have.
#pressure_advance: 0.0
# The amount of raw filament to push into the extruder during
# extruder acceleration. An equal amount of filament is retracted
@@ -166,8 +149,12 @@ heater_pin: ar10
# periods) to the heater. The default is 1.0.
sensor_type: EPCOS 100K B57560G104F
# Type of sensor - this may be "EPCOS 100K B57560G104F", "ATC
# Semitec 104GT-2", "NTC 100K beta 3950", or "AD595". This parameter
# must be provided.
# Semitec 104GT-2", "NTC 100K beta 3950", "Honeywell 100K
# 135-104LAG-J01", "NTC 100K MGB18-104F39050L32", "AD595", "PT100
# INA826", "MAX6675", "MAX31855", "MAX31856", or "MAX31865".
# Additional sensor types may be available - see the
# example-extras.cfg file for details. This parameter must be
# provided.
sensor_pin: analog13
# Analog input pin connected to the sensor. This parameter must be
# provided.
@@ -177,7 +164,11 @@ sensor_pin: analog13
# thermistor. The default is 4700 ohms.
#adc_voltage: 5.0
# The ADC comparison voltage. This parameter is only valid when the
# sensor is an AD595. The default is 5 volts.
# sensor is an AD595 or "PT100 INA826". The default is 5 volts.
#smooth_time: 2.0
# A time value (in seconds) over which temperature measurements will
# be smoothed to reduce the impact of measurement noise. The default
# is 2 seconds.
control: pid
# Control algorithm (either pid or watermark). This parameter must
# be provided.
@@ -190,22 +181,27 @@ pid_Ki: 1.08
pid_Kd: 114
# Kd is the "derivative" constant for the pid. This parameter must
# be provided for PID heaters.
#pid_deriv_time: 2.0
# A time value (in seconds) over which the derivative in the pid
# will be smoothed to reduce the impact of measurement noise. The
# default is 2 seconds.
#pid_integral_max:
# The maximum "windup" the integral term may accumulate. The default
# is to use the same value as max_power.
#pwm_cycle_time: 0.100
# Time in seconds for each software PWM cycle of the heater. It is
# not recommended to set this unless there is an electrical
# requirement to switch the heater faster than 10 times a second.
# The default is 0.100 seconds.
#min_extrude_temp: 170
# The minimum temperature (in Celsius) at which extruder move
# commands may be issued. The default is 170 Celsius.
min_temp: 0
# Minimum temperature in Celsius (mcu will shutdown if not
# met). This parameter must be provided.
max_temp: 210
# Maximum temperature (mcu will shutdown if temperature is above
# this value). This parameter must be provided.
# The maximum range of valid temperatures (in Celsius) that the
# heater must remain within. This controls a safety feature
# implemented in the micro-controller code - should the measured
# temperature ever fall outside this range then the micro-controller
# will go into a shutdown state. This check can help detect some
# heater and sensor hardware failures. Set this range just wide
# enough so that reasonable temperatures do not result in an
# error. These parameters must be provided.
# The heater_bed section describes a heated bed (if present - omit
# section if not present).
@@ -233,13 +229,21 @@ pin: ar9
# enabled for extended periods, while a value of 0.5 would allow the
# pin to be enabled for no more than half the time. This setting may
# be used to limit the total power output (over extended periods) to
# the fan. The default is 1.0.
#hard_pwm: 0
# Set this value to force hardware PWM instead of software PWM. Set
# to 1 to force a hardware PWM at the fastest rate; set to a higher
# number to force hardware PWM with the given cycle time in clock
# ticks. The default is 0 which enables software PWM with a cycle
# time of 10ms.
# the fan. If this value is less than 1.0 then fan speed requests
# will be scaled between zero and max_power (for example, if
# max_power is .9 and a fan speed of 80% is requested then the fan
# power will be set to 72%). The default is 1.0.
#shutdown_speed: 0
# The desired fan speed (expressed as a value from 0.0 to 1.0) if
# the micro-controller software enters an error state. The default
# is 0.
#cycle_time: 0.010
# The amount of time (in seconds) for each PWM power cycle to the
# fan. It is recommended this be 10 milliseconds or greater when
# using software based PWM. The default is 0.010 seconds.
#hardware_pwm: False
# Enable this to use hardware PWM instead of software PWM. The
# default is False.
#kick_start_time: 0.100
# Time (in seconds) to run the fan at full speed when first enabling
# it (helps get the fan spinning). The default is 0.100 seconds.
@@ -247,13 +251,15 @@ pin: ar9
# Micro-controller information.
[mcu]
serial: /dev/ttyACM0
# The serial port to connect to the MCU. The default is /dev/ttyS0
# The serial port to connect to the MCU. If unsure (or if it
# changes) see the "Where's my serial port?" section of the FAQ. The
# default is /dev/ttyS0
#baud: 250000
# The baud rate to use. The default is 250000.
pin_map: arduino
# This option may be used to enable Arduino pin name aliases. The
# default is to not enable the aliases.
#restart_method: arduino
#restart_method:
# This controls the mechanism the host will use to reset the
# micro-controller. The choices are 'arduino', 'rpi_usb', and
# 'command'. The 'arduino' method (toggle DTR) is common on Arduino
@@ -262,7 +268,8 @@ pin_map: arduino
# disables power to all USB ports to accomplish a micro-controller
# reset. The 'command' method involves sending a Klipper command to
# the micro-controller so that it can reset itself. The default is
# 'arduino'.
# 'arduino' if the micro-controller communicates over a serial port,
# 'command' otherwise.
# The printer section controls high level printer settings.
[printer]
@@ -290,11 +297,16 @@ max_z_accel: 30
# mm/s^2) of movement along the z axis. It limits the acceleration
# of the z stepper motor on cartesian printers. The default is to
# use max_accel for max_z_accel.
#motor_off_time: 600
# Time (in seconds) of idle time before the printer will try to
# disable active motors. The default is 600 seconds.
#junction_deviation: 0.02
# Distance (in mm) used to control the internal approximated
# centripetal velocity cornering algorithm. A larger number will
# permit higher "cornering speeds" at the junction of two moves. The
# default is 0.02mm.
#square_corner_velocity: 5.0
# The maximum velocity (in mm/s) that the toolhead may travel a 90
# degree corner at. A non-zero value can reduce changes in extruder
# flow rates by enabling instantaneous velocity changes of the
# toolhead during cornering. This value configures the internal
# centripetal velocity cornering algorithm; corners with angles
# larger than 90 degrees will have a higher cornering velocity while
# corners with angles less than 90 degrees will have a lower
# cornering velocity. If this is set to zero then the toolhead will
# decelerate to zero at each corner. The default is 5mm/s.
# Looking for more options? Check the example-extras.cfg file.

View File

@@ -34,7 +34,7 @@ homing_speed: 50
step_pin: P8_19
dir_pin: P8_18
enable_pin: !P9_14
step_distance: 0.00025
step_distance: .0025
endstop_pin: ^P9_13
position_endstop: 0
position_max: 200
@@ -48,7 +48,8 @@ nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: P9_15
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P9_36
pullup_resistor: 2000
sensor_pin: host:analog5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
@@ -59,7 +60,8 @@ max_temp: 250
[heater_bed]
heater_pin: P8_11
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P9_33
pullup_resistor: 2000
sensor_pin: host:analog4
control: watermark
min_temp: 0
max_temp: 130
@@ -71,9 +73,17 @@ pin: P9_41
serial: /dev/rpmsg_pru30
pin_map: beaglebone
[mcu host]
serial: /tmp/klipper_host_mcu
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[output_pin machine_enable]
pin: P9_23
value: 1
shutdown_value: 0

362
config/generic-duet2.cfg Normal file
View File

@@ -0,0 +1,362 @@
# This file contains common pin mappings for Duet2 boards. To use
# this config, the firmware should be compiled for the SAM4E8E.
# See the example.cfg file for a description of available parameters.
## Drivers
# Here are the pins for the 10 stepper drivers supported by a Duet2 board
# | Drive | DIR pin | STEP pin | ENDSTOP pin | SPI EN pin |
# |-------|----------|-----------|--------------|-------------|
# | X | PD11 | PD6 | PC14 | PD14 |
# | Y | PD12 | PD7 | PA2 | PC9 |
# | Z | PD13 | PD8 | PD29 | PC10 |
# | E0 | PA1 | PD5 | PD10 | PC17 |
# | E1 | PD9 | PD4 | PC16 | PC25 |
# | E2 | PD28 | PD2 | PE0* | PD23 |
# | E3 | PD22 | PD1 | PE1* | PD24 |
# | E4 | PD16 | PD0 | PE2* | PD25 |
# | E5 | PD17 | PD3 | PE3* | PD26 |
# | E6 | PA25 | PD21 | PA17* | PC28 |
# Pins marked with asterisks (*) are only assigned to these functions
# if no duex is connected. If a duex is connected, these endstops are
# remapped to the SX1509 on the Duex (unfortunately they can't be used
# as endstops in klipper, however one may use them as digital outs or
# PWM outs). The SPI EN pins are required for the TMC2660 drivers (use
# the SPI EN pin as 'cs_pin' in the respective config block). The
# **enable pin for all steppers** is TMC_EN = !PC6.
#
## Fans
# | FAN | PIN |
# |------|-----------------------|
# | FAN0 | PC23 |
# | FAN1 | PC26 |
# | FAN2 | PA0 |
# | FAN3 | sx1509_duex:PIN_12* |
# | FAN4 | sx1509_duex:PIN_7* |
# | FAN5 | sx1509_duex:PIN_6* |
# | FAN6 | sx1509_duex:PIN_5* |
# | FAN7 | sx1509_duex:PIN_4* |
# | FAN8 | sx1509_duex:PIN_15* |
# Pins marked with (*) assume the following sx1509 config section:
#[sx1509 duex]
#address: 0x3E
#
## Heaters and Thermistors
# | Extruder Drive | HEAT pin | TEMP pin |
# |----------------|-----------|-----------|
# | BED | PA19 | PC13 |
# | E0 | PA20 | PC15 |
# | E1 | PA16 | PC12 |
# | E2 | PC3 | PC29 |
# | E3 | PC5 | PC30 |
# | E4 | PC8 | PC31 |
# | E5 | PC11 | PC27 |
# | E6 | PA15 | PA18 |
#
## Misc pins
# | Name | Pin |
# |-------------|---------|
# | ZProbe_IN | PC1 |
# | PS_ON | PD15 |
# | LED_ONBOARD | PC2 |
# | SPI0_CS0 | PC24 |
# | SPI0_CS1 | PB2 |
# | SPI0_CS2 | PC18 |
# | SPI0_CS3 | PC19 |
# | SPI0_CS4 | PC20 |
# | SPI0_CS5 | PA24 |
# | SPI0_CS6 | PE1* |
# | SPI0_CS7 | PE2* |
# | SPI0_CS8 | PE3* |
# | SX1509_IRQ | PA17* |
# | SG_TST | PE0* |
# | ENC_SW | PA7 |
# | ENC_A | PA8 |
# | ENC_B | PC7 |
# | LCD_DB7 | PD18 |
# | LCD_DB6 | PD19 |
# | LCD_DB5 | PD20 |
# | LCD_DB4 | PD21** |
# | LCD_RS | PC28** |
# | LCD_E | PA25** |
# Pins marked with one asterisk (*) replace E2_STOP-E6_STOP if a duex is present
# Pins marked with two asterisks (**) share pins with drive E6.
# For the remaining pins check the schematics provided here: https://github.com/T3P3/Duet
[stepper_x]
step_pin: PD6
dir_pin: PD11
enable_pin: !PC6 # shared between all steppers
step_distance: .0125
endstop_pin: ^PC14
position_endstop: 0
position_max: 250
[tmc2660 stepper_x]
cs_pin: PD14 # X_SPI_EN Required for communication
spi_bus: 1 # All TMC2660 drivers are connected to USART1, which is bus 1 on the sam4e port
microsteps: 16
interpolate: True # 1/16 micro-steps interpolated to 1/256
run_current: 1.000
idle_current_percent: 20
[stepper_y]
step_pin: PD7
dir_pin: !PD12
enable_pin: !PC6
step_distance: .0125
endstop_pin: ^PA2
position_endstop: 0
position_max: 210
[tmc2660 stepper_y]
cs_pin: PC9
spi_bus: 1
microsteps: 16
interpolate: True
run_current: 1.000
idle_current_percent: 20
[stepper_z]
step_pin: PD8
dir_pin: PD13
enable_pin: !PC6
step_distance: .0025
endstop_pin: ^PD29
position_endstop: 0.5
position_max: 200
[tmc2660 stepper_z]
cs_pin: PC10
spi_bus: 1
microsteps: 16
interpolate: True
run_current: 1.000
#On drive E4
[stepper_z1]
step_pin: PD0
dir_pin: PD16
enable_pin: !PC6
step_distance: .0025
[tmc2660 stepper_z1]
cs_pin: PD25
spi_bus: 1
microsteps: 16
interpolate: True
run_current: 1.000
#On drive E5
[stepper_z2]
step_pin: PD3
dir_pin: !PD17
enable_pin: !PC6
step_distance: .0025
[tmc2660 stepper_z2]
cs_pin: PD26
spi_bus: 1
microsteps: 16
interpolate: True
run_current: 1.000
#On drive E6
[stepper_z3]
step_pin: PD21
dir_pin: !PA25
enable_pin: !PC6
step_distance: .0025
[tmc2660 stepper_z3]
cs_pin: PC28
spi_bus: 1
microsteps: 16
interpolate: True
run_current: 1.000
#On drive E0
[extruder0]
step_pin: PD5
dir_pin: PA1
enable_pin: !PC6
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA20
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC15
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[tmc2660 extruder0]
cs_pin: PC17
spi_bus: 1
microsteps: 16
interpolate: True
run_current: 1.000
#On drive E1
[extruder1]
step_pin: PD4
dir_pin: PD9
enable_pin: !PC6
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA16
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC12
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[tmc2660 extruder1]
cs_pin: PC25
spi_bus: 1
microsteps: 16
interpolate: True
run_current: 1.000
# On drive E2
[extruder2]
step_pin: PD2
dir_pin: !PD28
enable_pin: !PC6
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC3
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC29
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[tmc2660 extruder2]
cs_pin: PD23
spi_bus: 1
microsteps: 16
interpolate: True
run_current: 1.000
# On drive E3
[extruder3]
step_pin: PD1
dir_pin: !PD22
enable_pin: !PC6
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC30
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[tmc2660 extruder3]
cs_pin: PD24
spi_bus: 1
microsteps: 16
interpolate: True
run_current: 1.000
[heater_bed]
heater_pin: PA19
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC13
control: watermark
min_temp: 0
max_temp: 130
# Fan0
[fan]
pin: PC23
# Fan1 controlled by extruder0
[heater_fan nozzle_cooling_fan]
pin: PC26
heater: extruder0
heater_temp: 45
fan_speed: 1.0
# Fan2, controlled by E5_TEMP
[temperature_fan chamber_fan]
pin: PA0
max_power: 1
shutdown_speed: 1
cycle_time: 0.01
min_temp: 40
max_temp: 120
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC27
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
[mcu]
serial: /dev/ttyACM0
restart_method: command
[sx1509 duex]
address: 0x3E # Address is fixed on duex boards
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[static_digital_output onboard_led]
pins: !PC2
[output_pin FAN3]
pin: !sx1509_duex:PIN_12
pwm: True
hardware_pwm: True # Only hardware PWM fans are supported
[output_pin FAN4]
pin: !sx1509_duex:PIN_7
pwm: True
hardware_pwm: True
[output_pin FAN5]
pin: !sx1509_duex:PIN_6
pwm: True
hardware_pwm: True
[output_pin FAN6]
pin: !sx1509_duex:PIN_5
pwm: True
hardware_pwm: True
[output_pin FAN7]
pin: !sx1509_duex:PIN_4
pwm: True
hardware_pwm: True
[output_pin FAN8]
pin: !sx1509_duex:PIN_15
pwm: True
hardware_pwm: True
[output_pin GPIO1] # General purpose pin broken out on the duex
pin: sx1509_duex:PIN_11
pwm: False
value: 1

View File

@@ -0,0 +1,106 @@
# This file contains common pin mappings for Einsy Rambo boards. To use
# this config, the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PC0
dir_pin: PL0
enable_pin: !PA7
step_distance: .005
endstop_pin: ^PB6
#endstop_pin: tmc2130_stepper_x:virtual_endstop
position_endstop: 0
position_max: 250
[tmc2130 stepper_x]
cs_pin: PG0
microsteps: 16
run_current: .5
sense_resistor: 0.220
diag1_pin: !PK2
[stepper_y]
step_pin: PC1
dir_pin: !PL1
enable_pin: !PA6
step_distance: .005
endstop_pin: ^PB5
#endstop_pin: tmc2130_stepper_y:virtual_endstop
position_endstop: 0
position_max: 210
[tmc2130 stepper_y]
cs_pin: PG2
microsteps: 16
run_current: .5
sense_resistor: 0.220
diag1_pin: !PK7
[stepper_z]
step_pin: PC2
dir_pin: PL2
enable_pin: !PA5
step_distance: .0025
endstop_pin: ^PB4
#endstop_pin: tmc2130_stepper_z:virtual_endstop
position_endstop: 0.5
position_max: 200
[tmc2130 stepper_z]
cs_pin: PK5
microsteps: 16
run_current: .5
sense_resistor: 0.220
diag1_pin: !PK6
[extruder]
step_pin: PC3
dir_pin: PL6
enable_pin: !PA4
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PE5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF0
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[tmc2130 extruder]
cs_pin: PK4
microsteps: 16
run_current: .5
sense_resistor: 0.220
diag1_pin: !PK3
[heater_bed]
heater_pin: PG5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF2
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: PH5
#[heater_fan nozzle_cooling_fan]
#pin: PH3
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[static_digital_output yellow_led]
pins: !PB7

View File

@@ -2,9 +2,12 @@
# this config, the firmware should be compiled for the AVR
# atmega1284p.
# Note that the "make flash" command does not work with Melzi
# boards. The boards are typically flashed with this command:
# avrdude -p atmega1284p -c avrisp -P /dev/ttyUSB0 -U flash:w:out/klipper.elf.hex
# Note, a number of Melzi boards are shipped with a bootloader that
# requires the following command to flash the board:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# If the above command does not work and "make flash" does not work
# then one may need to flash a bootloader to the board - see the
# Klipper docs/Bootloaders.md file for more information.
# See the example.cfg file for a description of available parameters.
@@ -32,7 +35,7 @@ homing_speed: 50
step_pin: PB3
dir_pin: !PB2
enable_pin: !PA5
step_distance: 0.00025
step_distance: .0025
endstop_pin: ^!PC4
position_endstop: 0.5
position_max: 200

View File

@@ -0,0 +1,109 @@
# This file contains common pin mappings for Mini-RAMBo boards. To use
# this config, the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PC0
dir_pin: PL1
enable_pin: !PA7
step_distance: .005
endstop_pin: ^PB6
#endstop_pin: ^PC7
position_endstop: 0
position_max: 250
[stepper_y]
step_pin: PC1
dir_pin: !PL0
enable_pin: !PA6
step_distance: .005
endstop_pin: ^PB5
#endstop_pin: ^PA2
position_endstop: 0
position_max: 210
[stepper_z]
step_pin: PC2
dir_pin: PL2
enable_pin: !PA5
step_distance: .0025
endstop_pin: ^PB4
#endstop_pin: ^PA1
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: PC3
dir_pin: PL6
enable_pin: !PA4
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PE5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF0
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PG5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF2
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: PH5
#[heater_fan nozzle_cooling_fan]
#pin: PH3
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[output_pin stepper_xy_current]
pin: PL3
pwm: True
scale: 2.0
cycle_time: .000030
hardware_pwm: True
static_value: 1.3
[output_pin stepper_z_current]
pin: PL4
pwm: True
scale: 2.0
cycle_time: .000030
hardware_pwm: True
static_value: 1.3
[output_pin stepper_e_current]
pin: PL5
pwm: True
scale: 2.0
cycle_time: .000030
hardware_pwm: True
static_value: 1.25
[static_digital_output stepper_config]
pins:
PG1, PG0,
PK7, PG2,
PK6, PK5,
PK3, PK4
[static_digital_output yellow_led]
pins: !PB7

View File

@@ -0,0 +1,76 @@
# This file contains common pin mappings for Printrboard boards (rev B
# through D). To use this config the firmware should be compiled for
# the AVR at90usb1286.
# Note that the "make flash" command is unlikely to work on the
# Printrboard. See the RepRap Printrboard wiki page for instructions
# on flashing.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PA0
dir_pin: !PA1
enable_pin: !PE7
step_distance: .0125
endstop_pin: ^PE3
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PA2
dir_pin: PA3
enable_pin: !PE6
step_distance: .0125
endstop_pin: ^PB0
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PA4
dir_pin: !PA5
enable_pin: !PC7
step_distance: .0025
endstop_pin: ^PE4
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: PA6
dir_pin: PA7
enable_pin: !PC3
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF1
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PC4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF0
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: PC6
[mcu]
serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

109
config/generic-radds.cfg Normal file
View File

@@ -0,0 +1,109 @@
# This file contains common pin mappings for RADDS (v1.5) boards. To
# use this config, the firmware should be compiled for the Arduino
# Due.
# See the example.cfg file for a description of available parameters.
# Temp sensor pins: analog0..analog4
# Mosfet Pins: ar7 (Heatbed), ar8, ar9, ar11, ar12, ar13
[stepper_x]
step_pin: ar24
dir_pin: ar23
enable_pin: ar26
step_distance: .0125
endstop_pin: ^ar28
#endstop_pin: ^ar34
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: ar17
dir_pin: !ar16
enable_pin: ar22
step_distance: .0125
endstop_pin: ^ar30
#endstop_pin: ^ar36
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: ar2
dir_pin: ar3
enable_pin: ar15
step_distance: .0025
endstop_pin: ^ar32
#endstop_pin: ^ar38
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: analog7
dir_pin: analog6
enable_pin: analog8
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar13
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog0
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
#[extruder1]
#step_pin: analog10
#dir_pin: analog9
#enable_pin: analog11
#[extruder2]
#step_pin: ar51
#dir_pin: ar53
#enable_pin: ar49
[heater_bed]
heater_pin: ar7
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog1
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: ar9
#[heater_fan nozzle_cooling_fan]
#pin: ar8
[mcu]
serial: /dev/ttyACM0
pin_map: arduino
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
# "RepRapDiscount 2004 Smart Controller" type displays
#[display]
#lcd_type: hd44780
#rs_pin: ar42
#e_pin: ar43
#d4_pin: ar44
#d5_pin: ar45
#d6_pin: ar46
#d7_pin: ar47
# "RepRapDiscount 128x64 Full Graphic Smart Controller" type displays
#[display]
#lcd_type: st7920
#cs_pin: ar42
#sclk_pin: ar44
#sid_pin: ar43

View File

@@ -29,7 +29,7 @@ homing_speed: 50
step_pin: PC2
dir_pin: PL2
enable_pin: !PA5
step_distance: 0.00025
step_distance: .0025
endstop_pin: ^PB4
#endstop_pin: ^PC7
position_endstop: 0.5
@@ -103,7 +103,24 @@ pins:
PK7, PG2,
PK6, PK5,
PK3, PK4,
PK2, PK1
PK1, PK2
[static_digital_output yellow_led]
pins: !PB7
# "RepRapDiscount 2004 Smart Controller" type displays
#[display]
#lcd_type: hd44780
#rs_pin: PG4
#e_pin: PG3
#d4_pin: PJ2
#d5_pin: PJ3
#d6_pin: PJ7
#d7_pin: PJ4
# "RepRapDiscount 128x64 Full Graphic Smart Controller" type displays
#[display]
#lcd_type: st7920
#cs_pin: PG4
#sclk_pin: PJ2
#sid_pin: PG3

View File

@@ -30,7 +30,7 @@ homing_speed: 50
step_pin: ar46
dir_pin: ar48
enable_pin: !ar62
step_distance: 0.00025
step_distance: .0025
endstop_pin: ^ar18
#endstop_pin: ^ar19
position_endstop: 0.5
@@ -82,3 +82,24 @@ max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
# "RepRapDiscount 2004 Smart Controller" type displays
#[display]
#lcd_type: hd44780
#rs_pin: ar16
#e_pin: ar17
#d4_pin: ar23
#d5_pin: ar25
#d6_pin: ar27
#d7_pin: ar29
#encoder_pins: ^ar31, ^ar33
#click_pin: ^!ar35
# "RepRapDiscount 128x64 Full Graphic Smart Controller" type displays
#[display]
#lcd_type: st7920
#cs_pin: ar16
#sclk_pin: ar23
#sid_pin: ar17
#encoder_pins: ^ar31, ^ar33
#click_pin: ^!ar35

106
config/generic-re-arm.cfg Normal file
View File

@@ -0,0 +1,106 @@
# This file contains common pin mappings for Re-Arm. To use this
# config, the firmware should be compiled for the LPC176x.
# The "make flash" command does not work on the Re-Arm. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the Re-Arm
# with that SD card.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: P2.1
dir_pin: P0.11
enable_pin: !P0.10
step_distance: .0125
endstop_pin: ^P1.24
#endstop_pin: ^P1.25
position_endstop: 0.5
position_min: 0
position_max: 200
homing_speed: 50
# The stepper_y section is used to describe the Y axis as well as the
# stepper controlling the X-Y movement.
[stepper_y]
step_pin: P2.2
dir_pin: P0.20
enable_pin: !P0.19
step_distance: .0125
endstop_pin: ^P1.26
#endstop_pin: ^P1.27
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: P2.3
dir_pin: P0.22
enable_pin: !P0.21
step_distance: .0025
endstop_pin: ^P1.29
#endstop_pin: ^P1.28
position_endstop: 0.5
position_min: 0
position_max: 200
[extruder]
step_pin: P2.0
dir_pin: P0.5
enable_pin: !P0.4
step_distance: .0011365
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: P2.5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.23
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
#[extruder1]
#step_pin: P2.8
#dir_pin: P2.13
#enable_pin: !P4.29
#heater_pin: P2.4
#sensor_pin: P0.25
#...
[heater_bed]
heater_pin: P2.7
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.24
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: P2.4
[mcu]
serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
# "RepRapDiscount 128x64 Full Graphic Smart Controller" type displays
# Re-Arm will only work with this type of display
#[display]
#lcd_type: st7920
#cs_pin: P0.16
#sclk_pin: P0.15
#sid_pin: P0.18
#encoder_pins: ^P3.25, ^P3.26
#click_pin: ^!P2.11
#kill_pin: ^!P1.22
# Ground the buzzer pin to prevent stray voltages causing an audible "whine"
#[static_digital_output buzzer]
#pins: !P1.30

View File

@@ -13,6 +13,62 @@
# See the example.cfg file for a description of available parameters.
[mcu]
serial: /dev/rpmsg_pru30
pin_map: beaglebone
[mcu host]
serial: /tmp/klipper_host_mcu
# The "replicape" config section adds "replicape:stepper_x_enable"
# virtual stepper enable pins (for steppers x, y, z, e, and h) and
# "replicape:power_x" PWM output pins (for hotbed, e, h, fan0, fan1,
# fan2, and fan3) that may then be used elsewhere in the config file.
[replicape]
revision: B3
# The replicape hardware revision. Currently only revision "B3" is
# supported. This parameter must be provided.
#enable_pin: !P9_41
# The replicape global enable pin. The default is !P9_41.
host_mcu: host
# The name of the mcu config section that communicates with the
# Klipper "linux process" mcu instance. This parameter must be
# provided.
#standstill_power_down: False
# This parameter controls the CFG6_ENN line on all stepper
# motors. True sets the enable lines to "open". The default is
# False.
#servo0_enable: False
# This parameter controls whether end_stop_X_2 is used for endstops
# (via P9_11) or for servo_0 (via P9_14). The default is False.
#servo1_enable: False
# This parameter controls whether end_stop_Y_2 is used for endstops
# (via P9_28) or for servo_1 (via P9_16). The default is False.
stepper_x_microstep_mode: spread16
# This parameter controls the CFG1 and CFG2 pins of the given
# stepper motor driver. Available options are: disable, 1, 2,
# spread2, 4, 16, spread4, spread16, stealth4, and stealth16. The
# default is disable.
stepper_x_current: 0.5
# The configured maximum current (in Amps) of the stepper motor
# driver. This parameter must be provided if the stepper is not in a
# disable mode.
#stepper_x_chopper_off_time_high: False
# This parameter controls the CFG0 pin of the stepper motor driver
# (True sets CFG0 high, False sets it low). The default is False.
#stepper_x_chopper_hysteresis_high: False
# This parameter controls the CFG4 pin of the stepper motor driver
# (True sets CFG4 high, False sets it low). The default is False.
#stepper_x_chopper_blank_time_high: True
# This parameter controls the CFG5 pin of the stepper motor driver
# (True sets CFG5 high, False sets it low). The default is True.
stepper_y_microstep_mode: spread16
stepper_y_current: 0.5
stepper_z_microstep_mode: spread16
stepper_z_current: 0.5
stepper_e_microstep_mode: 16
stepper_e_current: 0.5
[stepper_x]
step_pin: P8_17
dir_pin: P8_26
@@ -37,11 +93,18 @@ homing_speed: 50
step_pin: P8_13
dir_pin: P8_14
enable_pin: replicape:stepper_z_enable
step_distance: 0.00025
step_distance: .0025
endstop_pin: ^P9_13
position_endstop: 0
position_max: 200
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 25
max_z_accel: 30
[extruder]
step_pin: P9_12
dir_pin: P8_15
@@ -69,56 +132,3 @@ max_temp: 130
[fan]
pin: replicape:power_fan0
[mcu]
serial: /dev/rpmsg_pru30
pin_map: beaglebone
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 25
max_z_accel: 30
[mcu host]
serial: /tmp/klipper_host_mcu
# The "replicape" config section adds "replicape:stepper_x_enable"
# virtual stepper enable pins (for steppers x, y, z, e, and h) and
# "replicape:power_x" PWM output pins (for hotbed, e, h, fan0, fan1,
# fan2, and fan3) that may then be used elsewhere in the config file.
[replicape]
revision: B3
# The replicape hardware revision. Currently only revision "B3" is
# supported. This parameter must be provided.
#enable_pin: !P9_41
# The replicape global enable pin. The default is !P9_41.
host_mcu: host
# The name of the mcu config section that communicates with the
# Klipper "linux process" mcu instance. This parameter must be
# provided.
stepper_x_microstep_mode: spread16
# This parameter controls the CFG1 and CFG2 pins of the given
# stepper motor driver. Available options are: disable, 1, 2,
# spread2, 4, 16, spread4, spread16, stealth4, and stealth16. The
# default is disable.
stepper_x_current: 0.5
# The configured maximum current (in Amps) of the stepper motor
# driver. This parameter must be provided if the stepper is not in a
# disable mode.
#stepper_x_chopper_off_time_high: False
# This parameter controls the CFG0 pin of the stepper motor driver
# (True sets CFG0 high, False sets it low). The default is False.
#stepper_x_chopper_hysteresis_high: False
# This parameter controls the CFG4 pin of the stepper motor driver
# (True sets CFG4 high, False sets it low). The default is False.
#stepper_x_chopper_blank_time_high: True
# This parameter controls the CFG5 pin of the stepper motor driver
# (True sets CFG5 high, False sets it low). The default is True.
stepper_y_microstep_mode: spread16
stepper_y_current: 0.5
stepper_z_microstep_mode: spread16
stepper_z_current: 0.5
stepper_e_microstep_mode: 16
stepper_e_current: 0.5

115
config/generic-rumba.cfg Normal file
View File

@@ -0,0 +1,115 @@
# This file contains common pin mappings for RUMBA boards. To use
# this config, the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: ar17
dir_pin: ar16
enable_pin: !ar48
step_distance: .0125
endstop_pin: ^ar37
#endstop_pin: ^ar36
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: ar54
dir_pin: !ar47
enable_pin: !ar55
step_distance: .0125
endstop_pin: ^ar35
#endstop_pin: ^ar34
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: ar57
dir_pin: ar56
enable_pin: !ar62
step_distance: .0125
endstop_pin: ^ar33
#endstop_pin: ^ar32
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: ar23
dir_pin: ar22
enable_pin: !ar24
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog15
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
#[extruder1]
#step_pin: ar26
#dir_pin: ar3
#enable_pin: !ar27
#heater_pin: ar9
#sensor_pin: analog14
#...
#[extruder2]
#step_pin: ar29
#dir_pin: ar6
#enable_pin: !ar39
#heater_pin: ar9
#sensor_pin: analog13
#...
[heater_bed]
heater_pin: ar9
sensor_type: NTC 100K beta 3950
sensor_pin: analog11
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: ar7
#[heater_fan fan1]
#pin: ar8
[mcu]
serial: /dev/ttyACM0
pin_map: arduino
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
# "RepRapDiscount 2004 Smart Controller" type displays
#[display]
#lcd_type: hd44780
#rs_pin: ar19
#e_pin: ar42
#d4_pin: ar18
#d5_pin: ar38
#d6_pin: ar41
#d7_pin: ar40
#encoder_pins: ^ar11, ^ar12
#click_pin: ^!ar43
# "RepRapDiscount 128x64 Full Graphic Smart Controller" type displays
#[display]
#lcd_type: st7920
#cs_pin: ar19
#sclk_pin: ar18
#sid_pin: ar42
#encoder_pins: ^ar11, ^ar12
#click_pin: ^!ar43

View File

@@ -0,0 +1,115 @@
# This file contains common pin mappings for Smoothieboard. To use
# this config, the firmware should be compiled for the LPC176x.
# The "make flash" command does not work on the Smoothieboard.
# Instead, after running "make", copy the generated "out/klipper.bin"
# file to a file named "firmware.bin" on an SD card and then restart
# the Smoothieboard with that SD card.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: P2.0
dir_pin: P0.5
enable_pin: !P0.4
step_distance: .0125
endstop_pin: ^P1.24
#endstop_pin: ^P1.25
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: P2.1
dir_pin: !P0.11
enable_pin: !P0.10
step_distance: .0125
endstop_pin: ^P1.26
#endstop_pin: ^P1.27
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: P2.2
dir_pin: P0.20
enable_pin: !P0.19
step_distance: .0025
endstop_pin: ^P1.28
#endstop_pin: ^P1.29
position_endstop: 0.5
position_max: 200
[extruder]
step_pin: P2.3
dir_pin: P0.22
enable_pin: !P0.21
step_distance: .002
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: P2.7
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.24
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
#[extruder1]
#step_pin: P2.8
#dir_pin: P2.13
#enable_pin: !P4.29
#heater_pin: P2.6
#sensor_pin: P0.25
#...
[heater_bed]
heater_pin: P2.5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.23
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: P2.4
[mcu]
serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[static_digital_output leds]
pins: P1.18, P1.19, P1.20, P1.21, P4.28
[mcp4451 stepper_digipot1]
i2c_address: 88
# Scale the config so that wiper values can be specified in amps.
scale: 2.25
# wiper 0 is X (aka alpha), 1 is Y, 2 is Z, 3 is E0
wiper_0: 1.0
wiper_1: 1.0
wiper_2: 1.0
wiper_3: 1.0
[mcp4451 stepper_digipot2]
i2c_address: 90
scale: 2.25
# wiper 0 is E1
wiper_0: 1.0
# "RepRapDiscount 128x64 Full Graphic Smart Controller" type displays
#[display]
#lcd_type: st7920
#cs_pin: P0.16
#sclk_pin: P0.15
#sid_pin: P0.18
#encoder_pins: ^P3.25, ^P3.26
#click_pin: ^!P1.30

222
config/kit-voron2-2018.cfg Normal file
View File

@@ -0,0 +1,222 @@
# This file is an example configuration for the Voron 2 CoreXY printer
# running on two RAMPS boards. This file was created by "Maglin".
# X/Y/E steppers/endstops/thermisters/heaters are on one MCU/RAMPS
# board while Z steppers/mechanical switch/endstop_pin are on the
# second MCU/RAMPS labeled z.
# This file is only an example - be sure to review and update it
# according to the specifics of your printer. See the example.cfg and
# example-extras.cfg files for a description of available parameters.
[mcu]
# mcu for X/Y/E steppers main MCU
serial: /dev/serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0
pin_map: arduino
[mcu z]
# mcu for the Z steppers
serial: /dev/serial/by-path/platform-3f980000.usb-usb-0:1.2:1.0-port0
pin_map: arduino
[stepper_x]
# use preceding ! to invert logic and ^ to activate internal 5V pullup
# this is for all pin definitions. Not all pins have interal pullups
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
step_distance: 0.0125
endstop_pin: ^ar2
position_min: 0
position_endstop: 248
position_max: 248
homing_speed: 50
[stepper_y]
step_pin: ar60
dir_pin: ar61
enable_pin: !ar56
step_distance: 0.0125
endstop_pin: ^ar15
position_min: -5
position_endstop: 245
position_max: 245
homing_speed: 50
[stepper_z]
# X stepper pins on MCU Z
step_pin: z:ar54
dir_pin: z:ar55
enable_pin: !z:ar38
step_distance: 0.00625
# probe:z_virtual_endstop is a virtual pin definition only available if
# a probe section is defined
#endstop_pin: probe:z_virtual_endstop
# mechanical switch on mcu Z X min endstop pin
endstop_pin: ^z:ar3
position_endstop: -0.376
position_min: -5
position_max: 245
homing_speed: 12
[stepper_z1]
# Y stepper pins on MCU Z
step_pin: z:ar60
dir_pin: !z:ar61
enable_pin: !z:ar56
step_distance: 0.00625
[stepper_z2]
# Z stepper pins on MCU Z
step_pin: z:ar46
dir_pin: z:ar48
enable_pin: !z:ar62
step_distance: 0.00625
[stepper_z3]
# E0 stepper pins on MCU Z
step_pin: z:ar26
dir_pin: !z:ar28
enable_pin: !z:ar24
step_distance: 0.00625
# extended G-Code command Z_TILT_ADJUST can be used to level gantry
[z_tilt]
# belt locations from origin 0,0
z_positions:
-56,-17
-56,322
311,322
311,-17
# probing locations for gantry leveling
points:
50,50
50,195
195,195
195,50
# travel speed between probe points
speed: 150
# Move Z to this position for safe probing
horizontal_move_z: 15
# this is required for gantry leveling and replaces your G28 command
# with the gcode used here. Used to home X/Y/Z with mechanical switches
[homing_override]
set_position_z: 0
gcode:
G90
G0 Z15 F600
G28 X0 Y0
G0 X248 Y225 F3000
G28 Z
G0 Z15 F6000
# macro to level the gantry. use G32 in the terminal to call
[gcode_macro g32]
gcode:
Z_TILT_ADJUST
Z_TILT_ADJUST
Z_TILT_ADJUST
G28
G0 X125 Y125 Z125 F3600
# Use print_start for you slicer starting script
[gcode_macro print_start]
gcode:
G1 X0 Y15 Z0.3 F7000
G92 E0
G1 E14 F600
G92 E0
G1 X60.0 E9.0 F1000.0
G1 X100.0 E12.5 F1000.0
G1 E12 F1000.0
G92 E-0.5
# Use print_end for you slicer ending script
[gcode_macro print_end]
gcode:
M104 S0
M140 S0
M107
G92 E0
G91
G1 Z10 E-10 F3000
G90
G0 X125 Y245 F1000
[extruder]
# on E0 stepper pins of main MCU
step_pin: ar26
dir_pin: ar28
enable_pin: !ar24
step_distance: 0.003339
nozzle_diameter: 0.400
filament_diameter: 1.750
max_extrude_only_distance: 100.0
heater_pin: ar10
max_power: 1.0
sensor_type: ATC Semitec 104GT-2
sensor_pin: analog13
control: pid
pid_Kp: 21.759
pid_Ki: 1.107
pid_Kd: 106.889
min_temp: 0
max_temp: 300
# thermally controlled hotend fan
[heater_fan my_nozzle_fan]
# Located on Z MCU on fan D9
pin: z:ar9
[probe]
# Z_Min pins on MCU Z (must be on same MCU as steppers)
pin: ^!z:ar18
z_offset: 1.15
speed: 2.0
[heater_bed]
heater_pin: ar8
# NTC 100K MGB18-104F39050L32 is for Kenovo thermistors
sensor_type: NTC 100K MGB18-104F39050L32
sensor_pin: analog14
# pid gives you better control over bed heat
control: pid
pid_Kp: 63.832
pid_Ki: 3.404
pid_Kd: 299.213
min_temp: 0
max_temp: 130
# print cooling fan
[fan]
# On z MCU on extruder heater pin D10
pin: z:ar10
# "RepRapDiscount 2004 Smart Controller" type displays
#[display]
#lcd_type: hd44780
#rs_pin: ar16
#e_pin: ar17
#d4_pin: ar23
#d5_pin: ar25
#d6_pin: ar27
#d7_pin: ar29
# "RepRapDiscount 128x64 Full Graphic Smart Controller" type displays
[display]
lcd_type: st7920
cs_pin: ar16
sclk_pin: ar23
sid_pin: ar17
[printer]
# settings below are the max and can't be commanded over in gcode
kinematics: corexy
max_velocity: 500
max_accel: 3000
max_z_velocity: 100
max_z_accel: 50
[idle_timeout]
# high motor off time so I don't have to relevel gantry often
timeout: 6000

View File

@@ -0,0 +1,120 @@
# This file contains pin mappings for the ADIMLab 3d printer 2018.
# To use this config, the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: ar25
dir_pin: !ar23
enable_pin: !ar27
step_distance: .0125
endstop_pin: ^!ar22
position_min: -5
position_endstop: -5
position_max: 310
homing_speed: 30.0
[stepper_y]
step_pin: ar32
dir_pin: !ar33
enable_pin: !ar31
step_distance: .0125
endstop_pin: ^!ar26
position_endstop: 0
position_max: 310
homing_speed: 30.0
[stepper_z]
step_pin: ar35
dir_pin: ar36
enable_pin: !ar34
step_distance: .0025
endstop_pin: ^!ar29
position_endstop: 0.0
position_max: 400
homing_speed: 5.0
[extruder]
step_pin: ar42
dir_pin: ar43
enable_pin: !ar37
step_distance: .010799
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar2
sensor_type: ATC Semitec 104GT-2
sensor_pin: analog8
control: pid
pid_Kp: 15.717
pid_Ki: 0.569
pid_Kd: 108.451
min_temp: 0
max_temp: 245
[heater_bed]
heater_pin: ar4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog10
control: pid
pid_Kp: 74.883
pid_Ki: 1.809
pid_Kd: 775.038
min_temp: 0
max_temp: 110
[verify_heater heater_bed]
# adjust for personal bed setup, this prevents stock heated bed from issuing
# false positive heating errors due to slow temperature increase
# 1 deg per 2 minutes.
heating_gain: 1
check_gain_time: 120
[mcu]
serial: /dev/ttyUSB0
pin_map: arduino
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 10
max_z_accel: 60
[output_pin stepper_xy_current]
pin: ar44
pwm: True
scale: 2.0
cycle_time: .000030
hardware_pwm: True
static_value: 1.3
[output_pin stepper_z_current]
pin: ar45
pwm: True
scale: 2.0
cycle_time: .000030
hardware_pwm: True
static_value: 1.3
[output_pin stepper_e_current]
pin: ar46
pwm: True
scale: 2.0
cycle_time: .000030
hardware_pwm: True
static_value: 1.25
[display]
lcd_type: st7920
cs_pin: ar20
sclk_pin: ar14
sid_pin: ar15
encoder_pins: ^ar41, ^ar40
click_pin: ^!ar19
# The filament runout sensor (on pin ar24) is not currently supported
# in Klipper.
[output_pin case_light]
pin: ar7
value: 1

View File

@@ -0,0 +1,88 @@
# This file contains common pin mappings for Anet A8 printer from 2016
# and 2017. To use this config, the firmware should be compiled for
# the AVR atmega1284p.
# Note that the "make flash" command does not work with Anet boards -
# the boards are typically flashed with this command:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PD7
dir_pin: PC5
enable_pin: !PD6
step_distance: .01
endstop_pin: ^!PC2
position_endstop: -30
position_max: 220
position_min: -30
homing_speed: 50
[stepper_y]
step_pin: PC6
dir_pin: PC7
enable_pin: !PD6
step_distance: .01
endstop_pin: ^!PC3
position_endstop: -8
position_min: -8
position_max: 220
homing_speed: 50
[stepper_z]
step_pin: PB3
dir_pin: !PB2
enable_pin: !PA5
step_distance: .0025
endstop_pin: ^!PC4
position_endstop: 0.5
position_max: 240
homing_speed: 20
[extruder]
step_pin: PB1
dir_pin: PB0
enable_pin: !PD6
step_distance: .0105
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD5
sensor_type: ATC Semitec 104GT-2
sensor_pin: PA7
control: pid
pid_Kp: 2.151492
pid_Ki: 0.633897
pid_Kd: 230.042965
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PD4
sensor_type: ATC Semitec 104GT-2
sensor_pin: PA6
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: PB4
[mcu]
serial: /dev/ttyUSB0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 1000
max_z_velocity: 20
max_z_accel: 100
[display]
lcd_type: hd44780
rs_pin: PA3
e_pin: PA2
d4_pin: PD2
d5_pin: PD3
d6_pin: PC0
d7_pin: PC1

View File

@@ -0,0 +1,88 @@
# This file contains common pin mappings for Anet E10 printer from
# 2018. To use this config, the firmware should be compiled for the
# AVR atmega1284p.
# Note that the "make flash" command does not work with Anet boards -
# the boards are typically flashed with this command:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PD7
dir_pin: PC5
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^!PC2
position_endstop: -3
position_max: 220
position_min: -3
homing_speed: 50
[stepper_y]
step_pin: PC6
dir_pin: !PC7
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^!PC3
position_endstop: -22
position_min: -22
position_max: 270
homing_speed: 50
[stepper_z]
step_pin: PB3
dir_pin: !PB2
enable_pin: !PA5
step_distance: .0025
endstop_pin: ^!PC4
position_endstop: 0.5
position_max: 300
homing_speed: 20
[extruder]
step_pin: PB1
dir_pin: !PB0
enable_pin: !PD6
step_distance: 0.01
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD5
sensor_type: ATC Semitec 104GT-2
sensor_pin: PA7
control: pid
pid_Kp: 27.0
pid_Ki: 1.3
pid_Kd: 136.09
min_temp: 10
max_temp: 250
[heater_bed]
heater_pin: PD4
sensor_type: ATC Semitec 104GT-2
sensor_pin: PA6
control: pid
pid_Kp: 72.8
pid_Ki: 1.2
pid_Kd: 1100
min_temp: 10
max_temp: 130
[fan]
pin: PB4
[mcu]
serial: /dev/ttyUSB0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 1000
max_z_velocity: 20
max_z_accel: 1000
[display]
lcd_type: st7920
cs_pin: PA4
sclk_pin: PA1
sid_pin:PA3

View File

@@ -0,0 +1,93 @@
# This file contains pin mappings for the Anycubic i3 Mega with
# Ultrabase from 2017. (This config may work on an Anycubic i3 Mega v1
# prior to the Ultrabase if you comment out the definition of the
# endstop_pin in the stepper_z1 section.) To use this config, the
# firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: ar54
dir_pin: !ar55
enable_pin: !ar38
step_distance: .0125
endstop_pin: ^!ar3
position_min: -5
position_endstop: -5
position_max: 210
homing_speed: 30.0
[stepper_y]
step_pin: ar60
dir_pin: ar61
enable_pin: !ar56
step_distance: .0125
endstop_pin: ^!ar42
position_endstop: 0
position_max: 210
homing_speed: 30.0
[stepper_z]
step_pin: ar46
dir_pin: ar48
enable_pin: !ar62
step_distance: .0025
endstop_pin: ^!ar18
position_endstop: 0.0
position_max: 205
homing_speed: 5.0
[stepper_z1]
step_pin: ar36
dir_pin: ar34
enable_pin: !ar30
step_distance: .0025
endstop_pin: ^!ar43
[extruder]
step_pin: ar26
dir_pin: ar28
enable_pin: !ar24
step_distance: .010799
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: ATC Semitec 104GT-2
sensor_pin: analog13
control: pid
pid_Kp: 15.717
pid_Ki: 0.569
pid_Kd: 108.451
min_temp: 0
max_temp: 245
[heater_fan extruder_fan]
pin: ar44
[heater_bed]
heater_pin: ar8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog14
control: pid
pid_Kp: 74.883
pid_Ki: 1.809
pid_Kd: 775.038
min_temp: 0
max_temp: 110
[fan]
pin: ar9
[mcu]
serial: /dev/ttyUSB0
pin_map: arduino
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 10
max_z_accel: 60
[heater_fan stepstick_fan]
pin: ar7

View File

@@ -0,0 +1,109 @@
# This file contains a configuration for the Anycubic Kossel delta
# printer from 2016.
# The Anycubic delta printers use the TriGorilla board which is an
# AVR ATmega2560 Arduino + RAMPS compatible board.
# To use this config, the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_a]
step_pin: ar54
dir_pin: !ar55
enable_pin: !ar38
step_distance: .0125
endstop_pin: ^ar2
homing_speed: 60
# The next parameter needs to be adjusted for
# your printer. You may want to start with 280
# and meassure the distance from nozzle to bed.
# This value then needs to be added.
position_endstop: 273.0
arm_length: 229.4
[stepper_b]
step_pin: ar60
dir_pin: !ar61
enable_pin: !ar56
step_distance: .0125
endstop_pin: ^ar15
[stepper_c]
step_pin: ar46
dir_pin: !ar48
enable_pin: !ar62
step_distance: .0125
endstop_pin: ^ar19
[extruder]
step_pin: ar26
dir_pin: !ar28
enable_pin: !ar24
step_distance: 0.010989
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog13
control: pid
pid_Kp: 25.349
pid_Ki: 1.216
pid_Kd: 132.130
min_extrude_temp: 150
min_temp: 0
max_temp: 275
#[heater_bed]
#heater_pin: ar8
#sensor_type: EPCOS 100K B57560G104F
#sensor_pin: analog14
#control: watermark
#min_temp: 0
#max_temp: 130
[fan]
pin: ar9
kick_start_time: 0.200
[heater_fan extruder_cooler_fan]
pin: ar44
[mcu]
serial: /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
pin_map: arduino
[printer]
kinematics: delta
max_velocity: 500
max_accel: 3000
max_z_velocity: 200
delta_radius: 99.8
# if you want to DELTA_CALIBRATE you may need that
#minimum_z_position: -5
[idle_timeout]
timeout: 360
#[delta_calibrate]
#radius: 80
#manual_probe:
# If true, then DELTA_CALIBRATE will perform manual probing. If
# false, then a PROBE command will be run at each probe
# point. Manual probing is accomplished by manually jogging the Z
# position of the print head at each probe point and then issuing a
# NEXT extended g-code command to record the position at that
# point. The default is false if a [probe] config section is present
# and true otherwise.
# "RepRapDiscount 2004 Smart Controller" type displays
[display]
lcd_type: hd44780
rs_pin: ar16
e_pin: ar17
d4_pin: ar23
d5_pin: ar25
d6_pin: ar27
d7_pin: ar29
encoder_pins: ^ar31, ^ar33
click_pin: ^!ar35
kill_pin: ^!ar41

View File

@@ -0,0 +1,109 @@
# This file contains a configuration for the "Anycubic Kossel Linear
# Plus Large Printing Size", "Anycubic Kossel Pulley Plus Large
# Printing Size" and similar delta printer from 2017.
# The Anycubic delta printers use the TriGorilla board which is an
# AVR ATmega2560 Arduino + RAMPS compatible board.
# To use this config, the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_a]
step_pin: ar54
dir_pin: !ar55
enable_pin: !ar38
step_distance: .0125
endstop_pin: ^ar2
homing_speed: 60
# The next parameter needs to be adjusted for
# your printer. You may want to start with 280
# and meassure the distance from nozzle to bed.
# This value then needs to be added.
position_endstop: 295.6
arm_length: 271.50
[stepper_b]
step_pin: ar60
dir_pin: !ar61
enable_pin: !ar56
step_distance: .0125
endstop_pin: ^ar15
[stepper_c]
step_pin: ar46
dir_pin: !ar48
enable_pin: !ar62
step_distance: .0125
endstop_pin: ^ar19
[extruder]
step_pin: ar26
dir_pin: !ar28
enable_pin: !ar24
step_distance: 0.010989
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog13
control: pid
pid_Kp: 25.349
pid_Ki: 1.216
pid_Kd: 132.130
min_extrude_temp: 150
min_temp: 0
max_temp: 275
#[heater_bed]
#heater_pin: ar8
#sensor_type: EPCOS 100K B57560G104F
#sensor_pin: analog14
#control: watermark
#min_temp: 0
#max_temp: 130
[fan]
pin: ar9
kick_start_time: 0.200
[heater_fan extruder_cooler_fan]
pin: ar44
[mcu]
serial: /dev/ttyUSB0
pin_map: arduino
[printer]
kinematics: delta
max_velocity: 500
max_accel: 3000
max_z_velocity: 200
delta_radius: 115
# if you want to DELTA_CALIBRATE you may need that
#minimum_z_position: -5
[idle_timeout]
timeout: 360
#[delta_calibrate]
#radius: 115
#manual_probe:
# If true, then DELTA_CALIBRATE will perform manual probing. If
# false, then a PROBE command will be run at each probe
# point. Manual probing is accomplished by manually jogging the Z
# position of the print head at each probe point and then issuing a
# NEXT extended g-code command to record the position at that
# point. The default is false if a [probe] config section is present
# and true otherwise.
# "RepRapDiscount 2004 Smart Controller" type displays
[display]
lcd_type: hd44780
rs_pin: ar16
e_pin: ar17
d4_pin: ar23
d5_pin: ar25
d6_pin: ar27
d7_pin: ar29
encoder_pins: ^ar31, ^ar33
click_pin: ^!ar35
kill_pin: ^!ar41

View File

@@ -0,0 +1,90 @@
# This file contains common pin mappings for the 2017 Creality
# CR-10. To use this config, the firmware should be compiled for the
# AVR atmega1284p.
# Note, a number of Melzi boards are shipped with a bootloader that
# requires the following command to flash the board:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# If the above command does not work and "make flash" does not work
# then one may need to flash a bootloader to the board - see the
# Klipper docs/Bootloaders.md file for more information.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PD7
dir_pin: !PC5
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^PC2
position_endstop: 0
position_max: 300
homing_speed: 50
[stepper_y]
step_pin: PC6
dir_pin: !PC7
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^PC3
position_endstop: 0
position_max: 300
homing_speed: 50
[stepper_z]
step_pin: PB3
dir_pin: PB2
enable_pin: !PA5
step_distance: .0025
endstop_pin: ^PC4
position_endstop: 0.0
position_max: 400
[extruder]
step_pin: PB1
dir_pin: !PB0
enable_pin: !PD6
step_distance: 0.010526
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA7
control: pid
pid_Kp: 22.57
pid_Ki: 1.72
pid_Kd: 73.96
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PD4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA6
control: pid
pid_Kp: 426.68
pid_Ki: 78.92
pid_Kd: 576.71
min_temp: 0
max_temp: 130
[fan]
pin: PB4
[mcu]
serial: /dev/ttyUSB0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[display]
lcd_type: st7920
cs_pin: PA3
sclk_pin: PA1
sid_pin: PC1
encoder_pins: ^PD2, ^PD3
click_pin: ^!PC0

View File

@@ -0,0 +1,90 @@
# This file contains common pin mappings for the 2017 Creality CR-10
# mini. To use this config, the firmware should be compiled for the
# AVR atmega1284p.
# Note, a number of Melzi boards are shipped with a bootloader that
# requires the following command to flash the board:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# If the above command does not work and "make flash" does not work
# then one may need to flash a bootloader to the board - see the
# Klipper docs/Bootloaders.md file for more information.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PD7
dir_pin: !PC5
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^PC2
position_endstop: 0
position_max: 300
homing_speed: 50
[stepper_y]
step_pin: PC6
dir_pin: !PC7
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^PC3
position_endstop: 0
position_max: 220
homing_speed: 50
[stepper_z]
step_pin: PB3
dir_pin: PB2
enable_pin: !PA5
step_distance: .0025
endstop_pin: ^PC4
position_endstop: 0.0
position_max: 300
[extruder]
step_pin: PB1
dir_pin: !PB0
enable_pin: !PD6
step_distance: 0.010526
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA7
control: pid
pid_Kp: 22.57
pid_Ki: 1.72
pid_Kd: 73.96
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PD4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA6
control: pid
pid_Kp: 426.68
pid_Ki: 78.92
pid_Kd: 576.71
min_temp: 0
max_temp: 130
[fan]
pin: PB4
[mcu]
serial: /dev/ttyUSB0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[display]
lcd_type: st7920
cs_pin: PA3
sclk_pin: PA1
sid_pin: PC1
encoder_pins: ^PD2, ^PD3
click_pin: ^!PC0

View File

@@ -0,0 +1,83 @@
# This file contains pin mappings for the 2017 Creality CR-10S. To use
# this config, the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
step_distance: .0125
endstop_pin: ^ar3
position_endstop: 0
position_max: 300
homing_speed: 50
[stepper_y]
step_pin: ar60
dir_pin: ar61
enable_pin: !ar56
step_distance: .0125
endstop_pin: ^ar14
position_endstop: 0
position_max: 300
homing_speed: 50
[stepper_z]
step_pin: ar46
dir_pin: !ar48
enable_pin: !ar62
step_distance: .0025
endstop_pin: ^ar18
position_endstop: 0.5
position_max: 400
[extruder]
step_pin: ar26
dir_pin: ar28
enable_pin: !ar24
step_distance: .010526
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog13
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: ar8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog14
control: pid
pid_Kp: 690.34
pid_Ki: 111.47
pid_Kd: 1068.83
min_temp: 0
max_temp: 130
[fan]
pin: ar9
[mcu]
serial: /dev/ttyUSB0
pin_map: arduino
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[display]
lcd_type: st7920
cs_pin: ar16
sclk_pin: ar23
sid_pin: ar17
encoder_pins: ^ar33, ^ar31
click_pin: ^!ar35

View File

@@ -0,0 +1,81 @@
# This file contains pin mappings for the Creality CR-20. To use
# this config, the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PF0
dir_pin: PF1
enable_pin: !PD7
step_distance: .0125
endstop_pin: ^PE5
position_endstop: 0
position_max: 235
homing_speed: 50
[stepper_y]
step_pin: PF6
dir_pin: PF7
enable_pin: !PF2
step_distance: .0125
endstop_pin: ^PJ1
position_endstop: 0
position_max: 235
homing_speed: 50
[stepper_z]
step_pin: PL3
dir_pin: !PL1
enable_pin: !PK0
step_distance: .0025
endstop_pin: ^PD3
position_endstop: 0.5
position_max: 250
[extruder]
step_pin: PA4
dir_pin: PA6
enable_pin: !PA2
step_distance: .010526
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK5
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PH5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: pid
pid_Kp: 690.34
pid_Ki: 111.47
pid_Kd: 1068.83
min_temp: 0
max_temp: 130
[fan]
pin: PH6
[mcu]
serial: /dev/ttyUSB0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[display]
lcd_type: uc1701
cs_pin: PA3
a0_pin: PA5
encoder_pins: ^PC4, ^PC6
click_pin: ^!PC2

View File

@@ -0,0 +1,93 @@
# This file contains common pin mappings for the 2017 Creality
# Ender 2. To use this config, the firmware should be compiled for the
# AVR atmega1284p.
# Note, a number of Melzi boards are shipped with a bootloader that
# requires the following command to flash the board:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# If the above command does not work and "make flash" does not work
# then one may need to flash a bootloader to the board - see the
# Klipper docs/Bootloaders.md file for more information.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PD7
dir_pin: !PC5
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^PC2
position_endstop: 0
position_max: 165
homing_speed: 50
[stepper_y]
step_pin: PC6
dir_pin: !PC7
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^PC3
position_endstop: 0
position_max: 165
homing_speed: 50
[stepper_z]
step_pin: PB3
dir_pin: PB2
enable_pin: !PA5
step_distance: .0025
endstop_pin: ^PC4
position_endstop: 0.0
position_max: 205
[extruder]
step_pin: PB1
dir_pin: !PB0
enable_pin: !PD6
step_distance: 0.010753
nozzle_diameter: 0.400
filament_diameter: 1.750
max_extrude_only_distance: 500.0
max_extrude_only_velocity: 200.0
max_extrude_only_accel: 500.0
heater_pin: PD5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA7
control: pid
pid_Kp: 21.73
pid_Ki: 1.54
pid_Kd: 76.55
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PD4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA6
control: pid
# PID Tuned for 60C
pid_Kp: 72.487
pid_Ki: 2.279
pid_Kd: 576.275
min_temp: 0
max_temp: 100
[fan]
pin: PB4
[mcu]
serial: /dev/ttyUSB0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 1500
max_z_velocity: 5
max_z_accel: 100
[display]
lcd_type: uc1701
cs_pin: PA3
a0_pin: PA1
encoder_pins: ^PD2, ^PD3
click_pin: ^!PC0

View File

@@ -0,0 +1,93 @@
# This file contains common pin mappings for the 2018 Creality
# Ender 3. To use this config, the firmware should be compiled for the
# AVR atmega1284p.
# Note, a number of Melzi boards are shipped with a bootloader that
# requires the following command to flash the board:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# If the above command does not work and "make flash" does not work
# then one may need to flash a bootloader to the board - see the
# Klipper docs/Bootloaders.md file for more information.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PD7
dir_pin: !PC5
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^PC2
position_endstop: 0
position_max: 235
homing_speed: 50
[stepper_y]
step_pin: PC6
dir_pin: !PC7
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^PC3
position_endstop: 0
position_max: 235
homing_speed: 50
[stepper_z]
step_pin: PB3
dir_pin: PB2
enable_pin: !PA5
step_distance: .0025
endstop_pin: ^PC4
position_endstop: 0.0
position_max: 250
[extruder]
max_extrude_only_distance: 100.0
step_pin: PB1
dir_pin: !PB0
enable_pin: !PD6
step_distance: 0.010526
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA7
control: pid
# tuned for stock hardware with 200 degree Celsius target
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PD4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA6
control: pid
# tuned for stock hardware with 50 degree Celsius target
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
[fan]
pin: PB4
[mcu]
serial: /dev/ttyUSB0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[display]
lcd_type: st7920
cs_pin: PA3
sclk_pin: PA1
sid_pin: PC1
encoder_pins: ^PD2, ^PD3
click_pin: ^!PC0

View File

@@ -0,0 +1,116 @@
# This file contains pin mappings for the Lulzbot TAZ 6 circa 2017. To
# use this config, the firmware should be compiled for the AVR
# atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PC0
dir_pin: PL1
enable_pin: !PA7
step_distance: .010000
endstop_pin: ^PB6
position_endstop: -20
position_min: -20
position_max: 300
homing_speed: 50
[stepper_y]
step_pin: PC1
dir_pin: !PL0
enable_pin: !PA6
step_distance: .010000
endstop_pin: ^PA1
position_endstop: 306
position_min: -20
position_max: 306
homing_speed: 50
[stepper_z]
step_pin: PC2
dir_pin: PL2
enable_pin: !PA5
step_distance: 0.000625
endstop_pin: ^!PB4
position_endstop: -0.7
position_min: -1.5
position_max: 270
homing_speed: 1
[extruder]
step_pin: PC3
dir_pin: !PL6
enable_pin: !PA4
step_distance: 0.001182
nozzle_diameter: 0.400
filament_diameter: 2.920
heater_pin: PH6
sensor_type: ATC Semitec 104GT-2
sensor_pin: PF0
control: pid
pid_Kp: 28.79
pid_Ki: 1.91
pid_Kd: 108.51
min_temp: 0
max_temp: 300
min_extrude_temp: 140
#[extruder1]
#step_pin: PC4
#dir_pin: PL7
#enable_pin: !PA3
#heater_pin: PH4
#sensor_pin: PF1
#...
[heater_bed]
heater_pin: PE5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF2
control: watermark
min_temp: 0
max_temp: 130
[fan]
pin: PH5
[heater_fan nozzle_cooling_fan]
pin: PH3
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 2
max_z_accel: 10
[ad5206 stepper_digipot]
enable_pin: PD7
scale: 2.08
# Channel 1 is E0, 2 is E1, 3 is unused, 4 is Z, 5 is X, 6 is Y
channel_1: 1.34
channel_2: 1.0
channel_4: 1.1
channel_5: 1.1
channel_6: 1.1
# Enable 16 micro-steps on steppers X, Y, Z, E0, E1
[static_digital_output stepper_config]
pins:
PG1, PG0,
PK7, PG2,
PK6, PK5,
PK3, PK4,
PK1, PK2
[static_digital_output yellow_led]
pins: !PB7
[display]
lcd_type: st7920
cs_pin: PG4
sclk_pin: PJ2
sid_pin: PG3

View File

@@ -12,8 +12,10 @@ endstop_pin: ^!PB6
position_endstop: 0.0
position_max: 200
homing_speed: 50
homing_stepper_phases: 32
homing_endstop_accuracy: .200
[endstop_phase stepper_x]
phases: 32
endstop_accuracy: .200
[stepper_y]
step_pin: PC1
@@ -24,8 +26,10 @@ endstop_pin: ^!PB5
position_endstop: 0.0
position_max: 250
homing_speed: 50
homing_stepper_phases: 32
homing_endstop_accuracy: .200
[endstop_phase stepper_y]
phases: 32
endstop_accuracy: .200
[stepper_z]
step_pin: PC2
@@ -37,8 +41,10 @@ position_min: 0.1
position_endstop: 0.7
position_max: 200
homing_retract_dist: 2.0
homing_stepper_phases: 32
homing_endstop_accuracy: .070
[endstop_phase stepper_z]
phases: 32
endstop_accuracy: .070
[extruder]
step_pin: PC3
@@ -72,7 +78,8 @@ pin: PH5
[heater_fan nozzle_fan]
pin: PH3
max_power: 0.61
hard_pwm: 1
cycle_time: .000030
hardware_pwm: True
[mcu]
serial: /dev/ttyACM0

View File

@@ -0,0 +1,79 @@
# This file contains a configuration for the "Micromake D1" delta
# printer (using the Makeboard 1.3 electronics). To use this config,
# the firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_a]
step_pin: ar54
dir_pin: !ar55
enable_pin: !ar38
step_distance: .01
endstop_pin: ^ar2
homing_speed: 100
position_endstop: 319.5
arm_length: 217.0
[stepper_b]
step_pin: ar60
dir_pin: !ar61
enable_pin: !ar56
step_distance: .01
endstop_pin: ^ar15
[stepper_c]
step_pin: ar46
dir_pin: !ar48
enable_pin: !ar62
step_distance: .01
endstop_pin: ^ar19
[extruder]
step_pin: ar26
dir_pin: ar28
enable_pin: !ar24
step_distance: 0.006271
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog13
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250
max_extrude_only_distance: 100.0
[fan]
pin: ar9
[mcu]
serial: /dev/ttyACM0
pin_map: arduino
[printer]
kinematics: delta
max_velocity: 300
max_accel: 3000
max_z_velocity: 150
delta_radius: 95
[delta_calibrate]
radius: 80
#[probe]
#pin: ^!ar18
[display]
lcd_type: hd44780
rs_pin: ar16
e_pin: ar17
d4_pin: ar23
d5_pin: ar25
d6_pin: ar27
d7_pin: ar29
encoder_pins: ^ar31, ^ar33
click_pin: ^!ar35
kill_pin: ^!ar41

View File

@@ -0,0 +1,94 @@
# This file constains the pin mappings for the SeeMeCNC Rostock Max
# (version 2) delta printer from 2015. To use this config, the
# firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_a]
step_pin: PC0
dir_pin: !PL1
enable_pin: !PA7
step_distance: .0125
endstop_pin: ^PA2
homing_speed: 50
position_endstop: 380
arm_length: 290.800
[stepper_b]
step_pin: PC1
dir_pin: PL0
enable_pin: !PA6
step_distance: .0125
endstop_pin: ^PA1
[stepper_c]
step_pin: PC2
dir_pin: !PL2
enable_pin: !PA5
step_distance: .0125
endstop_pin: ^PC7
[extruder]
step_pin: PC3
dir_pin: !PL6
enable_pin: !PA4
step_distance: .010793
nozzle_diameter: 0.500
filament_diameter: 1.750
heater_pin: PH6
sensor_type: ATC Semitec 104GT-2
sensor_pin: PF0
control: pid
pid_Kp: 20.9700
pid_Ki: 1.3400
pid_Kd: 80.5600
min_temp: 0
max_temp: 300
[heater_bed]
heater_pin: PE5
sensor_type: ATC Semitec 104GT-2
sensor_pin: PF2
control: pid
pid_Kp: 46.510
pid_Ki: 1.040
pid_Kd: 500.000
min_temp: 0
max_temp: 300
[fan]
pin: PH5
[heater_fan nozzle_cooling_fan]
pin: PH4
heater: extruder
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: delta
max_velocity: 300
max_accel: 3000
max_z_velocity: 150
delta_radius: 174.75
[ad5206 stepper_digipot]
enable_pin: PD7
scale: 2.08
channel_1: 1.34
channel_2: 1.0
channel_4: 1.1
channel_5: 1.1
channel_6: 1.1
[static_digital_output stepper_config]
pins:
PG1, PG0,
PK7, PG2,
PK6, PK5,
PK3, PK4,
PK1, PK2
[static_digital_output yellow_led]
pins: !PB7

View File

@@ -0,0 +1,94 @@
# This file contains pin mappings for the Tronxy X5S (circa 2017). To
# use this config, the firmware should be compiled for the AVR
# atmega1284p.
# Note, a number of Melzi boards are shipped with a bootloader that
# requires the following command to flash the board:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# If the above command does not work and "make flash" does not work
# then one may need to flash a bootloader to the board - see the
# Klipper docs/Bootloaders.md file for more information.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PD7
dir_pin: !PC5
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^!PC2
position_endstop: 0
position_max: 330
homing_speed: 50
[stepper_y]
step_pin: PC6
dir_pin: !PC7
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^!PC3
position_endstop: 0
position_max: 310
homing_speed: 50
[stepper_z]
step_pin: PB3
dir_pin: PB2
enable_pin: !PD6
step_distance: .0025
endstop_pin: ^!PC4
position_endstop: 0.5
position_max: 400
[extruder]
step_pin: PB1
dir_pin: PB0
enable_pin: !PD6
step_distance: .0111
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA7
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 275
[heater_bed]
heater_pin: PD4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA6
control: watermark
min_temp: 0
max_temp: 150
[verify_heater heater_bed]
# adjust for personal bed setup, this prevents stock heated bed from issuing
# false positive heating errors due to slow temperature increase
check_gain_time: 600
[fan]
pin: PB4
[mcu]
serial: /dev/ttyUSB0
[printer]
kinematics: corexy
max_velocity: 300
max_accel: 1000
max_z_velocity: 20
max_z_accel: 100
[display]
lcd_type: st7920
cs_pin: PA1
sclk_pin: PC0
sid_pin: PA3
# buttons are:
# PD2, PD3: encoder
# PA5: click

View File

@@ -0,0 +1,91 @@
# This file contains the configurations and pin mappings for the
# Tronxy X8 using the CXY-V2-0508 board. To use this config file, the
# firmware should be compiled for the AVR ATmega1284p, 16MHz.
# Some Tronxy printers come without a bootloader present on the
# board. In that case, use MCUDude MightyCore ATmega1284p bootloader
# with TQFP44 Sanguino pinout. The package can be found at
# (https://github.com/MCUdude/MightyCore). Follow Klipper install
# instructions but instead of "make flash FLASH_DEVICE=/dev/ttyACM0",
# use the following command:
# avrdude -p atmega1284p -c arduino -b 115200 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# See the example.cfg and example-extras.cfg files for a description
# of available parameters.
[mcu]
serial: /dev/ttyUSB0
[stepper_x]
step_pin: PD7
dir_pin: PC5
enable_pin: !PD6
step_distance: 0.010
endstop_pin: ^!PC2
position_endstop: -47
position_max: 220
position_min: -47
homing_speed: 50
[stepper_y]
step_pin: PC6
dir_pin: PC7
enable_pin: !PD6
step_distance: 0.010
endstop_pin: ^!PC3
position_endstop: 0
position_max: 220
position_min: 0
homing_speed: 50
[stepper_z]
step_pin: PB3
dir_pin: !PB2
enable_pin: !PD6
step_distance: 0.0025
endstop_pin: ^!PC4
position_endstop: 0
position_max: 210
homing_speed: 10
[extruder]
step_pin: PB1
dir_pin: PB0
enable_pin: !PD6
step_distance: 0.009931
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA7
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 275
[heater_bed]
heater_pin: PD4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA6
control: watermark
max_delta: 2.0
min_temp: 0
max_temp: 150
[fan]
pin: PB4
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 1000
max_z_velocity: 20
max_z_accel: 100
[display]
lcd_type: st7920
cs_pin: PA1
sclk_pin: PC0
sid_pin: PA3

View File

@@ -0,0 +1,95 @@
# This file contains common pin mappings for the Velleman K8200 and
# 3Drag 3D printers (circa 2013). To use this config, the firmware
# should be compiled for the AVR atmega2560.
# Based on config from Martin Malmqvist and Per Hjort.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: ar54
dir_pin: !ar55
enable_pin: !ar38
step_distance: .0125
endstop_pin: ^ar3
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: ar60
dir_pin: !ar61
enable_pin: !ar56
step_distance: .0125
endstop_pin: ^ar14
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: ar46
dir_pin: !ar48
enable_pin: !ar63
step_distance: .0025
endstop_pin: ^ar18
position_endstop: 0.5
# Set position_max to 200 if you have the original Z-axis setup.
position_max: 250
[extruder]
step_pin: ar26
# Remove the "!" from dir_pin if you have an original extruder
dir_pin: !ar28
enable_pin: !ar24
# You will have to calculate your own step_distance.
# This is for the belted extruder https://www.thingiverse.com/thing:339928
step_distance: .001333
nozzle_diameter: 0.400
filament_diameter: 2.85
heater_pin: ar10
sensor_type: ATC Semitec 104GT-2
sensor_pin: analog13
control: pid
pid_Kp: 21.503
pid_Ki: 1.103
pid_Kd: 104.825
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: ar9
sensor_type: ATC Semitec 104GT-2
sensor_pin: analog14
control: pid
pid_Kp: 75.283
pid_Ki: 0.588
pid_Kd: 2408.103
min_temp: 0
max_temp: 130
[fan]
pin: ar8
kick_start_time: 0.500
[mcu]
serial: /dev/ttyUSB0
pin_map: arduino
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 1000
max_z_velocity: 10
max_z_accel: 100
# The LCD is untested - "RepRapDiscount 2004 Smart Controller" displays
#[display]
#lcd_type: hd44780
#rs_pin: ar27
#e_pin: ar29
#d4_pin: ar37
#d5_pin: ar35
#d6_pin: ar33
#d7_pin: ar31
#encoder_pins: ^ar16, ^ar17
#click_pin: ^!ar23

View File

@@ -0,0 +1,104 @@
# Support for the Wanhao Duplicator 6 and its clones (eg, Monoprice
# Ultimate). To use this config, the firmware should be compiled for
# the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PA3
dir_pin: !PA1
enable_pin: !PA5
step_distance: 0.0125
endstop_pin: ^!PA0
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_y]
step_pin: PC5
dir_pin: PC4
enable_pin: !PC6
step_distance: 0.0125
endstop_pin: ^!PA4
position_endstop: 0
position_max: 200
homing_speed: 50
[stepper_z]
step_pin: PC2
dir_pin: !PC1
enable_pin: !PC3
step_distance: 0.0025
endstop_pin: ^!PA7
position_endstop: 0.5
position_max: 175
homing_speed: 25
[extruder]
step_pin: PL7
dir_pin: !PL6
enable_pin: !PC0
step_distance: 0.010091
nozzle_diameter: 0.400
filament_diameter: 1.7500
heater_pin: PE4
sensor_type: PT100 INA826
sensor_pin: PK0
control: pid
pid_Kp: 26.571
pid_Ki: 0.927
pid_Kd: 190.318
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PG5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK2
control: pid
pid_Kp: 59.593
pid_Ki: 3.01
pid_Kd: 294.985
min_temp: 0
max_temp: 110
[fan]
pin: PH4
[mcu]
serial: /dev/ttyACM0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
# Software control for Stepper current
[output_pin stepper_xy_current]
pin: PL5
pwm: True
scale: 2.782
cycle_time: .000030
hardware_pwm: True
static_value: 1.2
[output_pin stepper_z_current]
pin: PL4
pwm: True
scale: 2.782
cycle_time: .000030
hardware_pwm: True
static_value: 1.2
[output_pin stepper_e_current]
pin: PL3
pwm: True
scale: 2.782
cycle_time: .000030
hardware_pwm: True
static_value: 1.0
# N.B. No support for the Display as yet. SSD1309 OLED graphical
# display connected with i2C.

View File

@@ -0,0 +1,78 @@
# This file contains pin mappings for the Wanhao Duplicator i3 Plus
# (circa 2017). To use this config, the firmware should be compiled
# for the AVR atmega2560.
# Pin numbers and other parameters were extracted from the
# official Marlin source available at:
# https://github.com/garychen99/Duplicator-i3-plus
# See the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PF7
dir_pin: !PK0
enable_pin: !PF6
step_distance: .0125
endstop_pin: ^!PF0
position_endstop: 0
position_max: 200
homing_speed: 30.0
[stepper_y]
step_pin: PK2
dir_pin: !PK3
enable_pin: !PK1
step_distance: .0125
endstop_pin: ^!PA2
position_endstop: 0
position_max: 200
homing_speed: 30.0
[stepper_z]
step_pin: PK5
dir_pin: PK7
enable_pin: !PK4
step_distance: .0025
endstop_pin: ^!PA1
position_endstop: 0.5
position_max: 180
[extruder]
step_pin: PF4
dir_pin: PF5
enable_pin: !PF3
step_distance: 0.010417
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PG5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF1
control: pid
pid_Kp: 30.850721
pid_Ki: .208175
pid_Kd: 192.298728
min_temp: 0
max_temp: 260
[heater_bed]
heater_pin: PE5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PK6
control: pid
pid_Kp: 64.095903
pid_Ki: 1.649830
pid_Kd: 622.531455
min_temp: 0
max_temp: 110
[fan]
pin: PE3
[mcu]
serial: /dev/ttyUSB0
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 800
max_z_velocity: 5
max_z_accel: 100

View File

@@ -0,0 +1,169 @@
# This file contains pin mappings and other appropriate default
# parameters for a Wanhao Duplicator i3 v2.1 and its clones (Monoprice
# Maker Select, Cocoon Create, etc.).
#
# This will probably work on older revisions (v1.0, v2.0) of the printer
# but is untested on those versions.
# Note, a number of Melzi boards are shipped with a bootloader that
# requires the following command to flash the board:
# avrdude -p atmega1284p -c arduino -b 57600 -P /dev/ttyUSB0 -U out/klipper.elf.hex
# If the above command does not work and "make flash" does not work
# then one may need to flash a bootloader to the board - see the
# Klipper docs/Bootloaders.md file for more information.
# See the example.cfg file for a description of available parameters.
# For best results with klipper and the Wanhao Duplicator i3, follow these
# guidelines:
#
# - Locate the USB serial port for your printer in /dev/serial/by-id/ format.
# See https://github.com/KevinOConnor/klipper/blob/master/docs/FAQ.md#wheres-my-serial-port
# It will be something like:
# /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_ABCD1234-if00-port0
#
# - Configure klipper to compile firmware for the AVR atmega1284p
#
# - At this point, "make flash FLASH_DEVICE=..." should successfully
# flash your printer board. Use the /dev/serial/by-id/ format for
# FLASH_DEVICE to ensure consistent results.
# See https://github.com/KevinOConnor/klipper/blob/master/docs/FAQ.md#the-make-flash-command-doesnt-work
# if you have problems.
#
# - Copy this sample file you are currently reading to ~/printer.cfg,
# and customize the following parameters:
# * [extruder] > step_distance
#
# This is the inverse of "E steps" (extruder steps per mm) from the stock
# Wanhao Repetier-based firmware.
# (See https://3dprinterwiki.info/extruder-steps/ )
#
# For example, if your E-steps are set to 107.0 steps per mm,
# then step_distance should be (1 / 107.0) ~= .009346
#
# * [extruder] > PID parameters (pid_Kp, pid_Ki, pid_Kd)
# * [heater_bed] > PID parameters (pid_Kp, pid_Ki, pid_Kd)
#
# PID values from stock Wanhao firmware (Repetier) do not
# translate directly to klipper. You will need to run klipper's
# PID autotune function for the extruder and bed. After getting the
# klipper firmware up and running, run the PID_CALIBRATE procedures
# by sending these commands via octoprint terminal (one per autotune):
#
# extruder: PID_CALIBRATE HEATER=extruder TARGET=<temp>
# heated bed: PID_CALIBRATE HEATER=heater_bed TARGET=<temp>
#
# After the autotune process completes, PID parameter results
# can be found in the Octoprint terminal tab (if you're quick)
# or in /tmp/klippy.log.
#
# Enter the PID parameters into the appropriate sections of ~/printer.cfg .
#
# * [extruder] > max_temp
# * [heater_bed] > max_temp
#
# The max temps included in this printer config are limited to 230 for extruder
# and 70 for heated bed. If your printer has been modified to handle higher temps
# (like an upgraded hot end or a separate MOSFET for your heated bed), you may
# want to increase these values.
#
# Note: Some Melzi boards were shipped with 10K pullup resistors
# instead of 4.7K. If the temperatures on your printer seem way
# off before running the PID tune, you may need to add
# "pullup_resistor: 10000" to both the extruder and the heater_bed
# config sections.
#
# * [mcu] > serial
#
# Enter the USB serial port of the printer in /dev/serial/by-id/ format
# for best results.
#
# - Power cycle the Wanhao Duplicator i3
#
# - Issue the command "RESTART" via the Octoprint terminal tab (similar to
# how you would send a manual gcode command, but send the word RESTART).
# This tells klipper to reload its config file and do an internal reset.
# You should then see a status screen appear on the printer's LCD.
#
# - Be sure to follow these instructions before attempting any prints:
# https://github.com/KevinOConnor/klipper/blob/master/docs/Config_checks.md
[stepper_x]
step_pin: PD7
dir_pin: PC5
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^!PC2
position_endstop: 0
position_max: 200
homing_speed: 40
[stepper_y]
step_pin: PC6
dir_pin: PC7
enable_pin: !PD6
step_distance: .0125
endstop_pin: ^!PC3
position_endstop: 0
position_max: 200
homing_speed: 40
[stepper_z]
step_pin: PB3
dir_pin: !PB2
enable_pin: !PA5
step_distance: 0.0025
endstop_pin: ^!PC4
position_endstop: 0.5
position_max: 180
homing_speed: 2
[extruder]
step_pin: PB1
dir_pin: !PB0
enable_pin: !PD6
step_distance: .009346
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PD5
sensor_type: NTC 100K beta 3950
sensor_pin: PA7
control: pid
pid_Kp: 18.214030
pid_Ki: 0.616380
pid_Kd: 134.556146
min_temp: 0
max_temp: 230
[heater_bed]
heater_pin: PD4
sensor_type: NTC 100K beta 3950
sensor_pin: PA6
control: pid
pid_Kp: 71.321
pid_Ki: 1.989
pid_Kd: 639.210
min_temp: 0
max_temp: 70
[fan]
pin: PB4
[mcu]
serial: /dev/ttyUSB0
restart_method: command
[printer]
kinematics: cartesian
max_velocity: 200
max_accel: 1000
max_z_velocity: 2
max_z_accel: 100
[display]
lcd_type: st7920
cs_pin: PC1
sclk_pin: PD3
sid_pin: PC0
encoder_pins: ^PA2, ^PA1
click_pin: ^!PA3

36
config/sample-macros.cfg Normal file
View File

@@ -0,0 +1,36 @@
# This file provides examples of Klipper G-Code macros. The snippets
# in this file may be copied into the main printer.cfg file.
#
# See the "example.cfg" file for description of common config parameters.
# M300 : Play tone, Beeper support, as commonly found on usual LCD displays
# i.e. RepRapDiscount 2004 Smart Controller, RepRapDiscount 12864 Full Graphic
# This defines a custom I/O pin and a custom GCODE macro
# Usage: M300 [P<ms>] [S<Hz>] P is the tone duration, S the tone frequency.
# as it is based on a PWM duty cycle, the frequency won't be pitch perfect.
#
#[output_pin BEEPER_pin]
#pin: ar37
# Beeper pin. This parameter must be provided.
# ar37 is the default RAMPS/MKS pin.
#pwm: True
# A piezo beeper needs a PWM signal, a DC buzzer doesn't.
#value: 0
# Silent at power on, set to 1 if active low.
#shutdown_value: 0
# Disable at emergency shutdown (no PWM would be available anyway).
#cycle_time: 0.001
# PWM frequency : 0.001 = 1ms will give a base tone of 1kHz
#scale: 1000
# PWM parameter will be in the range of (0-1000 Hz).
# Although not pitch perfect.
#
#[gcode_macro M300]
#default_parameter_S=1000
# Allows for a default 1kHz tone if S is omitted
#default_parameter_P=100
# Allows for a default 10ms duration is P is omitted
#gcode: SET_PIN PIN=BEEPER_pin VALUE={S}
# G4 P{P}
# SET_PIN PIN=BEEPER_pin VALUE=0

View File

@@ -0,0 +1,51 @@
# This file provides example config file settings for use on a printer
# that uses a Z probe instead of a traditional Z endstop switch. This
# file is just a "snippet" of config sections - it must be added to a
# config file containing the configuration of the rest of the printer.
# Be sure to review and update this config with the appropriate pins
# and coordinates for your printer.
# See the "example.cfg" and "example-extras.cfg" files for a
# description of config parameters.
# Define a probe
[probe]
pin: ar30
z_offset: 2.345
# Example settings to add to stepper_z section
[stepper_z]
endstop_pin: probe:z_virtual_endstop
position_min: -2 # The Z carriage may need to travel below the Z=0
# homing point if the bed has a significant tilt.
# The homing_override section modifies the default G28 behavior
[homing_override]
set_position_z: 5
axes: z
gcode:
; G90 ; Uncomment these 2 lines to blindly lift the Z 2mm at start
; G1 Z7 F600
G28 X0 Y0
G1 X100 Y100 F3600
G28 Z0
# Example bed_tilt config section
[bed_tilt]
points:
100,100
10,10
10,100
10,190
100,10
100,190
190,10
190,100
190,190
# Example bed_mesh config section
[bed_mesh]
min_point: 20,20
max_point: 200,200
probe_count: 4,4

272
docs/Bootloaders.md Executable file
View File

@@ -0,0 +1,272 @@
This document provides information on common bootloaders found on
micro-controllers that Klipper supports.
The bootloader is 3rd-party software that runs on the micro-controller
when it is first powered on. It is typically used to flash a new
application (eg, Klipper) to the micro-controller without requiring
specialized hardware. Unfortunately, there is no industry wide
standard for flashing a micro-controller, nor is there a standard
bootloader that works across all micro-controllers. Worse, it is
common for each bootloader to require a different set of steps to
flash an application.
If one can flash a bootloader to a micro-controller then one can
generally also use that mechanism to flash an application, but care
should be taken when doing this as one may inadvertently remove the
bootloader. In contrast, a bootloader will generally only permit a
user to flash an application. It is therefore recommended to use a
bootloader to flash an application where possible.
This document attempts to describe common bootloaders, the steps
needed to flash a bootloader, and the steps needed to flash an
application. This document is not an authoritative reference; it is
intended as a collection of useful information that the Klipper
developers have accumulated.
AVR micro-controllers
=====================
In general, the Arduino project is a good reference for bootloaders
and flashing procedures on the 8-bit Atmel Atmega micro-controllers.
In particular, the "boards.txt" file:
https://github.com/arduino/Arduino/blob/1.8.5/hardware/arduino/avr/boards.txt
is a useful reference.
To flash a bootloader itself, the AVR chips require an external
hardware flashing tool (which communicates with the chip using
SPI). This tool can be purchased (for example, do a web search for
"avr isp", "arduino isp", or "usb tiny isp"). It is also possible to
use another Arduino or Raspberry Pi to flash an AVR bootloader (for
example, do a web search for "program an avr using raspberry pi"). The
examples below are written assuming an "AVR ISP Mk2" type device is in
use.
The "avrdude" program is the most common tool used to flash atmega
chips (both bootloader flashing and application flashing).
## Atmega2560 ##
This chip is typically found in the "Arduino Mega" and is very common
in 3d printer boards.
To flash the bootloader itself use something like:
```
wget 'https://github.com/arduino/Arduino/raw/1.8.5/hardware/arduino/avr/bootloaders/stk500v2/stk500boot_v2_mega2560.hex'
avrdude -cavrispv2 -patmega2560 -P/dev/ttyACM0 -b115200 -e -u -U lock:w:0x3F:m -U efuse:w:0xFD:m -U hfuse:w:0xD8:m -U lfuse:w:0xFF:m
avrdude -cavrispv2 -patmega2560 -P/dev/ttyACM0 -b115200 -U flash:w:stk500boot_v2_mega2560.hex
avrdude -cavrispv2 -patmega2560 -P/dev/ttyACM0 -b115200 -U lock:w:0x0F:m
```
To flash an application use something like:
```
avrdude -cwiring -patmega2560 -P/dev/ttyACM0 -b115200 -D -Uflash:w:out/klipper.elf.hex:i
```
## Atmega1280 ##
This chip is typically found in earlier versions of the "Arduino
Mega".
To flash the bootloader itself use something like:
```
wget 'https://github.com/arduino/Arduino/raw/1.8.5/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega1280.hex'
avrdude -cavrispv2 -patmega1280 -P/dev/ttyACM0 -b115200 -e -u -U lock:w:0x3F:m -U efuse:w:0xF5:m -U hfuse:w:0xDA:m -U lfuse:w:0xFF:m
avrdude -cavrispv2 -patmega1280 -P/dev/ttyACM0 -b115200 -U flash:w:ATmegaBOOT_168_atmega1280.hex
avrdude -cavrispv2 -patmega1280 -P/dev/ttyACM0 -b115200 -U lock:w:0x0F:m
```
To flash an application use something like:
```
avrdude -carduino -patmega1280 -P/dev/ttyACM0 -b57600 -D -Uflash:w:out/klipper.elf.hex:i
```
## Atmega1284p ##
This chip is commonly found in "Melzi" style 3d printer boards.
To flash the bootloader itself use something like:
```
wget 'https://github.com/Lauszus/Sanguino/raw/1.0.2/bootloaders/optiboot/optiboot_atmega1284p.hex'
avrdude -cavrispv2 -patmega1284p -P/dev/ttyACM0 -b115200 -e -u -U lock:w:0x3F:m -U efuse:w:0xFD:m -U hfuse:w:0xDE:m -U lfuse:w:0xFF:m
avrdude -cavrispv2 -patmega1284p -P/dev/ttyACM0 -b115200 -U flash:w:optiboot_atmega1284p.hex
avrdude -cavrispv2 -patmega1284p -P/dev/ttyACM0 -b115200 -U lock:w:0x0F:m
```
To flash an application use something like:
```
avrdude -carduino -patmega1284p -P/dev/ttyACM0 -b115200 -D -Uflash:w:out/klipper.elf.hex:i
```
Note that a number of "Melzi" style boards come preloaded with a
bootloader that uses a baud rate of 57600. In this case, to flash an
application use something like this instead:
```
avrdude -carduino -patmega1284p -P/dev/ttyACM0 -b57600 -D -Uflash:w:out/klipper.elf.hex:i
```
## At90usb1286 ##
This document does not cover the method to flash a bootloader to the
At90usb1286 nor does it cover general application flashing to this
device.
The Teensy++ device from pjrc.com comes with a proprietary bootloader.
It requires a custom flashing tool from
https://github.com/PaulStoffregen/teensy_loader_cli . One can flash an
application with it using something like:
```
teensy_loader_cli --mcu=at90usb1286 out/klipper.elf.hex -v
```
## Atmega168 ##
The atmega168 has limited flash space. If using a bootloader, it is
recommended to use the Optiboot bootloader. To flash that bootloader
use something like:
```
wget 'https://github.com/arduino/Arduino/raw/1.8.5/hardware/arduino/avr/bootloaders/optiboot/optiboot_atmega168.hex'
avrdude -cavrispv2 -patmega168 -P/dev/ttyACM0 -b115200 -e -u -U lock:w:0x3F:m -U efuse:w:0x04:m -U hfuse:w:0xDD:m -U lfuse:w:0xFF:m
avrdude -cavrispv2 -patmega168 -P/dev/ttyACM0 -b115200 -U flash:w:optiboot_atmega168.hex
avrdude -cavrispv2 -patmega168 -P/dev/ttyACM0 -b115200 -U lock:w:0x0F:m
```
To flash an application via the Optiboot bootloader use something
like:
```
avrdude -carduino -patmega168 -P/dev/ttyACM0 -b115200 -D -Uflash:w:out/klipper.elf.hex:i
```
SAM3 micro-controllers (Arduino Due)
====================================
It is not common to use a bootloader with the SAM3 mcu. The chip
itself has a ROM that allows the flash to be programmed from 3.3V
serial port or from USB.
To enable the ROM, the "erase" pin is held high during a reset, which
erases the flash contents, and causes the ROM to run. On an Arduino
Due, this sequence can be accomplished by setting a baud rate of 1200
on the "programming usb port" (the USB port closest to the power
supply).
The code at https://github.com/shumatech/BOSSA can be used to program
the SAM3. It is recommended to use version 1.9 or later.
To flash an application use something like:
```
bossac -U -p /dev/ttyACM0 -a -e -w out/klipper.bin -v -b
bossac -U -p /dev/ttyACM0 -R
```
SAM4 micro-controllers (Duet Wifi)
====================================
It is not common to use a bootloader with the SAM4 mcu. The chip
itself has a ROM that allows the flash to be programmed from 3.3V
serial port or from USB.
To enable the ROM, the "erase" pin is held high during a reset, which
erases the flash contents, and causes the ROM to run.
The code at https://github.com/shumatech/BOSSA can be used to program
the SAM4. It is necessary to use version `1.8.0` or higher.
To flash an application use something like:
```
bossac --port=/dev/ttyACM0 -b -U -e -w -v -R out/klipper.bin
```
SAMD21 micro-controllers (Arduino Zero)
=======================================
The SAMD21 bootloader is flashed via the ARM Serial Wire Debug (SWD)
interface. This is commonly done with a dedicated SWD hardware dongle.
Alternatively, it appears one can use a Raspberry Pi with OpenOCD as a
programmer (see:
https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi
).
Unfortunately, there are two common bootloaders deployed on the
SAMD21. One comes standard with the "Arduino Zero" and the other comes
standard with the "Arduino M0".
The Arduino Zero uses an 8KiB bootloader (the application must be
compiled with a start address of 8KiB). One can enter the bootloader
by double clicking the reset button. To flash an application use
something like:
```
bossac -U -p "$(FLASH_DEVICE)" --offset=0x2000 -w out/klipper.bin -v -b -R
```
The Arduino M0 uses a 16KiB bootloader (the application must be
compiled with a start address of 16KiB). To flash an application,
reset the micro-controller and run the flash command within the first
few seconds of boot - something like:
```
avrdude -c stk500v2 -p atmega2560 -P /dev/ttyACM0 -u -Uflash:w:out/klipper.elf.hex:i
```
STM32F103 micro-controllers (Blue Pill devices)
===============================================
The STM32F103 devices have a ROM that can flash a bootloader or
application via 3.3V serial. To access this ROM, one should connect
the "boot 0" pin to high and "boot 1" pin to low, and then reset the
device. The "stm32flash" package can then be used to flash the device
using something like:
```
stm32flash -w out/klipper.bin -v -g 0 /dev/ttyAMA0
```
Note that if one is using a Raspberry Pi for the 3.3V serial, the
stm32flash protocol uses a serial parity mode which the Raspberry Pi's
"miniuart" does not support. See
https://www.raspberrypi.org/documentation/configuration/uart.md for
details on enabling the full uart on the Raspberry Pi GPIO pins.
After flashing, set both "boot 0" and "boot 1" back to low so that
future resets boot from flash.
## STM32F103 with stm32duino bootloader ##
The "stm32duino" project has a USB capable bootloader - see:
https://github.com/rogerclarkmelbourne/STM32duino-bootloader
This bootloader can be flashed via 3.3V serial with something like:
```
wget 'https://github.com/rogerclarkmelbourne/STM32duino-bootloader/raw/master/binaries/generic_boot20_pc13.bin'
stm32flash -w generic_boot20_pc13.bin -v -g 0 /dev/ttyAMA0
```
This bootloader uses 8KiB of flash space (the application must be
compiled with a start address of 8KiB). Flash an application with
something like:
```
dfu-util -d 1eaf:0003 -a 2 -R -D out/klipper.bin
```
The bootloader typically runs for only a short period after boot. It
may be necessary to time the above command so that it runs while the
bootloader is still active (the bootloader will flash a board led
while it is running). Alternatively, set the "boot 0" pin to low and
"boot 1" pin to high to stay in the bootloader after a reset.
LPC176x micro-controllers (Smoothieboards)
==========================================
This document does not describe the method to flash a bootloader
itself - see: http://smoothieware.org/flashing-the-bootloader for
further information on that topic.
It is common for Smoothieboards to come with a bootloader from:
https://github.com/triffid/LPC17xx-DFU-Bootloader . When using this
bootloader the application must be compiled with a start address of
16KiB. The easiest way to flash an application with this bootloader is
to copy the application file (eg, `out/klipper.bin`) to a file named
`firmware.bin` on an SD card, and then to reboot the micro-controller
with that SD card.

38
docs/CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,38 @@
# Contributing to Klipper
Thank you for contributing to Klipper! Please take a moment to read
this document.
## Creating a new issue
Please see the [contact page](Contact.md) for information on creating
an issue. In particular, **we need the klippy.log file** attached to
bug reports. Also, be sure to read the [FAQ](FAQ.md) to see if a
similar issue has already been raised.
## Submitting a pull request
Contributions of Code and documentation are managed through github
pull requests. Each commit should have a commit message formatted
similar to the following:
```
module: Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 75
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Further paragraphs come after blank lines..
Signed-off-by: My Name <myemail@example.org>
```
It is important to have a "Signed-off-by" line on each commit - it
certifies that you agree to the
[developer certificate of origin](developer-certificate-of-origin). It
must contain your real name (sorry, no pseudonyms or anonymous
contributions) and contain a current email address.

View File

@@ -17,8 +17,11 @@ arranges for includes of "board/somefile.h" to first look in the
current architecture directory (eg, src/avr/somefile.h) and then in
the generic directory (eg, src/generic/somefile.h).
The **klippy/** directory contains the C and Python source for the
host part of the software.
The **klippy/** directory contains the host software. Most of the host
software is written in Python, however the **klippy/chelper/**
directory contains some C code helpers. The **klippy/kinematics/**
directory contains the robot kinematics code. The **klippy/extras/**
directory contains the host code extensible "modules".
The **lib/** directory contains external 3rd-party library code that
is necessary to build some targets.
@@ -29,6 +32,8 @@ files.
The **scripts/** directory contains build-time scripts useful for
compiling the micro-controller code.
The **test/** directory contains automated test cases.
During compilation, the build may create an **out/** directory. This
contains temporary build time objects. The final micro-controller
object that is built is **out/klipper.elf.hex** on AVR and
@@ -77,7 +82,7 @@ interrupts disabled.
Much of the functionality of the micro-controller involves working
with General-Purpose Input/Output pins (GPIO). In order to abstract
the low-level architecture specific code from the high-level task
code, all GPIO events are implemented in architectures specific
code, all GPIO events are implemented in architecture specific
wrappers (eg, **src/avr/gpio.c**). The code is compiled with gcc's
"-flto -fwhole-program" optimization which does an excellent job of
inlining functions across compilation units, so most of these tiny
@@ -103,9 +108,9 @@ DECL_COMMAND macro in the micro-controller code).
There are four threads in the Klippy host code. The main thread
handles incoming gcode commands. A second thread (which resides
entirely in the **klippy/serialqueue.c** C code) handles low-level IO
with the serial port. The third thread is used to process response
messages from the micro-controller in the Python code (see
entirely in the **klippy/chelper/serialqueue.c** C code) handles
low-level IO with the serial port. The third thread is used to process
response messages from the micro-controller in the Python code (see
**klippy/serialhdl.py**). The fourth thread writes debug messages to
the log (see **klippy/queuelogger.py**) so that the other threads
never block on log writes.
@@ -145,7 +150,7 @@ provides further information on the mechanics of moves.
zero duration.
* When Move.move() is called, everything about the move is known -
its start location, its end location, its acceleration, its
start/crusing/end velocity, and distance traveled during
start/cruising/end velocity, and distance traveled during
acceleration/cruising/deceleration. All the information is stored in
the Move() class and is in cartesian space in units of millimeters
and seconds.
@@ -155,56 +160,65 @@ provides further information on the mechanics of moves.
* The goal of the kinematics classes is to translate the movement in
cartesian space to movement on each stepper. The kinematics classes
are in cartesian.py, corexy.py, delta.py, and extruder.py. The
kinematic class is given a chance to audit the move
(`ToolHead.move() -> kin.check_move()`) before it goes on the
look-ahead queue, but once the move arrives in *kin*.move() the
kinematic class is required to handle the move as specified. The
kinematic classes translate the three parts of each move
(acceleration, constant "cruising" velocity, and deceleration) to
the associated movement on each stepper. Note that the extruder is
handled in its own kinematic class. Since the Move() class specifies
the exact movement time and since step pulses are sent to the
micro-controller with specific timing, stepper movements produced by
the extruder class will be in sync with head movement even though
the code is kept separate.
are located in the klippy/kinematics/ directory. The kinematic class
is given a chance to audit the move (`ToolHead.move() ->
kin.check_move()`) before it goes on the look-ahead queue, but once
the move arrives in *kin*.move() the kinematic class is required to
handle the move as specified. Note that the extruder is handled in
its own kinematic class. Since the Move() class specifies the exact
movement time and since step pulses are sent to the micro-controller
with specific timing, stepper movements produced by the extruder
class will be in sync with head movement even though the code is
kept separate.
* For efficiency reasons, the stepper pulse times are generated in C
code. The code flow is: `kin.move() -> MCU_Stepper.step_const() ->
stepcompress_push_const()`, or for delta kinematics:
`DeltaKinematics.move() -> MCU_Stepper.step_delta() ->
stepcompress_push_delta()`. The MCU_Stepper code just performs unit
and axis transformation (millimeters to step distances), and calls
the C code. The C code calculates the stepper step times for each
movement and fills an array (struct stepcompress.queue) with the
corresponding micro-controller clock counter times for every
step. Here the "micro-controller clock counter" value directly
corresponds to the micro-controller's hardware counter - it is
relative to when the micro-controller was last powered up.
* Klipper uses an
[iterative solver](https://en.wikipedia.org/wiki/Root-finding_algorithm)
to generate the step times for each stepper. For efficiency reasons,
the stepper pulse times are generated in C code. The code flow is:
`kin.move() -> MCU_Stepper.step_itersolve() ->
itersolve_gen_steps()` (in klippy/chelper/itersolve.c). The goal of
the iterative solver is to find step times given a function that
calculates a stepper position from a time. This is done by
repeatedly "guessing" various times until the stepper position
formula returns the desired position of the next step on the
stepper. The feedback produced from each guess is used to improve
future guesses so that the process rapidly converges to the desired
time. The kinematic stepper position formulas are located in the
klippy/chelper/ directory (eg, kin_cart.c, kin_corexy.c,
kin_delta.c, kin_extruder.c).
* After the iterative solver calculates the step times they are added
to an array: `itersolve_gen_steps() -> queue_append()` (in
klippy/chelper/stepcompress.c). The array (struct
stepcompress.queue) stores the corresponding micro-controller clock
counter times for every step. Here the "micro-controller clock
counter" value directly corresponds to the micro-controller's
hardware counter - it is relative to when the micro-controller was
last powered up.
* The next major step is to compress the steps: `stepcompress_flush()
-> compress_bisect_add()` (in stepcompress.c). This code generates
and encodes a series of micro-controller "queue_step" commands that
correspond to the list of stepper step times built in the previous
stage. These "queue_step" commands are then queued, prioritized, and
sent to the micro-controller (via stepcompress.c:steppersync and
serialqueue.c:serialqueue).
-> compress_bisect_add()` (in klippy/chelper/stepcompress.c). This
code generates and encodes a series of micro-controller "queue_step"
commands that correspond to the list of stepper step times built in
the previous stage. These "queue_step" commands are then queued,
prioritized, and sent to the micro-controller (via
stepcompress.c:steppersync and serialqueue.c:serialqueue).
* Processing of the queue_step commands on the micro-controller starts
in command.c which parses the command and calls
`command_queue_step()`. The command_queue_step() code (in stepper.c)
just appends the parameters of each queue_step command to a per
stepper queue. Under normal operation the queue_step command is
parsed and queued at least 100ms before the time of its first
step. Finally, the generation of stepper events is done in
`stepper_event()`. It's called from the hardware timer interrupt at
the scheduled time of the first step. The stepper_event() code
generates a step pulse and then reschedules itself to run at the
time of the next step pulse for the given queue_step parameters. The
parameters for each queue_step command are "interval", "count", and
"add". At a high-level, stepper_event() runs the following, 'count'
times: `do_step(); next_wake_time = last_wake_time + interval;
interval += add;`
in src/command.c which parses the command and calls
`command_queue_step()`. The command_queue_step() code (in
src/stepper.c) just appends the parameters of each queue_step
command to a per stepper queue. Under normal operation the
queue_step command is parsed and queued at least 100ms before the
time of its first step. Finally, the generation of stepper events is
done in `stepper_event()`. It's called from the hardware timer
interrupt at the scheduled time of the first step. The
stepper_event() code generates a step pulse and then reschedules
itself to run at the time of the next step pulse for the given
queue_step parameters. The parameters for each queue_step command
are "interval", "count", and "add". At a high-level, stepper_event()
runs the following, 'count' times: `do_step(); next_wake_time =
last_wake_time + interval; interval += add;`
The above may seem like a lot of complexity to execute a
movement. However, the only really interesting parts are in the
@@ -212,6 +226,169 @@ ToolHead and kinematic classes. It's this part of the code which
specifies the movements and their timings. The remaining parts of the
processing is mostly just communication and plumbing.
Adding a host module
====================
The Klippy host code has a dynamic module loading capability. If a
config section named "[my_module]" is found in the printer config file
then the software will automatically attempt to load the python module
klippy/extras/my_module.py . This module system is the preferred
method for adding new functionality to Klipper.
The easiest way to add a new module is to use an existing module as a
reference - see **klippy/extras/servo.py** as an example.
The following may also be useful:
* Execution of the module starts in the module level `load_config()`
function (for config sections of the form [my_module]) or in
`load_config_prefix()` (for config sections of the form
[my_module my_name]). This function is passed a "config" object and
it must return a new "printer object" associated with the given
config section.
* During the process of instantiating a new printer object, the config
object can be used to read parameters from the given config
section. This is done using `config.get()`, `config.getfloat()`,
`config.getint()`, etc. methods. Be sure to read all values from the
config during the construction of the printer object - if the user
specifies a config parameter that is not read during this phase then
it will be assumed it is a typo in the config and an error will be
raised.
* Use the `config.get_printer()` method to obtain a reference to the
main "printer" class. This "printer" class stores references to all
the "printer objects" that have been instantiated. Use the
`printer.lookup_object()` method to find references to other printer
objects. Almost all functionality (even core kinematic modules) are
encapsulated in one of these printer objects. Note, though, that
when a new module is instantiated, not all other printer objects
will have been instantiated. The "gcode" and "pins" modules will
always be available, but for other modules it is a good idea to
defer the lookup.
* Define a `printer_state()` method if the code needs to be called
during printer setup and/or shutdown. This method is called twice
during setup (with "connect" and then "ready") and may also be
called at run-time (with "shutdown" or "disconnect"). It is common
to perform "printer object" lookup during the "connect" and "ready"
phases.
* If there is an error in the user's config, be sure to raise it
during the `load_config()` or `printer_state("connect")` phases. Use
either `raise config.error("my error")` or `raise
printer.config_error("my error")` to report the error.
* Use the "pins" module to configure a pin on a micro-controller. This
is typically done with something similar to
`printer.lookup_object("pins").setup_pin("pwm",
config.get("my_pin"))`. The returned object can then be commanded at
run-time.
* If the module needs access to system timing or external file
descriptors then use `printer.get_reactor()` to obtain access to the
global "event reactor" class. This reactor class allows one to
schedule timers, wait for input on file descriptors, and to "sleep"
the host code.
* Do not use global variables. All state should be stored in the
printer object returned from the `load_config()` function. This is
important as otherwise the RESTART command may not perform as
expected. Also, for similar reasons, if any external files (or
sockets) are opened then be sure to close them from the
`printer_state("disconnect")` callback.
* Avoid accessing the internal member variables (or calling methods
that start with an underscore) of other printer objects. Observing
this convention makes it easier to manage future changes.
* If submitting the module for inclusion in the main Klipper code, be
sure to place a copyright notice at the top of the module. See the
existing modules for the preferred format.
Adding new kinematics
=====================
This section provides some tips on adding support to Klipper for
additional types of printer kinematics. This type of activity requires
excellent understanding of the math formulas for the target
kinematics. It also requires software development skills - though one
should only need to update the host software.
Useful steps:
1. Start by studying the
"[code flow of a move](#code-flow-of-a-move-command)" section and
the [Kinematics document](Kinematics.md).
2. Review the existing kinematic classes in the klippy/kinematics/
directory. The kinematic classes are tasked with converting a move
in cartesian coordinates to the movement on each stepper. One
should be able to copy one of these files as a starting point.
3. Implement the C stepper kinematic position functions for each
stepper if they are not already available (see kin_cart.c,
kin_corexy.c, and kin_delta.c in klippy/chelper/). The function
should call `move_get_coord()` to convert a given move time (in
seconds) to a cartesian coordinate (in millimeters), and then
calculate the desired stepper position (in millimeters) from that
cartesian coordinate.
4. Implement the `calc_position()` method in the new kinematics class.
This method calculates the position of the toolhead in cartesian
coordinates from the current position of each stepper. It does not
need to be efficient as it is typically only called during homing
and probing operations.
5. Other methods. Implement the `move()`, `check_move()`, `home()`,
`motor_off()`, `set_position()`, and `get_steppers()` methods.
These functions are typically used to provide kinematic specific
checks. However, at the start of development one can use
boiler-plate code here.
6. Implement test cases. Create a g-code file with a series of moves
that can test important cases for the given kinematics. Follow the
[debugging documentation](Debugging.md) to convert this g-code file
to micro-controller commands. This is useful to exercise corner
cases and to check for regressions.
Porting to a new micro-controller
=================================
This section provides some tips on porting Klipper's micro-controller
code to a new architecture. This type of activity requires good
knowledge of embedded development and hands-on access to the target
micro-controller.
Useful steps:
1. Start by identifying any 3rd party libraries that will be used
during the port. Common examples include "CMSIS" wrappers and
manufacturer "HAL" libraries. All 3rd party code needs to be GNU
GPLv3 compatible. The 3rd party code should be committed to the
Klipper lib/ directory. Update the lib/README file with information
on where and when the library was obtained. It is preferable to
copy the code into the Klipper repository unchanged, but if any
changes are required then those changes should be listed explicitly
in the lib/README file.
2. Create a new architecture sub-directory in the src/ directory and
add initial Kconfig and Makefile support. Use the existing
architectures as a guide. The src/simulator provides a basic
example of a minimum starting point.
3. The first main coding task is to bring up communication support to
the target board. This is the most difficult step in a new port.
Once basic communication is working, the remaining steps tend to be
much easier. It is typical to use an RS-232 style serial port
during initial development as these types of hardware devices are
generally easier to enable and control. During this phase, make
liberal use of helper code from the src/generic/ directory (check
how src/simulator/Makefile includes the generic C code into the
build). It is also necessary to define timer_read_time() (which
returns the current system clock) in this phase, but it is not
necessary to fully support timer irq handling.
4. Get familiar with the the console.py tool (as described in the
[debugging document](Debugging.md)) and verify connectivity to the
micro-controller with it. This tool translates the low-level
micro-controller communication protocol to a human readable form.
5. Add support for timer dispatch from hardware interrupts. See
Klipper
[commit 970831ee](https://github.com/KevinOConnor/klipper/commit/970831ee0d3b91897196e92270d98b2a3067427f)
as an example of steps 1-5 done for the LPC176x architecture.
6. Bring up basic GPIO input and output support. See Klipper
[commit c78b9076](https://github.com/KevinOConnor/klipper/commit/c78b90767f19c9e8510c3155b89fb7ad64ca3c54)
as an example of this.
7. Bring up additional peripherals - for example see Klipper commit
[65613aed](https://github.com/KevinOConnor/klipper/commit/65613aeddfb9ef86905cb1dade9e773a02ef3c27),
[c812a40a](https://github.com/KevinOConnor/klipper/commit/c812a40a3782415e454b04bf7bd2158a6f0ec8b5),
and
[c381d03a](https://github.com/KevinOConnor/klipper/commit/c381d03aad5c3ee761169b7c7bced519cc14da29).
8. Create a sample Klipper config file in the config/ directory. Test
the micro-controller with the main klippy.py program.
9. Consider adding build test cases in the test/ directory.
Time
====
@@ -266,8 +443,8 @@ Some things to be aware of when reviewing the code:
conversion is never ambiguous. The host converts from 64bit clocks
to 32bit clocks by simply truncating the high-order bits. To ensure
there is no ambiguity in this conversion, the
**klippy/serialqueue.c** code will buffer messages until they are
within 2^31 clock ticks of their target time.
**klippy/chelper/serialqueue.c** code will buffer messages until
they are within 2^31 clock ticks of their target time.
* Multiple micro-controllers: The host software supports using
multiple micro-controllers on a single printer. In this case, the
"MCU clock" of each micro-controller is tracked separately. The

167
docs/Config_checks.md Normal file
View File

@@ -0,0 +1,167 @@
This document provides a list of steps to help confirm the pin
settings in the Klipper printer.cfg file. It is a good idea to run
through these steps after following the steps in the
[installation document](Installation.md).
During this guide, it may be necessary to make changes to the Klipper
config file. Be sure to issue a RESTART command after every change to
the config file to ensure that the change takes effect (type "restart"
in the Octoprint terminal tab and then click "Send"). It's also a good
idea to issue a STATUS command after every RESTART to verify that the
config file is successfully loaded.
### Verify temperature
Start by verifying that temperatures are being properly
reported. Navigate to the Octoprint temperature tab.
![octoprint-temperature](img/octoprint-temperature.png)
Verify that the temperature of the nozzle and bed (if applicable) are
present and not increasing. If it is increasing, remove power from the
printer. If the temperatures are not accurate, review the
"sensor_type" and "sensor_pin" settings for the nozzle and/or bed.
### Verify M112
Navigate to the Octoprint terminal tab and issue an M112 command in
the terminal box. This command requests Klipper to go into a
"shutdown" state. It will cause Octoprint to disconnect from Klipper -
navigate to the Connection area and click on "Connect" to cause
Octoprint to reconnect. Then navigate to the Octoprint temperature tab
and verify that temperatures continue to update and the temperatures
are not increasing. If temperatures are increasing, remove power from
the printer.
The M112 command causes Klipper to go into a "shutdown" state. To
clear this state, issue a FIRMWARE_RESTART command in the Octoprint
terminal tab.
### Verify heaters
Navigate to the Octoprint temperature tab and type in 50 followed by
enter in the "Tool" temperature box. The extruder temperature in the
graph should start to increase (within about 30 seconds or so). Then
go to the "Tool" temperature drop-down box and select "Off". After
several minutes the temperature should start to return to its initial
room temperature value. If the temperature does not increase then
verify the "heater_pin" setting in the config.
If the printer has a heated bed then perform the above test again with
the bed.
### Verify stepper motor enable pin
Verify that all of the printer axes can manually move freely (the
stepper motors are disabled). If not, issue an M84 command to disable
the motors. If any of the axes still can not move freely, then verify
the stepper "enable_pin" configuration for the given axis. On most
commodity stepper motor drivers, the motor enable pin is "active low"
and therefore the enable pin should have a "!" before the pin (for
example, "enable_pin: !ar38").
### Verify endstops
Manually move all the printer axes so that none of them are in contact
with an endstop. Send a QUERY_ENDSTOPS command via the Octoprint
terminal tab. It should respond with the current state of all of the
configured endstops and they should all report a state of "open". For
each of the endstops, rerun the QUERY_ENDSTOPS command while manually
triggering the endstop. The QUERY_ENDSTOPS command should report the
endstop as "TRIGGERED".
If the endstop appears inverted (it reports "open" when triggered and
vice-versa) then add a "!" to the pin definition (for example,
"endstop_pin: ^!ar3"), or remove the "!" if there is already one
present.
If the endstop does not change at all then it generally indicates that
the endstop is connected to a different pin. However, it may also
require a change to the pullup setting of the pin (the '^' at the
start of the endstop_pin name - most printers will use a pullup
resistor and the '^' should be present).
### Verify stepper motors
Use the STEPPER_BUZZ command to verify the connectivity of each
stepper motor. Start by manually positioning the given axis to a
midway point and then run `STEPPER_BUZZ STEPPER=stepper_x` . The
STEPPER_BUZZ command will cause the given stepper to move one
millimeter in a positive direction and then it will return to its
starting position. (If the endstop is defined at position_endstop=0
then at the start of each movement the stepper will move away from the
endstop.) It will perform this oscillation ten times.
If the stepper does not move at all, then verify the "enable_pin" and
"step_pin" settings for the stepper. If the stepper motor moves but
does not return to its original position then verify the "dir_pin"
setting. If the stepper motor oscillates in an incorrect direction,
then it generally indicates that the "dir_pin" for the axis needs to
be inverted. This is done by adding a '!' to the "dir_pin" in the
printer config file (or removing it if one is already there). If the
motor moves significantly more or significantly less than one
millimeter then verify the "step_distance" setting.
Run the above test for each stepper motor defined in the config
file. (Set the STEPPER parameter of the STEPPER_BUZZ command to the
name of the config section that is to be tested.) If there is no
filament in the extruder then one can use STEPPER_BUZZ to verify the
extruder motor connectivity (use STEPPER=extruder). Otherwise, it's
best to test the extruder motor separately (see the next section).
After verifying all endstops and verifying all stepper motors the
homing mechanism should be tested. Issue a G28 command to home all
axes. Remove power from the printer if it does not home properly.
Rerun the endstop and stepper motor verification steps if necessary.
### Verify extruder motor
To test the extruder motor it will be necessary to heat the extruder
to a printing temperature. Navigate to the Octoprint temperature tab
and select a target temperature from the temperature drop-down box (or
manually enter an appropriate temperature). Wait for the printer to
reach the desired temperature. Then navigate to the Octoprint control
tab and click the "Extrude" button. Verify that the extruder motor
turns in the correct direction. If it does not, see the
troubleshooting tips in the previous section to confirm the
"enable_pin", "step_pin", and "dir_pin" settings for the extruder.
### Calibrate PID settings
Klipper supports
[PID control](https://en.wikipedia.org/wiki/PID_controller) for the
extruder and bed heaters. In order to use this control mechanism it is
necessary to calibrate the PID settings on each printer. (PID settings
found in other firmwares or in the example configuration files often
work poorly.)
To calibrate the extruder, navigate to the OctoPrint terminal tab and
run the PID_CALIBRATE command. For example: `PID_CALIBRATE
HEATER=extruder TARGET=170`
At the completion of the tuning test run `SAVE_CONFIG` to update the
printer.cfg file the new PID settings.
If the printer has a heated bed and it supports being driven by PWM
(Pulse Width Modulation) then it is recommended to use PID control for
the bed. (When the bed heater is controlled using the PID algorithm it
may turn on and off ten times a second, which may not be suitable for
heaters using a mechanical switch.) A typical bed PID calibration
command is: `PID_CALIBRATE HEATER=heater_bed TARGET=60`
### Next steps
This guide is intended to help with basic verification of pin settings
in the Klipper configuration file. It may be necessary to perform
detailed printer calibration - a number of guides are available online
to help with this (for example, do a web search for "3d printer
calibration").
See the [Slicers](Slicers.md) document for information on configuring
a slicer with Klipper. If one is using traditional endstop switches
with Trinamic stepper motor drivers then see the
[Endstop Phase](Endstop_Phase.md) document. If using a delta printer,
see the [Delta Calibrate](Delta_Calibrate.md) document.
After one has verified that basic printing works, it is a good idea to
consider calibrating [pressure advance](Pressure_Advance.md).

View File

@@ -1,25 +1,35 @@
This page provides information on how to contact the Klipper
developers.
Bug reporting
=============
Issue reporting
===============
Bug reports are submitted through github issues. All bug reports must
It is very important to attach the Klipper log file to all
reports. The log file has been engineered to answer common questions
the Klipper developers have about the software and its environment
(software version, hardware type, configuration, event timing, and
hundreds of other questions). **The developers need the Klipper log
file to provide any meaningful assistance**; only this log file
provides the necessary information.
On a problem report the first step is to **issue an M112 command** in
the OctoPrint terminal window immediately after the undesirable event
occurs. This causes Klipper to go into a "shutdown state" and it will
cause additional debugging information to be written to the log file.
Issue requests are submitted through Github. **All Github issues must
include the full /tmp/klippy.log log file from the session that
produced the error. To acquire this log file, ssh into the computer
running the klipper host software, and run:
produced the event being reported.** An "scp" and/or "sftp" utility is
needed to acquire this log file. The "scp" utility comes standard with
Linux and MacOS desktops. There are freely available scp utilities for
other desktops (eg, WinSCP).
```
gzip -k /tmp/klippy.log
```
Then scp the resulting `/tmp/klippy.log.gz` file from the host machine
to your desktop. (If your desktop does not have scp installed, there
are a number of free scp programs available - just do a web search for
`windows scp` to find one.) Open a new issue at
https://github.com/KevinOConnor/klipper/issues , attach the
`klippy.log.gz` file to that issue, and provide a description of the
problem.
Use the scp utility to copy the `/tmp/klippy.log` file from the
Raspberry Pi to your desktop. It is a good idea to compress the
klippy.log file before posting it (eg, using zip or gzip). Open a new
issue at https://github.com/KevinOConnor/klipper/issues , provide a
description of the problem, and **attach the `klippy.log` file to the
issue**: ![attach-issue](img/attach-issue.png)
Mailing list
============

274
docs/Debugging.md Normal file → Executable file
View File

@@ -115,17 +115,20 @@ gtkwave avrsim.vcd
```
Manually sending commands to the micro-controller
-------------------------------------------------
=================================================
Normally, Klippy would be used to translate gcode commands to Klipper
commands. However, it's also possible to manually send Klipper
commands (functions marked with the DECL_COMMAND() macro in the
Klipper source code). To do so, run:
Normally, the host klippy.py process would be used to translate gcode
commands to Klipper micro-controller commands. However, it's also
possible to manually send these MCU commands (functions marked with
the DECL_COMMAND() macro in the Klipper source code). To do so, run:
```
~/klippy-env/bin/python ./klippy/console.py /tmp/pseudoserial 250000
```
See the "HELP" command within the tool for more information on its
functionality.
Generating load graphs
======================
@@ -148,3 +151,264 @@ Then graphs can be produced with:
```
One can then view the resulting **loadgraph.png** file.
Extracting information from the klippy.log file
===============================================
The Klippy log file (/tmp/klippy.log) also contains debugging
information. There is a logextract.py script that may be useful when
analyzing a micro-controller shutdown or similar problem. It is
typically run with something like:
```
mkdir work_directory
cd work_directory
cp /tmp/klippy.log .
~/klipper/scripts/logextract.py ./klippy.log
```
The script will extract the printer config file and will extract MCU
shutdown information. The information dumps from an MCU shutdown (if
present) will be reordered by timestamp to assist in diagnosing cause
and effect scenarios.
Micro-controller Benchmarks
===========================
This section describes the mechanism used to generate the Klipper
micro-controller step rate benchmarks.
The primary goal of the benchmarks is to provide a consistent
mechanism for measuring the impact of coding changes within the
software. A secondary goal is to provide high-level metrics for
comparing the performance between chips and between software
platforms.
The step rate benchmark is designed to find the maximum stepping rate
that the hardware and software can reach. This benchmark stepping rate
is not achievable in day-to-day use as Klipper needs to perform other
tasks (eg, mcu/host communication, temperature reading, endstop
checking) in any real-world usage.
In general, the pins for the benchmark tests are chosen to flash LEDs
or other innocuous pins. **Always verify that it is safe to drive the
configured pins prior to running a benchmark.** It is not recommended
to drive an actual stepper during a benchmark.
## Step rate benchmark test ##
The test is performed using the console.py tool (described above). The
micro-controller is configured for the particular hardware platform
(see below) and then the following is cut-and-paste into the
console.py terminal window:
```
SET start_clock {clock+freq}
SET ticks 1000
reset_step_clock oid=0 clock={start_clock}
set_next_step_dir oid=0 dir=0
queue_step oid=0 interval={ticks} count=60000 add=0
set_next_step_dir oid=0 dir=1
queue_step oid=0 interval=3000 count=1 add=0
reset_step_clock oid=1 clock={start_clock}
set_next_step_dir oid=1 dir=0
queue_step oid=1 interval={ticks} count=60000 add=0
set_next_step_dir oid=1 dir=1
queue_step oid=1 interval=3000 count=1 add=0
reset_step_clock oid=2 clock={start_clock}
set_next_step_dir oid=2 dir=0
queue_step oid=2 interval={ticks} count=60000 add=0
set_next_step_dir oid=2 dir=1
queue_step oid=2 interval=3000 count=1 add=0
```
The above tests three steppers simultaneously stepping. If running the
above results in a "Rescheduled timer in the past" or "Stepper too far
in past" error then it indicates the `ticks` parameter is too low (it
results in a stepping rate that is too fast). The goal is to find the
lowest setting of the ticks parameter that reliably results in a
successful completion of the test. It should be possible to bisect the
ticks parameter until a stable value is found.
On a failure, one can copy-and-paste the following to clear the error
in preparation for the next test:
```
clear_shutdown
```
To obtain the single stepper and dual stepper benchmarks, the same
configuration sequence is used, but only the first block (for the
single stepper case) or first two blocks (for the dual stepper case)
of the above test is cut-and-paste into the console.py window.
To produce the benchmarks found in the Features.md document, the total
number of steps per second is calculated by multiplying the number of
active steppers with the nominal mcu frequency and dividing by the
final ticks parameter. The results are rounded to the nearest K. For
example, with three active steppers:
```
ECHO Test result is: {"%.0fK" % (3. * freq / ticks / 1000.)}
```
### AVR step rate benchmark ###
The following configuration sequence is used on AVR chips:
```
PINS arduino
allocate_oids count=3
config_stepper oid=0 step_pin=ar29 dir_pin=ar28 min_stop_interval=0 invert_step=0
config_stepper oid=1 step_pin=ar27 dir_pin=ar26 min_stop_interval=0 invert_step=0
config_stepper oid=2 step_pin=ar23 dir_pin=ar22 min_stop_interval=0 invert_step=0
finalize_config crc=0
```
The test was last run on commit `b161a69e` with gcc version `avr-gcc
(GCC) 4.8.1`. Both the 16Mhz and 20Mhz tests were run using simulavr
configured for an atmega644p (previous tests have confirmed simulavr
results match tests on both a 16Mhz at90usb and a 16Mhz atmega2560).
On both 16Mhz and 20Mhz the best single stepper result is `SET ticks
106`, the best dual stepper result is `SET ticks 276`, and the best
three stepper result is `SET ticks 481`.
### Arduino Due step rate benchmark ###
The following configuration sequence is used on the Due:
```
allocate_oids count=3
config_stepper oid=0 step_pin=PB27 dir_pin=PA21 min_stop_interval=0 invert_step=0
config_stepper oid=1 step_pin=PB26 dir_pin=PC30 min_stop_interval=0 invert_step=0
config_stepper oid=2 step_pin=PA21 dir_pin=PC30 min_stop_interval=0 invert_step=0
finalize_config crc=0
```
The test was last run on commit `b161a69e` with gcc version
`arm-none-eabi-gcc (Fedora 7.1.0-5.fc27) 7.1.0`. The best single
stepper result is `SET ticks 207`, the best dual stepper result is
`SET ticks 205`, and the best three stepper result is `SET ticks 317`.
### Duet Wifi step rate benchmark ###
The following configuration sequence is used on the Duet Wifi:
```
allocate_oids count=3
config_stepper oid=0 step_pin=PD6 dir_pin=PD11 min_stop_interval=0 invert_step=0
config_stepper oid=1 step_pin=PD7 dir_pin=PD12 min_stop_interval=0 invert_step=0
config_stepper oid=2 step_pin=PD8 dir_pin=PD13 min_stop_interval=0 invert_step=0
finalize_config crc=0
```
The test was last run on commit `34c3cb5c` with gcc version
`arm-none-eabi-gcc (15:5.4.1+svn241155-1) 5.4.1 20160919`. The best
single stepper result is `SET ticks 295`, the best dual stepper result
is `SET ticks 264`, and the best three stepper result is `SET ticks
282`.
### Beaglebone PRU step rate benchmark ###
The following configuration sequence is used on the PRU:
```
PINS beaglebone
allocate_oids count=3
config_stepper oid=0 step_pin=P8_13 dir_pin=P8_12 min_stop_interval=0 invert_step=0
config_stepper oid=1 step_pin=P8_15 dir_pin=P8_14 min_stop_interval=0 invert_step=0
config_stepper oid=2 step_pin=P8_19 dir_pin=P8_18 min_stop_interval=0 invert_step=0
finalize_config crc=0
```
The test was last run on commit `b161a69e` with gcc version `pru-gcc
(GCC) 8.0.0 20170530 (experimental)`. The best single stepper result
is `SET ticks 861`, the best dual stepper result is `SET ticks 853`,
and the best three stepper result is `SET ticks 883`.
### STM32F103 step rate benchmark ###
The following configuration sequence is used on the STM32F103:
```
allocate_oids count=3
config_stepper oid=0 step_pin=PC13 dir_pin=PB5 min_stop_interval=0 invert_step=0
config_stepper oid=1 step_pin=PB3 dir_pin=PB6 min_stop_interval=0 invert_step=0
config_stepper oid=2 step_pin=PA4 dir_pin=PB7 min_stop_interval=0 invert_step=0
finalize_config crc=0
```
The test was last run on commit `b161a69e` with gcc version
`arm-none-eabi-gcc (Fedora 7.1.0-5.fc27) 7.1.0`. The best single
stepper result is `SET ticks 41`, the best dual stepper result is `SET
ticks 48`, and the best three stepper result is `SET ticks 80`.
### LPC176x step rate benchmark ###
The following configuration sequence is used on the LPC176x:
```
allocate_oids count=3
config_stepper oid=0 step_pin=P1.20 dir_pin=P1.18 min_stop_interval=0 invert_step=0
config_stepper oid=1 step_pin=P1.21 dir_pin=P1.18 min_stop_interval=0 invert_step=0
config_stepper oid=2 step_pin=P1.23 dir_pin=P1.18 min_stop_interval=0 invert_step=0
finalize_config crc=0
```
The test was last run on commit `b161a69e` with gcc version
`arm-none-eabi-gcc (Fedora 7.1.0-5.fc27) 7.1.0`. For the 100Mhz
LPC1768, the best single stepper result is `SET ticks 119`, the best
dual stepper result is `SET ticks 118`, and the best three stepper
result is `SET ticks 154`. The 120Mhz LPC1769 results were obtained by
overclocking an LPC1768 to 120Mhz - the best single stepper result is
`SET ticks 140`, the best dual stepper result is `SET ticks 137`, and
the best three stepper result is `SET ticks 154`.
### SAMD21 step rate benchmark ###
The following configuration sequence is used on the SAMD21:
```
allocate_oids count=3
config_stepper oid=0 step_pin=PA27 dir_pin=PA20 min_stop_interval=0 invert_step=0
config_stepper oid=1 step_pin=PB3 dir_pin=PA21 min_stop_interval=0 invert_step=0
config_stepper oid=2 step_pin=PA17 dir_pin=PA21 min_stop_interval=0 invert_step=0
finalize_config crc=0
```
The test was last run on commit `b161a69e` with gcc version
`arm-none-eabi-gcc (Fedora 7.1.0-5.fc27) 7.1.0`. The best single
stepper result is `SET ticks 277`, the best dual stepper result is
`SET ticks 410`, and the best three stepper result is `SET ticks 664`.
## Command dispatch benchmark ##
The command dispatch benchmark tests how many "dummy" commands the
micro-controller can process. It is primarily a test of the hardware
communication mechanism. The test is run using the console.py tool
(described above). The following is cut-and-paste into the console.py
terminal window:
```
DELAY {clock+freq} get_uptime
FLOOD 100000 0.0 end_group
get_uptime
```
When the test completes, determine the difference between the clocks
reported in the two "uptime" response messages. The total number of
commands per second is then `100000 * mcu_frequency / clock_diff`.
| MCU | Rate | Build | Build compiler |
| ------------------- | ---- | -------- | ------------------- |
| atmega2560 (serial) | 23K | b161a69e | avr-gcc (GCC) 4.8.1 |
| at90usb1286 (USB) | 75K | b161a69e | avr-gcc (GCC) 4.8.1 |
| sam3x8e (serial) | 23K | b161a69e | arm-none-eabi-gcc (Fedora 7.1.0-5.fc27) 7.1.0 |
| pru (shared memory) | 5K | b161a69e | pru-gcc (GCC) 8.0.0 20170530 (experimental) |
| stm32f103 (USB) | 335K | b161a69e | arm-none-eabi-gcc (Fedora 7.1.0-5.fc27) 7.1.0 |
| lpc1768 (USB) | 546K | b161a69e | arm-none-eabi-gcc (Fedora 7.1.0-5.fc27) 7.1.0 |
| lpc1769 (USB) | 619K | b161a69e | arm-none-eabi-gcc (Fedora 7.1.0-5.fc27) 7.1.0 |
| samd21 (USB) | 238K | b161a69e | arm-none-eabi-gcc (Fedora 7.1.0-5.fc27) 7.1.0 |
Host Benchmarks
===============
It is possible to run timing tests on the host software using the
"batch mode" processing mechanism described above. This is typically
done by choosing a large and complex G-Code file and timing how long
it takes for the host software to process it. For example:
```
time ~/klippy-env/bin/python ./klippy/klippy.py config/example.cfg -i something_complex.gcode -o /dev/null -d out/klipper.dict
```

213
docs/Delta_Calibrate.md Normal file
View File

@@ -0,0 +1,213 @@
This document describes Klipper's automatic calibration system for
"delta" style printers.
Delta calibration involves finding the tower endstop positions, tower
angles, delta radius, and delta arm lengths. These settings control
printer motion on a delta printer. Each one of these parameters has a
non-obvious and non-linear impact and it is difficult to calibrate
them manually. In contrast, the software calibration code can provide
excellent results with just a few minutes of time. No special probing
hardware is necessary to get good results.
Basic delta calibration
=======================
Klipper has a DELTA_CALIBRATE command that can perform basic delta
calibration. This command probes seven different points on the bed and
calculates new values for the tower angles, tower endstops, and delta
radius.
In order to perform this calibration the initial delta parameters (arm
lengths, radius, and endstop positions) must be provided and they
should have an accuracy to within a few millimeters. Most delta
printer kits will provide these parameters - configure the printer
with these initial defaults and then go on to run the DELTA_CALIBRATE
command as described below. If no defaults are available then search
online for a delta calibration guide that can provide a basic starting
point.
During the delta calibration process it may be necessary for the
printer to probe below what would otherwise be considered the plane of
the bed. It is typical to permit this during calibration by updating
the config so that the printer's `minimum_z_position=-5`. (Once
calibration completes, one can remove this setting from the config.)
There are two ways to perform the probing - manual probing and
automatic probing. Automatic probing utilizes a hardware device
capable of triggering when the toolhead is at a set distance from the
bed. Manual probing involves using the "paper test" to determine the
height at each probe point. It is recommended to use manual probing
for delta calibration. A number of common printer kits come with
probes that are not sufficiently accurate (specifically, small
differences in arm length can cause effector tilt which can skew an
automatic probe). Manual probing only takes a few minutes and it
eliminates error introduced by the probe.
To perform the basic probe, make sure the config has a
[delta_calibrate] section defined and run:
```
G28
DELTA_CALIBRATE METHOD=manual
```
After probing the seven points new delta parameters will be
calculated. Save and apply these parameters by running:
```
SAVE_CONFIG
```
The basic calibration should provide delta parameters that are
accurate enough for basic printing. If this is a new printer, this is
a good time to print some basic objects and verify general
functionality.
Enhanced delta calibration
==========================
The basic delta calibration generally does a good job of calculating
delta parameters such that the nozzle is the correct distance from the
bed. However, it does not attempt to calibrate X and Y dimensional
accuracy. It's a good idea to perform an enhanced delta calibration to
verify dimensional accuracy.
This calibration procedure requires printing a test object and
measuring parts of that test object with digital calipers.
Prior to running an enhanced delta calibration one must run the basic
delta calibration (via the DELTA_CALIBRATE command) and save the
results (via the SAVE_CONFIG command).
Use a slicer to generate G-Code from the
[docs/prints/calibrate_size.stl](prints/calibrate_size.stl) file.
Slice the object using a slow speed (eg, 40mm/s). If possible, use a
stiff plastic (such as PLA) for the object. The object has a diameter
of 140mm. If this is too large for the printer then one can scale it
down (but be sure to uniformly scale both the X and Y axes). If the
printer supports significantly larger prints then this object can also
be increased in size. A larger size can improve the measurement
accuracy, but good print adhesion is more important than a larger
print size.
Print the test object and wait for it to fully cool. The commands
described below must be run with the same printer settings used to
print the calibration object (don't run DELTA_CALIBRATE between
printing and measuring, or do something that would otherwise change
the printer configuration).
If possible, perform the measurements described below while the object
is still attached to the print bed, but don't worry if the part
detaches from the bed - just try to avoid bending the object when
performing the measurements.
Start by measuring the distance between the center pillar and the
pillar next to the "A" label (which should also be pointing towards
the "A" tower).
![delta-a-distance](img/delta-a-distance.jpg)
Then go counterclockwise and measure the distances between the center
pillar and the other pillars (distance from center to pillar across
from C label, distance from center to pillar with B label, etc.).
![delta_cal_e_step1](img/delta_cal_e_step1.png)
Enter these parameters into Klipper with a comma separated list of
floating point numbers:
```
DELTA_ANALYZE CENTER_DISTS=<a_dist>,<far_c_dist>,<b_dist>,<far_a_dist>,<c_dist>,<far_b_dist>
```
Provide the values without spaces between them.
Then measure the distance between the A pillar and the pillar across
from the C label.
![delta-ab-distance](img/delta-outer-distance.jpg)
Then go counterclockwise and measure the distance between the pillar
across from C to the B pillar, the distance between the B pillar and
the pillar across from A, and so on.
![delta_cal_e_step2](img/delta_cal_e_step2.png)
Enter these parameters into Klipper:
```
DELTA_ANALYZE OUTER_DISTS=<a_to_far_c>,<far_c_to_b>,<b_to_far_a>,<far_a_to_c>,<c_to_far_b>,<far_b_to_a>
```
At this point it is okay to remove the object from the bed. The final
measurements are of the pillars themselves. Measure the size of the
center pillar along the A spoke, then the B spoke, and then the C
spoke.
![delta-a-pillar](img/delta-a-pillar.jpg)
![delta_cal_e_step3](img/delta_cal_e_step3.png)
Enter them into Klipper:
```
DELTA_ANALYZE CENTER_PILLAR_WIDTHS=<a>,<b>,<c>
```
The final measurements are of the outer pillars. Start by measuring
the distance of the A pillar along the line from A to the pillar
across from C.
![delta-ab-pillar](img/delta-outer-pillar.jpg)
Then go counterclockwise and measure the remaining outer pillars
(pillar across from C along the line to B, B pillar along the line to
pillar across from A, etc.).
![delta_cal_e_step4](img/delta_cal_e_step4.png)
And enter them into Klipper:
```
DELTA_ANALYZE OUTER_PILLAR_WIDTHS=<a>,<far_c>,<b>,<far_a>,<c>,<far_b>
```
If the object was scaled to a smaller or larger size then provide the
scale factor that was used when slicing the object:
```
DELTA_ANALYZE SCALE=1.0
```
(A scale value of 2.0 would mean the object is twice its original
size, 0.5 would be half its original size.)
Finally, perform the enhanced delta calibration by running:
```
DELTA_ANALYZE CALIBRATE=extended
```
This command can take several minutes to complete. After completion it
will calculate updated delta parameters (delta radius, tower angles,
endstop positions, and arm lengths). Use the SAVE_CONFIG command to
save and apply the settings:
```
SAVE_CONFIG
```
The SAVE_CONFIG command will save both the updated delta parameters
and information from the distance measurements. Future DELTA_CALIBRATE
commands will also utilize this distance information. Do not attempt
to reenter the raw distance measurements after running SAVE_CONFIG, as
this command changes the printer configuration and the raw
measurements no longer apply.
Additional notes
----------------
* If the delta printer has good dimensional accuracy then the distance
between any two pillars should be around 74mm and the width of every
pillar should be around 9mm. (Specifically, the goal is for the
distance between any two pillars minus the width of one of the
pillars to be exactly 65mm.) Should there be a dimensional
inaccuracy in the part then the DELTA_ANALYZE routine will calculate
new delta parameters using both the distance measurements and the
previous height measurements from the last DELTA_CALIBRATE command.
* DELTA_ANALYZE may produce delta parameters that are surprising. For
example, it may suggest arm lengths that do not match the printer's
actual arm lengths. Despite this, testing has shown that
DELTA_ANALYZE often produces superior results. It is believed that
the calculated delta parameters are able to account for slight
errors elsewhere in the hardware. For example, small differences in
arm length may result in a tilt to the effector and some of that
tilt may be accounted for by adjusting the arm length parameters.

125
docs/Endstop_Phase.md Normal file
View File

@@ -0,0 +1,125 @@
This document describes Klipper's stepper phase adjusted endstop
system. This functionality can improve the accuracy of traditional
endstop switches. It is most useful when using a Trinamic stepper
motor driver that has run-time configuration.
A typical endstop switch has an accuracy of around 100 microns. (Each
time an axis is homed the switch may trigger slightly earlier or
slightly later.) Although this is a relatively small error, it can
result in unwanted artifacts. In particular, this positional deviation
may be noticeable when printing the first layer of an object. In
contrast, typical stepper motors can obtain significantly higher
precision.
The stepper phase adjusted endstop mechanism can use the precision of
the stepper motors to improve the precision of the endstop switches.
When a stepper motor moves it cycles through a series of phases until
in completes four "full steps". So, a stepper motor using 16
micro-steps would have 64 phases and when moving in a positive
direction it would cycle through phases: 0, 1, 2, ... 61, 62, 63, 0,
1, 2, etc. Crucially, when the stepper motor is at a particular
position on a linear rail it should always be at the same stepper
phase. Thus, when a carriage triggers the endstop switch the stepper
controlling that carriage should always be at the same stepper motor
phase. Klipper's endstop phase system combines the stepper phase with
the endstop trigger to improve the accuracy of the endstop.
In order to use this functionality it is necessary to be able to
identify the phase of the stepper motor. If one is using Trinamic
TMC2130, TMC2208, TMC2224 or TMC2660 drivers in run-time configuration
mode (ie, not stand-alone mode) then Klipper can query the stepper
phase from the driver. (It is also possible to use this system on
traditional stepper drivers if one can reliably reset the stepper
drivers - see below for details.)
Calibrating endstop phases
==========================
If using Trinamic stepper motor drivers with run-time configuration
then one can calibrate the endstop phases using the
ENDSTOP_PHASE_CALIBRATE command. Start by adding the following to the
config file:
```
[endstop_phase]
```
Then RESTART the printer and run a `G28` command followed by an
`ENDSTOP_PHASE_CALIBRATE` command. Then move the toolhead to a new
location and run `G28` again. Try moving the toolhead to several
different locations and rerun `G28` from each position. Run at least
five `G28` commands.
After performing the above, the `ENDSTOP_PHASE_CALIBRATE` command will
often report the same (or nearly the same) phase for the stepper. This
phase can be saved in the config file so that all future G28 commands
use that phase. (So, in future homing operations, Klipper will obtain
the same position even if the endstop triggers a little earlier or a
little later.)
To save the endstop phase for a particular stepper motor, run
something like the following:
```
ENDSTOP_PHASE_CALIBRATE STEPPER=stepper_z
```
Run the above for all the steppers one wishes to save. Typically, one
would use this on stepper_z for cartesian and corexy printers, and for
stepper_a, stepper_b, and stepper_c on delta printers. Finally, run
the following to update the configuration file with the data:
```
SAVE_CONFIG
```
Additional notes
----------------
* This feature is most useful on delta printers and on the Z endstop
of cartesian/corexy printers. It is possible to use this feature on
the XY endstops of cartesian printers, but that isn't particularly
useful as a minor error in X/Y endstop position is unlikely to
impact print quality. It is not valid to use this feature on the XY
endstops of corexy printers (as the XY position is not determined by
a single stepper on corexy kinematics). It is not valid to use this
feature on a printer using a "probe:z_virtual_endstop" Z endstop (as
the stepper phase is only stable if the endstop is at a static
location on a rail).
* After calibrating the endstop phase, if the endstop is later moved
or adjusted then it will be necessary to recalibrate the endstop.
Remove the calibration data from the config file and rerun the steps
above.
* In order to use this system the endstop must be accurate enough to
identify the stepper position within two "full steps". So, for
example, if a stepper is using 16 micro-steps with a step distance
of 0.005mm then the endstop must have an accuracy of at least
0.160mm. If one gets "Endstop stepper_z incorrect phase" type error
messages than in may be due to an endstop that is not sufficiently
accurate. If recalibration does not help then disable endstop phase
adjustments by removing them from the config file.
* If one is using a traditional stepper controlled Z axis (as on a
cartesian or corexy printer) along with traditional bed leveling
screws then it is also possible to use this system to arrange for
each print layer to be performed on a "full step" boundary. To
enable this feature be sure the G-Code slicer is configured with a
layer height that is a multiple of a "full step", manually enable
the endstop_align_zero option in the endstop_phase config section
(see config/example-extras.cfg for further details), and then
re-level the bed screws.
* It is possible to use this system with traditional (non-Trinamic)
stepper motor drivers. However, doing this requires making sure that
the stepper motor drivers are reset every time the micro-controller
is reset. (If the two are always reset together then Klipper can
determine the stepper phase by tracking the total number of steps it
has commanded the stepper to move.) Currently, the only way to do
this reliably is if both the micro-controller and stepper motor
drivers are powered solely from USB and that USB power is provided
from a host running on a Raspberry Pi. In this situation one can
specify an mcu config with "restart_method: rpi_usb" - that option
will arrange for the micro-controller to always be reset via a USB
power reset, which would arrange for both the micro-controller and
stepper motor drivers to be reset together. If using this mechanism,
one would then need to manually configure the "endstop_phase" config
sections (see config/example-extras.cfg for the details).

381
docs/FAQ.md Normal file
View File

@@ -0,0 +1,381 @@
Frequently asked questions
==========================
1. [How can I donate to the project?](#how-can-i-donate-to-the-project)
2. [How do I calculate the step_distance parameter in the printer config file?](#how-do-i-calculate-the-step_distance-parameter-in-the-printer-config-file)
3. [Where's my serial port?](#wheres-my-serial-port)
4. [When the micro-controller restarts the device changes to /dev/ttyUSB1](#when-the-micro-controller-restarts-the-device-changes-to-devttyusb1)
5. [The "make flash" command doesn't work](#the-make-flash-command-doesnt-work)
6. [How do I change the serial baud rate?](#how-do-i-change-the-serial-baud-rate)
7. [Can I run Klipper on something other than a Raspberry Pi 3?](#can-i-run-klipper-on-something-other-than-a-raspberry-pi-3)
8. [Why can't I move the stepper before homing the printer?](#why-cant-i-move-the-stepper-before-homing-the-printer)
9. [Why is the Z position_endstop set to 0.5 in the default configs?](#why-is-the-z-position_endstop-set-to-05-in-the-default-configs)
10. [I converted my config from Marlin and the X/Y axes work fine, but I just get a screeching noise when homing the Z axis](#i-converted-my-config-from-marlin-and-the-xy-axes-work-fine-but-i-just-get-a-screeching-noise-when-homing-the-z-axis)
11. [My TMC motor driver turns off in the middle of a print](#my-tmc-motor-driver-turns-off-in-the-middle-of-a-print)
12. [I keep getting random "Lost communication with MCU" errors](#i-keep-getting-random-lost-communication-with-mcu-errors)
13. [When I set "restart_method=command" my AVR device just hangs on a restart](#when-i-set-restart_methodcommand-my-avr-device-just-hangs-on-a-restart)
14. [Will the heaters be left on if the Raspberry Pi crashes?](#will-the-heaters-be-left-on-if-the-raspberry-pi-crashes)
15. [How do I convert a Marlin pin number to a Klipper pin name?](#how-do-i-convert-a-marlin-pin-number-to-a-klipper-pin-name)
16. [How do I upgrade to the latest software?](#how-do-i-upgrade-to-the-latest-software)
### How can I donate to the project?
Thanks. Kevin has a Patreon page at: https://www.patreon.com/koconnor
### How do I calculate the step_distance parameter in the printer config file?
If you know the steps per millimeter for the axis then use a
calculator to divide 1.0 by steps_per_mm. Then round this number to
six decimal places and place it in the config (six decimal places is
nano-meter precision).
The step_distance defines the distance that the axis will travel on
each motor driver pulse. It can also be calculated from the axis
pitch, motor step angle, and driver microstepping. If unsure, do a web
search for "calculate steps per mm" to find an online calculator.
### Where's my serial port?
The general way to find a USB serial port is to run `ls -l
/dev/serial/by-id/` from an ssh terminal on the host machine. It will
likely produce output similar to the following:
```
lrwxrwxrwx 1 root root 13 Jun 1 21:12 usb-1a86_USB2.0-Serial-if00-port0 -> ../../ttyUSB0
```
The name found in the above command is stable and it is possible to
use it in the config file and while flashing the micro-controller
code. For example, a flash command might look similar to:
```
sudo service klipper stop
make flash FLASH_DEVICE=/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
sudo service klipper start
```
and the updated config might look like:
```
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
```
Be sure to copy-and-paste the name from the "ls" command that you ran
above as the name will be different for each printer.
If you are using multiple micro-controllers and they do not have
unique ids (common on boards with a CH340 USB chip) then follow the
directions above using the directory `/dev/serial/by-path/` instead.
### When the micro-controller restarts the device changes to /dev/ttyUSB1
Follow the directions in the
"[Where's my serial port?](#wheres-my-serial-port)" section to prevent
this from occurring.
### The "make flash" command doesn't work
The code attempts to flash the device using the most common method for
each platform. Unfortunately, there is a lot of variance in flashing
methods, so the "make flash" command may not work on all boards.
If you're having an intermittent failure or you do have a standard
setup, then double check that Klipper isn't running when flashing
(sudo service klipper stop), make sure OctoPrint isn't trying to
connect directly to the device (open the Connection tab in the web
page and click Disconnect if the Serial Port is set to the device),
and make sure FLASH_DEVICE is set correctly for your board (see the
[question above](#wheres-my-serial-port)).
However, if "make flash" just doesn't work for your board, then you
will need to manually flash. See if there is a config file in the
[config directory](../config) with specific instructions for flashing
the device. Also, check the board manufacturer's documentation to see
if it describes how to flash the device. Finally, on AVR devices, it
may be possible to manually flash the device using
[avrdude](http://www.nongnu.org/avrdude/) with custom command-line
parameters - see the avrdude documentation for further information.
### How do I change the serial baud rate?
The recommended baud rate for Klipper is 250000. This baud rate works
well on all micro-controller boards that Klipper supports. If you've
found an online guide recommending a different baud rate, then ignore
that part of the guide and continue with the default value of 250000.
If you want to change the baud rate anyway, then the new rate will
need to be configured in the micro-controller (during **make
menuconfig**) and that updated code will need to be compiled and
flashed to the micro-controller. The Klipper printer.cfg file will
also need to be updated to match that baud rate (see the example.cfg
file for details). For example:
```
[mcu]
baud: 250000
```
The baud rate shown on the OctoPrint web page has no impact on the
internal Klipper micro-controller baud rate. Always set the OctoPrint
baud rate to 250000 when using Klipper.
The Klipper micro-controller baud rate is not related to the baud rate
of the micro-controller's bootloader. See the
[bootloader document](Bootloaders.md) for additional information on
bootloaders.
### Can I run Klipper on something other than a Raspberry Pi 3?
The recommended hardware is a Raspberry Pi 2 or a Raspberry
Pi 3.
Klipper will run on a Raspberry Pi 1 and on the Raspberry Pi Zero, but
these boards don't have enough processing power to run OctoPrint
well. It's not uncommon for print stalls to occur on these slower
machines (the printer may move faster than OctoPrint can send movement
commands) when printing directly from OctoPrint. If you wish to run on
one one of these slower boards anyway, consider using the
"virtual_sdcard" feature (see
[config/example-extras.cfg](../config/example-extras.cfg) for details)
when printing.
For running on the Beaglebone, see the
[Beaglebone specific installation instructions](beaglebone.md).
Klipper has been run on other machines. The Klipper host software
only requires Python running on a Linux (or similar)
computer. However, if you wish to run it on a different machine you
will need Linux admin knowledge to install the system prerequisites
for that particular machine. See the
[install-octopi.sh](../scripts/install-octopi.sh) script for further
information on the necessary Linux admin steps.
### Why can't I move the stepper before homing the printer?
The code does this to reduce the chance of accidentally commanding the
head into the bed or a wall. Once the printer is homed the software
attempts to verify each move is within the position_min/max defined in
the config file. If the motors are disabled (via an M84 or M18
command) then the motors will need to be homed again prior to
movement.
If you want to move the head after canceling a print via OctoPrint,
consider changing the OctoPrint cancel sequence to do that for
you. It's configured in OctoPrint via a web browser under:
Settings->GCODE Scripts
If you want to move the head after a print finishes, consider adding
the desired movement to the "custom g-code" section of your slicer.
If the printer requires some additional movement as part of the homing
process itself (or fundamentally does not have a homing process) then
consider using a homing_override section in the config file. If you
need to move a stepper for diagnostic or debugging purposes then
consider adding a force_move section to the config file. See
[example-extras.cfg](../config/example-extras.cfg) for further details
on these options.
### Why is the Z position_endstop set to 0.5 in the default configs?
For cartesian style printers the Z position_endstop specifies how far
the nozzle is from the bed when the endstop triggers. If possible, it
is recommended to use a Z-max endstop and home away from the bed (as
this reduces the potential for bed collisions). However, if one must
home towards the bed then it is recommended to position the endstop so
it triggers when the nozzle is still a small distance away from the
bed. This way, when homing the axis, it will stop before the nozzle
touches the bed.
Almost all mechanical switches can still move a small distance
(eg, 0.5mm) after they are triggered. So, for example, if the
position_endstop is set to 0.5mm then one may still command the
printer to move to Z0.2. The position_min config setting (which
defaults to 0) is used to specify the minimum Z position one may
command the printer to move to.
Note, the Z position_endstop specifies the distance from the nozzle to
the bed when the nozzle and bed (if applicable) are hot. It is typical
for thermal expansion to cause nozzle expansion of around .1mm, which
is also the typical thickness of a sheet of printer paper. Thus, it is
common to use the "paper test" to confirm calibration of the Z
height - check that the bed and nozzle are at room temperature, check
that there is no plastic on the head or bed, home the printer, place a
piece of paper between the nozzle and bed, and repeatedly command the
head to move closer to the bed checking each time if you feel a small
amount of friction when sliding the paper between bed and nozzle - if
all is calibrated well a small amount of friction would be felt when
the height is at Z0.
### I converted my config from Marlin and the X/Y axes work fine, but I just get a screeching noise when homing the Z axis
Short answer: Try reducing the max_z_velocity setting in the printer
config. Also, if the Z stepper is moving in the wrong direction, try
inverting the dir_pin setting in the config (eg, "dir_pin: !xyz"
instead of "dir_pin: xyz").
Long answer: In practice Marlin can typically only step at a rate of
around 10000 steps per second. If it is requested to move at a speed
that would require a higher step rate then Marlin will generally just
step as fast as it can. Klipper is able to achieve much higher step
rates, but the stepper motor may not have sufficient torque to move at
a higher speed. So, for a Z axis with a very precise step_distance the
actual obtainable max_z_velocity may be smaller than what is
configured in Marlin.
### My TMC motor driver turns off in the middle of a print
There have been reports of some TMC drivers being disabled in the
middle of a print. (In particular, with the TMC2208 driver.) When this
issue occurs, the stepper associated with the driver moves freely,
while the print continues.
It is believed this may be due to "over current" detection within the
TMC driver. Trinamic has indicated that this could occur if the driver
is in "stealthChop mode" and an abrupt velocity change occurs. If you
experience this problem during homing, consider using a slower homing
speed. If you experience this problem in the middle of a print,
consider using a lower square_corner_velocity setting.
### I keep getting random "Lost communication with MCU" errors
This is commonly caused by hardware errors on the USB connection
between the host machine and the micro-controller. Things to look for:
- Use a good quality USB cable between the host machine and
micro-controller. Make sure the plugs are secure.
- If using a Raspberry Pi, use a good quality power supply for the
Raspberry Pi and use a good quality USB cable to connect that power
supply to the Pi.
- Make sure the printer's power supply is not being overloaded. (Power
fluctuations to the micro-controller's USB chip may result in resets
of that chip.)
- There have been reports of high USB noise when both the printer's
power supply and the host's 5V power supply are mixed. (If you find
that the micro-controller powers on when either the printer's power
supply is on or the USB cable is plugged in, then it indicates the
5V power supplies are being mixed.) It may help to configure the
micro-controller to use power from only one source. (Alternatively,
if the micro-controller board can not configure its power source,
one may modify a USB cable so that it does not carry 5V power
between the host and micro-controller.)
### When I set "restart_method=command" my AVR device just hangs on a restart
Some old versions of the AVR bootloader have a known bug in watchdog
event handling. This typically manifests when the printer.cfg file has
restart_method set to "command". When the bug occurs, the AVR device
will be unresponsive until power is removed and reapplied to the
device (the power or status LEDs may also blink repeatedly until the
power is removed).
The workaround is to use a restart_method other than "command" or to
flash an updated bootloader to the AVR device. Flashing a new
bootloader is a one time step that typically requires an external
programmer - search the web to find the instructions for your
particular device.
### Will the heaters be left on if the Raspberry Pi crashes?
The software has been designed to prevent that. Once the host enables
a heater, the host software needs to confirm that enablement every 5
seconds. If the micro-controller does not receive a confirmation every
5 seconds it goes into a "shutdown" state which is designed to turn
off all heaters and stepper motors.
See the "config_digital_out" command in the
[MCU commands](MCU_Commands.md) document for further details.
In addition, the micro-controller software is configured with a
minimum and maximum temperature range for each heater at startup (see
the min_temp and max_temp parameters in the
[example.cfg](../config/example.cfg) file for details). If the
micro-controller detects that the temperature is outside of that range
then it will also enter a "shutdown" state.
Separately, the host software also implements code to check that
heaters and temperature sensors are functioning correctly. See the
"verify_heater" section of the
[example-extras.cfg](../config/example-extras.cfg) for further
details.
### How do I convert a Marlin pin number to a Klipper pin name?
Short answer: In some cases one can use Klipper's `pin_map: arduino`
feature. Otherwise, for "digital" pins, one method is to search for
the requested pin in Marlin's fastio header files. The Atmega2560 and
Atmega1280 chips use
[fastio_1280.h](https://github.com/MarlinFirmware/Marlin/blob/1.1.9/Marlin/fastio_1280.h),
while the Atmega644p and Atmega1284p chips use
[fastio_644.h](https://github.com/MarlinFirmware/Marlin/blob/1.1.9/Marlin/fastio_644.h).
For example, if you are looking to translate Marlin's digital pin
number 23 on an atmega2560 then one could find the following line in
Marlin's fastio_1280.h file:
```
#define DIO23_PIN PINA1
```
The `DIO23` indicates the line is for Marlin's pin 23 and the `PINA1`
indicates the pin uses the hardware name of `PA1`. Klipper uses the
hardware names (eg, `PA1`).
Long answer: Klipper uses the standard pin names defined by the
micro-controller. On the Atmega chips these hardware pins have names
like `PA4`, `PC7`, or `PD2`.
Long ago, the Arduino project decided to avoid using the standard
hardware names in favor of their own pin names based on incrementing
numbers - these Arduino names generally look like `D23` or `A14`. This
was an unfortunate choice that has lead to a great deal of confusion.
In particular the Arduino pin numbers frequently don't translate to
the same hardware names. For example, `D21` is `PD0` on one common
Arduino board, but is `PC7` on another common Arduino board.
In order to support 3d printers based on real Arduino boards, Klipper
supports the Arduino pin aliases. This feature is enabled by adding
`pin_map: arduino` to the [mcu] section of the config file. When these
aliases are enabled, Klipper understands pin names that start with the
prefix "ar" (eg, Arduino pin `D23` is Klipper alias `ar23`) and the
prefix "analog" (eg, Arduino pin `A14` is Klipper alias `analog14`).
Klipper does not use the Arduino names directly because we feel a name
like D7 is too easily confused with the hardware name PD7.
Marlin primarily follows the Arduino pin numbering scheme. However,
Marlin supports a few chips that Arduino does not support and in some
cases it supports pins that Arduino boards do not expose. In these
cases, Marlin chose their own pin numbering scheme. Klipper does not
support these custom pin numbers - check Marlin's fastio headers (see
above) to translate these pin numbers to their standard hardware
names.
### How do I upgrade to the latest software?
The general way to upgrade is to ssh into the Raspberry Pi and run:
```
cd ~/klipper
git pull
~/klipper/scripts/install-octopi.sh
```
Then one can recompile and flash the micro-controller code. For
example:
```
make menuconfig
make clean
make
sudo service klipper stop
make flash FLASH_DEVICE=/dev/ttyACM0
sudo service klipper start
```
However, it's often the case that only the host software changes. In
this case, one can update and restart just the host software with:
```
cd ~/klipper
git pull
sudo service klipper restart
```
If after using this shortcut the software warns about needing to
reflash the micro-controller or some other unusual error occurs, then
follow the full upgrade steps outlined above. Note that the RESTART
and FIRMWARE_RESTART g-code commands do not load new software - the
above "sudo service klipper restart" and "make flash" commands are
needed for a software change to take effect.

128
docs/Features.md Normal file → Executable file
View File

@@ -20,12 +20,21 @@ Klipper has several compelling features:
stepper event timing remains precise even at high speeds which
improves overall stability.
* Klipper supports printers with multiple micro-controllers. For
example, one micro-controller could be used to control an extruder,
while another controls the printer's heaters, while a third controls
the rest of the printer. The Klipper host software implements clock
synchronization to account for clock drift between
micro-controllers. No special code is needed to enable multiple
micro-controllers - it just requires a few extra lines in the config
file.
* Configuration via simple config file. There's no need to reflash the
micro-controller to change a setting. All of Klipper's configuration
is stored in a standard config file which can be easily edited. This
makes it easier to setup and maintain the hardware.
* Portable code. Klipper works on both ARM and AVR
* Portable code. Klipper works on ARM, AVR, and PRU based
micro-controllers. Existing "reprap" style printers can run Klipper
without hardware modification - just add a Raspberry Pi. Klipper's
internal code layout makes it easier to support other
@@ -33,37 +42,22 @@ Klipper has several compelling features:
* Simpler code. Klipper uses a very high level language (Python) for
most code. The kinematics algorithms, the G-code parsing, the
heating and thermistor algorithms, etc. are all written in
Python. This makes it easier to develop new functionality.
heating and thermistor algorithms, etc. are all written in Python.
This makes it easier to develop new functionality.
* Advanced features:
* Klipper implements the "pressure advance" algorithm for
extruders. When properly tuned, pressure advance reduces extruder
ooze.
* Klipper supports printers with multiple micro-controllers. For
example, one micro-controller could be used to control an
extruder, while another could control the printer's heaters, while
a third controls the rest of the printer. The Klipper host
software implements clock synchronization to account for clock
drift between micro-controllers. No special code is needed to
enable multiple micro-controllers - it just requires a few extra
lines in the config file.
* Klipper also implements a novel "stepper phase endstop" algorithm
that can dramatically improve the accuracy of typical endstop
switches. When properly tuned it can improve a print's first layer
bed adhesion.
* Support for limiting the top speed of short "zigzag" moves to
reduce printer vibration and noise. See the
[kinematics](Kinematics.md) document for more information.
* Klipper uses an "iterative solver" to calculate precise step times
from simple kinematic equations. This makes porting Klipper to new
types of robots easier and it keeps timing precise even with complex
kinematics (no "line segmentation" is needed).
To get started with Klipper, read the [installation](Installation.md)
guide.
Common features supported by Klipper
====================================
Additional features
===================
Klipper supports many standard 3d printer features:
* Klipper implements the "pressure advance" algorithm for extruders.
When properly tuned, pressure advance reduces extruder ooze.
* Works with Octoprint. This allows the printer to be controlled using
a regular web-browser. The same Raspberry Pi that runs Klipper can
also run Octoprint.
@@ -72,16 +66,60 @@ Klipper supports many standard 3d printer features:
typical "slicers" are supported. One may continue to use Slic3r,
Cura, etc. with Klipper.
* Constant speed acceleration support. All printer moves will
gradually accelerate from standstill to cruising speed and then
decelerate back to a standstill.
* Support for multiple extruders. Extruders with shared heaters and
extruders on independent carriages (IDEX) are also supported.
* "Look-ahead" support. The incoming stream of G-Code movement
commands are queued and analyzed - the acceleration between
* Support for cartesian, delta, and corexy style printers.
* Automatic bed leveling support. Klipper can be configured for basic
bed tilt detection or full mesh bed leveling. If the bed uses
multiple Z steppers then Klipper can also level by independently
manipulating the Z steppers. Most Z height probes are supported,
including servo activated probes.
* Automatic delta calibration support. The calibration tool can
perform basic height calibration as well as an enhanced X and Y
dimension calibration. The calibration can be done with a Z height
probe or via manual probing.
* Support for common temperature sensors (eg, common thermistors,
AD595, PT100, MAX6675, MAX31855, MAX31856, MAX31865). Custom
thermistors and custom analog temperature sensors can also be
configured.
* Basic thermal heater protection enabled by default.
* Support for standard fans, nozzle fans, and temperature controlled
fans. No need to keep fans running when the printer is idle.
* Support for run-time configuration of TMC2130, TMC2208, TMC2224, and
TMC2660 stepper motor drivers. There is also support for current
control of traditional stepper drivers via AD5206 and MCP4451
digipots.
* Support for common LCD displays attached directly to the printer. A
default menu is also available.
* Constant acceleration and "look-ahead" support. All printer moves
will gradually accelerate from standstill to cruising speed and then
decelerate back to a standstill. The incoming stream of G-Code
movement commands are queued and analyzed - the acceleration between
movements in a similar direction will be optimized to reduce print
stalls and improve overall print time.
* Support for cartesian, delta, and corexy style printers.
* Klipper implements a "stepper phase endstop" algorithm that can
improve the accuracy of typical endstop switches. When properly
tuned it can improve a print's first layer bed adhesion.
* Support for limiting the top speed of short "zigzag" moves to reduce
printer vibration and noise. See the [kinematics](Kinematics.md)
document for more information.
* Sample configuration files are available for many common printers.
Check the [config directory](../config/) for a list.
To get started with Klipper, read the [installation](Installation.md)
guide.
Step Benchmarks
===============
@@ -89,14 +127,20 @@ Step Benchmarks
Below are the results of stepper performance tests. The numbers shown
represent total number of steps per second on the micro-controller.
| Micro-controller | Fastest step rate | 3 steppers active |
| ----------------- | ----------------- | ----------------- |
| 20Mhz AVR | 189K | 125K |
| 16Mhz AVR | 151K | 100K |
| Arduino Due (ARM) | 382K | 337K |
| Beaglebone PRU | 689K | 689K |
| Micro-controller | Fastest step rate | 3 steppers active |
| --------------------------- | ----------------- | ----------------- |
| 16Mhz AVR | 151K | 100K |
| 20Mhz AVR | 189K | 125K |
| Arduino Zero (ARM SAMD21) | 234K | 217K |
| STM32F103 | 333K | 300K |
| Arduino Due (ARM SAM3X8E) | 410K | 397K |
| Smoothieboard (ARM LPC1768) | 487K | 487K |
| Smoothieboard (ARM LPC1769) | 584K | 584K |
| SAM4E8E ARM | 638K | 638K |
| Beaglebone PRU | 680K | 680K |
On AVR platforms, the highest achievable step rate is with just one
stepper stepping. On the Due, the highest step rate is with two
simultaneous steppers stepping. On the PRU, the highest step rate is
with three simultaneous steppers.
stepper stepping. On the STM32F103, Arduino Zero, and Due, the highest
step rate is with two simultaneous steppers stepping. On the PRU,
SAM4E8E, and LPC176x the highest step rate is with three simultaneous
steppers.

275
docs/G-Codes.md Normal file
View File

@@ -0,0 +1,275 @@
This document describes the commands that Klipper supports. These are
commands that one may enter into the OctoPrint terminal tab.
# G-Code commands
Klipper supports the following standard G-Code commands:
- Move (G0 or G1): `G1 [X<pos>] [Y<pos>] [Z<pos>] [E<pos>] [F<speed>]`
- Dwell: `G4 P<milliseconds>`
- Move to origin: `G28 [X] [Y] [Z]`
- Turn off motors: `M18` or `M84`
- Wait for current moves to finish: `M400`
- Select tool: `T<index>`
- Use absolute/relative distances for extrusion: `M82`, `M83`
- Use absolute/relative coordinates: `G90`, `G91`
- Set position: `G92 [X<pos>] [Y<pos>] [Z<pos>] [E<pos>]`
- Set speed factor override percentage: `M220 S<percent>`
- Set extrude factor override percentage: `M221 S<percent>`
- Set acceleration: `M204 S<value>`
- Get extruder temperature: `M105`
- Set extruder temperature: `M104 [T<index>] [S<temperature>]`
- Set extruder temperature and wait: `M109 [T<index>] S<temperature>`
- Note: M109 always waits for temperature to settle at requested
value
- Set bed temperature: `M140 [S<temperature>]`
- Set bed temperature and wait: `M190 S<temperature>`
- Note: M190 always waits for temperature to settle at requested
value
- Set fan speed: `M106 S<value>`
- Turn fan off: `M107`
- Emergency stop: `M112`
- Get current position: `M114`
- Get firmware version: `M115`
For further details on the above commands see the
[RepRap G-Code documentation](http://reprap.org/wiki/G-code).
Klipper's goal is to support the G-Code commands produced by common
3rd party software (eg, OctoPrint, Printrun, Slic3r, Cura, etc.) in
their standard configurations. It is not a goal to support every
possible G-Code command. Instead, Klipper prefers human readable
["extended G-Code commands"](#extended-g-code-commands).
If one requires a less common G-Code command then it may be possible
to implement it with a custom Klipper gcode_macro (see
[example-extras.cfg](../config/example-extras.cfg) for details). For
example, one might use this to implement: `G10`, `G11`, `G12`, `G29`,
`G30`, `G31`, `M42`, `M80`, `M81`, etc.
## G-Code SD card commands
Klipper also supports the following standard G-Code commands if the
"virtual_sdcard" config section is enabled:
- List SD card: `M20`
- Initialize SD card: `M21`
- Select SD file: `M23 <filename>`
- Start/resume SD print: `M24`
- Pause SD print: `M25`
- Set SD position: `M26 S<offset>`
- Report SD print status: `M27`
## G-Code display commands
The following standard G-Code commands are available if a "display"
config section is enabled:
- Display Message: `M117 <message>`
- Set build percentage: `M73 P<percent>`
## Other available G-Code commands
The following standard G-Code commands are currently available, but
using them is not recommended:
- Offset axes: `M206 [X<offset>] [Y<offset>] [Z<offset>]` (Use
SET_GCODE_OFFSET instead.)
- Get Endstop Status: `M119` (Use QUERY_ENDSTOPS instead.)
# Extended G-Code Commands
Klipper uses "extended" G-Code commands for general configuration and
status. These extended commands all follow a similar format - they
start with a command name and may be followed by one or more
parameters. For example: `SET_SERVO SERVO=myservo ANGLE=5.3`. In this
document, the commands and parameters are shown in uppercase, however
they are not case sensitive. (So, "SET_SERVO" and "set_servo" both run
the same command.)
The following standard commands are supported:
- `QUERY_ENDSTOPS`: Probe the axis endstops and report if they are
"triggered" or in an "open" state. This command is typically used to
verify that an endstop is working correctly.
- `GET_POSITION`: Return information on the current location of the
toolhead.
- `SET_GCODE_OFFSET [X=<pos>|X_ADJUST=<adjust>]
[Y=<pos>|Y_ADJUST=<adjust>] [Z=<pos>|Z_ADJUST=<adjust>]`: Set a
positional offset to apply to future G-Code commands. This is
commonly used to virtually change the Z bed offset or to set nozzle
XY offsets when switching extruders. For example, if
"SET_GCODE_OFFSET Z=0.2" is sent, then future G-Code moves will
have 0.2mm added to their Z height. If the X_ADJUST style parameters
are used, then the adjustment will be added to any existing offset
(eg, "SET_GCODE_OFFSET Z=-0.2" followed by "SET_GCODE_OFFSET
Z_ADJUST=0.3" would result in a total Z offset of 0.1).
- `PID_CALIBRATE HEATER=<config_name> TARGET=<temperature>
[WRITE_FILE=1]`: Perform a PID calibration test. The specified
heater will be enabled until the specified target temperature is
reached, and then the heater will be turned off and on for several
cycles. If the WRITE_FILE parameter is enabled, then the file
/tmp/heattest.txt will be created with a log of all temperature
samples taken during the test.
- `TURN_OFF_HEATERS`: Turn off all heaters.
- `SET_VELOCITY_LIMIT [VELOCITY=<value>] [ACCEL=<value>]
[ACCEL_TO_DECEL=<value>] [SQUARE_CORNER_VELOCITY=<value>]`: Modify
the printer's velocity limits. Note that one may only set values
less than or equal to the limits specified in the config file.
- `SET_PRESSURE_ADVANCE [EXTRUDER=<config_name>] [ADVANCE=<pressure_advance>]
[ADVANCE_LOOKAHEAD_TIME=<pressure_advance_lookahead_time>]`:
Set pressure advance parameters. If EXTRUDER is not specified, it
defaults to the active extruder.
- `STEPPER_BUZZ STEPPER=<config_name>`: Move the given stepper forward
one mm and then backward one mm, repeated 10 times. This is a
diagnostic tool to help verify stepper connectivity.
- `RESTART`: This will cause the host software to reload its config
and perform an internal reset. This command will not clear error
state from the micro-controller (see FIRMWARE_RESTART) nor will it
load new software (see
[the FAQ](FAQ.md#how-do-i-upgrade-to-the-latest-software)).
- `FIRMWARE_RESTART`: This is similar to a RESTART command, but it
also clears any error state from the micro-controller.
- `SAVE_CONFIG`: This command will overwrite the main printer config
file and restart the host software. This command is used in
conjunction with other calibration commands to store the results of
calibration tests.
- `STATUS`: Report the Klipper host software status.
- `HELP`: Report the list of available extended G-Code commands.
## Custom Pin Commands
The following command is available when an "output_pin" config section
is enabled:
- `SET_PIN PIN=config_name VALUE=<value>`
## Servo Commands
The following commands are available when a "servo" config section is
enabled:
- `SET_SERVO SERVO=config_name [WIDTH=<seconds>] [ENABLE=<0|1>]`
- `SET_SERVO SERVO=config_name [ANGLE=<degrees>] [ENABLE=<0|1>]`
## Probe
The following commands are available when a "probe" config section is
enabled:
- `PROBE`: Move the nozzle downwards until the probe triggers.
- `QUERY_PROBE`: Report the current status of the probe ("triggered"
or "open").
## BLTouch
The following command is available when a "bltouch" config section is
enabled:
- `BLTOUCH_DEBUG COMMAND=<command>`: This sends a command to the
BLTouch. It may be useful for debugging. Available commands are:
pin_down, touch_mode, pin_up, self_test, reset.
## Delta Calibration
The following commands are available when the "delta_calibrate" config
section is enabled:
- `DELTA_CALIBRATE [METHOD=manual]`: This command will probe seven
points on the bed and recommend updated endstop positions, tower
angles, and radius.
- `NEXT`: If manual bed probing is enabled, then one can use this
command to move to the next probing point during a DELTA_CALIBRATE
operation.
- `DELTA_ANALYZE`: This command is used during enhanced delta
calibration. See [Delta Calibrate](Delta_Calibrate.md) for details.
## Bed Tilt
The following commands are available when the "bed_tilt" config
section is enabled:
- `BED_TILT_CALIBRATE [METHOD=manual]`: This command will probe the
points specified in the config and then recommend updated x and y
tilt adjustments.
- `NEXT`: If manual bed probing is enabled, then one can use this
command to move to the next probing point during a
BED_TILT_CALIBRATE operation.
## Mesh Bed Leveling
The following commands are available when the "bed_mesh" config
section is enabled:
- `BED_MESH_CALIBRATE [METHOD=manual]`: This command probes the bed
using generated points specified by the parameters in the
config. After probing, a mesh is generated and z-movement is
adjusted according to the mesh.
- `NEXT`: If manual bed probing is enabled, then one can use this
command to move to the next probing point during a
BED_MESH_CALIBRATE operation.
- `BED_MESH_OUTPUT`: This command outputs the current probed z values
and current mesh values to the terminal.
- `BED_MESH_MAP`: This command probes the bed in a similar fashion
to BED_MESH_CALIBRATE, however no mesh is generated. Instead,
the probed z values are serialized to json and output to the
terminal. This allows octoprint plugins to easily capture the
data and generate maps approximating the bed's surface. Note
that although no mesh is generated, any currently stored mesh
will be cleared.
- `BED_MESH_CLEAR`: This command clears the mesh and removes all
z adjustment. It is recommended to put this in your end-gcode.
- `BED_MESH_PROFILE LOAD=<name> SAVE=<name> REMOVE=<name>`: This
command provides profile management for mesh state. LOAD will
restore the mesh state from the profile matching the supplied name.
SAVE will save the current mesh state to a profile matching the
supplied name. Remove will delete the profile matching the
supplied name from persistent memory. Note that after SAVE or
REMOVE operations have been run the SAVE_CONFIG gcode must be run
to make the changes to peristent memory permanent.
## Z Tilt
The following commands are available when the "z_tilt" config section
is enabled:
- `Z_TILT_ADJUST`: This command will probe the points specified in the
config and then make independent adjustments to each Z stepper to
compensate for tilt.
## Dual Carriages
The following command is available when the "dual_carriage" config
section is enabled:
- `SET_DUAL_CARRIAGE CARRIAGE=[0|1]`: This command will set the active
carriage. It is typically invoked from the activate_gcode and
deactivate_gcode fields in a multiple extruder configuration.
## TMC2130
The following command is available when the "tmc2130" config section
is enabled:
- `DUMP_TMC STEPPER=<name>`: This command will read the TMC2130 driver
registers and report their values.
## Endstop adjustments by stepper phase
The following commands are available when an "endstop_phase" config
section is enabled:
- `ENDSTOP_PHASE_CALIBRATE [STEPPER=<config_name>]`: If no STEPPER
parameter is provided then this command will reports statistics on
endstop stepper phases during past homing operations. When a STEPPER
parameter is provided it arranges for the given endstop phase
setting to be written to the config file (in conjunction with the
SAVE_CONFIG command).
## Force movement
The following commands are available when the "force_move" config
section is enabled:
- `FORCE_MOVE STEPPER=<config_name> DISTANCE=<value>
VELOCITY=<value>`: This command will forcibly move the given stepper
the given distance (in mm) at the given constant velocity (in
mm/s). No acceleration is performed; no boundary checks are
performed; no kinematic updates are made; other parallel steppers on
an axis will not be moved. Use caution as an incorrect command could
cause damage! Using this command will almost certainly place the
low-level kinematics in an incorrect state; issue a G28 afterwards
to reset the kinematics. This command is intended for low-level
diagnostics and debugging.
- `SET_KINEMATIC_POSITION [X=<value>] [Y=<value>] [Z=<value>]`: Force
the low-level kinematic code to believe the toolhead is at the given
cartesian position. This is a diagnostic and debugging command; use
SET_GCODE_OFFSET and/or G92 for regular axis transformations. If an
axis is not specified then it will default to the position that the
head was last commanded to. Setting an incorrect or invalid position
may lead to internal software errors. This command may invalidate
future boundary checks; issue a G28 afterwards to reset the
kinematics.

View File

@@ -1,17 +1,13 @@
These instructions assume the software will run on a Raspberry Pi
computer in conjunction with OctoPrint. (See the
[Beaglebone specific instructions](beaglebone.md) if using a
Beaglebone.) It is recommended that a Raspberry Pi 2 or Raspberry Pi 3
computer be used as the host machine.
It should be possible to run the Klipper host software on any computer
running a recent Linux distribution, but doing so will require Linux
admin knowledge to translate these installation instructions to the
particulars of that machine.
computer in conjunction with OctoPrint. It is recommended that a
Raspberry Pi 2 or Raspberry Pi 3 computer be used as the host machine
(see the
[FAQ](FAQ.md#can-i-run-klipper-on-something-other-than-a-raspberry-pi-3)
for other machines).
Klipper currently supports Atmel ATmega based micro-controllers,
Arduino Due (Atmel SAM3x8e ARM micro-controller), and
[Beaglebone PRU](beaglebone.md) based printers.
Arduino Due (Atmel SAM3x8e ARM micro-controller), Smoothieboard (ARM
LPC176x), and [Beaglebone PRU](beaglebone.md) based printers.
Prepping an OS image
====================
@@ -21,11 +17,16 @@ Raspberry Pi computer. Use OctoPi v0.14.0 or later - see the
[octopi releases](https://github.com/guysoft/OctoPi/releases) for
release information. One should verify that OctoPi boots and that the
OctoPrint web server works. After connecting to the OctoPrint web
page, follow the prompt to upgrade OctoPrint to v1.3.5 or later.
page, follow the prompt to upgrade OctoPrint to v1.3.7 or later.
After installing OctoPi and upgrading OctoPrint, ssh into the target
machine (ssh pi@octopi -- password is "raspberry") and run the
following commands:
After installing OctoPi and upgrading OctoPrint, it will be necessary
to ssh into the target machine to run a handful of system commands. If
using a Linux or MacOS desktop, then the "ssh" software should already
be installed on the desktop. There are free ssh clients available for
other desktops (eg,
[PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/)). Use the
ssh utility to connect to the Raspberry Pi (ssh pi@octopi -- password
is "raspberry") and run the following commands:
```
git clone https://github.com/KevinOConnor/klipper
@@ -40,15 +41,18 @@ minutes to complete.
Building and flashing the micro-controller
==========================================
To compile the micro-controller code, start by configuring it:
To compile the micro-controller code, start by running these commands
on the Raspberry Pi:
```
cd ~/klipper/
make menuconfig
```
Select the appropriate micro-controller and serial baud rate. Once
configured, run:
Select the appropriate micro-controller and review any other options
provided. For boards with serial ports, the recommended baud rate is
250000 (see the [FAQ](FAQ.md#how-do-i-change-the-serial-baud-rate)
before changing). Once configured, run:
```
make
@@ -62,25 +66,11 @@ make flash FLASH_DEVICE=/dev/ttyACM0
sudo service klipper start
```
Configuring Klipper
===================
The Klipper configuration is stored in a text file on the Raspberry
Pi. Take a look at the example config files in the
[config directory](../config/). The
[example.cfg](../config/example.cfg) file contains documentation on
command parameters and it can also be used as an initial config file
template. However, for most printers, one of the other config files
may be a more concise starting point. The next step is to copy and
edit one of these config files - for example:
```
cp ~/klipper/config/example.cfg ~/printer.cfg
nano ~/printer.cfg
```
Make sure to review and update each setting that is appropriate for
the hardware.
When flashing for the first time, make sure that OctoPrint is not
connected directly to the printer (from the OctoPrint web page, under
the "Connection" section, click "Disconnect"). The most common
communication device is **/dev/ttyACM0** - see the
[FAQ](FAQ.md#wheres-my-serial-port) for other possibilities.
Configuring OctoPrint to use Klipper
====================================
@@ -94,8 +84,9 @@ Under "Serial Connection" in "Additional serial ports" add
"/tmp/printer". Then click "Save".
Enter the Settings tab again and under "Serial Connection" change the
"Serial Port" setting to "/tmp/printer". Unselect the "Not only cancel
ongoing prints but also disconnect..." checkbox. Click "Save".
"Serial Port" setting to "/tmp/printer". Navigate to the "Behavior"
sub-tab and select the "Cancel any ongoing prints but stay connected
to the printer" option. Click "Save".
From the main page, under the "Connection" section (at the top left of
the page) make sure the "Serial Port" is set to "/tmp/printer" and
@@ -105,13 +96,47 @@ try reloading the page.)
Once connected, navigate to the "Terminal" tab and type "status"
(without the quotes) into the command entry box and click "Send". The
terminal window will likely report there is an error opening the
config file - issue a "restart" command in the OctoPrint terminal to
load the config. A "status" command will report the printer is ready
if the Klipper config file is successfully read and the
micro-controller is successfully found and configured. It is not
unusual to have configuration errors during the initial setup - update
the printer config file and issue "restart" until "status" reports the
printer is ready.
config file - that means OctoPrint is successfully communicating with
Klipper. Proceed to the next section.
Configuring Klipper
===================
The Klipper configuration is stored in a text file on the Raspberry
Pi. Take a look at the example config files in the
[config directory](../config/). The
[example.cfg](../config/example.cfg) file contains documentation on
command parameters and it can also be used as an initial config file
template. However, for most printers, one of the other config files
may be a more concise starting point.
Arguably the easiest way to update the Klipper configuration file is
to use a desktop editor that supports editing files over the "scp"
and/or "sftp" protocols. There are freely available tools that support
this (eg, Notepad++, WinSCP, and Cyberduck). Use one of the example
config files as a starting point and save it as a file named
"printer.cfg" in the home directory of the pi user (ie,
/home/pi/printer.cfg).
Alternatively, one can also copy and edit the file directly on the
Raspberry Pi via ssh - for example:
```
cp ~/klipper/config/example.cfg ~/printer.cfg
nano ~/printer.cfg
```
Make sure to review and update each setting that is appropriate for
the hardware.
After creating and editing the file it will be necessary to issue a
"restart" command in the OctoPrint web terminal to load the config. A
"status" command will report the printer is ready if the Klipper
config file is successfully read and the micro-controller is
successfully found and configured. It is not unusual to have
configuration errors during the initial setup - update the printer
config file and issue "restart" until "status" reports the printer is
ready.
Klipper reports error messages via the OctoPrint terminal tab. The
"status" command can be used to re-report error messages. The default
@@ -122,7 +147,13 @@ In addition to common g-code commands, Klipper supports a few extended
commands - "status" and "restart" are examples of these commands. Use
the "help" command to get a list of other extended commands.
After Klipper reports that the printer is ready go on to the
[config check document](Config_checks.md) to perform some basic checks
on the pin definitions in the config file.
Contacting the developers
=========================
See the [contact page](Contact.md) to ask questions or report a bug.
Be sure to see the [FAQ](FAQ.md) for answers to some common questions.
See the [contact page](Contact.md) to report a bug or to contact the
developers.

View File

@@ -87,6 +87,10 @@ small junction speed is permitted.
The junction speeds are determined using "approximated centripetal
acceleration". Best
[described by the author](https://onehossshay.wordpress.com/2011/09/24/improving_grbl_cornering_algorithm/).
However, in Klipper, junction speeds are configured by specifying the
desired speed that a 90° corner should have (the "square corner
velocity"), and the junction speeds for other angles are derived from
that.
Klipper implements look-ahead between moves that have similar extruder
flow rates. Other moves are relatively rare and implementing
@@ -139,15 +143,32 @@ tracked in millimeters, seconds, and in cartesian coordinate space.
It's the task of the kinematic classes to convert from this generic
coordinate system to the hardware specifics of the particular printer.
In general, the code determines each step time by first calculating
where along the line of movement the head would be if a step is
taken. It then calculates what time the head should be at that
position. Determining the time along the line of movement can be done
using the formulas for constant acceleration and constant velocity:
Klipper uses an
[iterative solver](https://en.wikipedia.org/wiki/Root-finding_algorithm)
to generate the step times for each stepper. The code contains the
formulas to calculate the ideal cartesian coordinates of the head at
each moment in time, and it has the kinematic formulas to calculate
the ideal stepper positions based on those cartesian coordinates. With
these formulas, Klipper can determine the ideal time that the stepper
should be at each step position. The given steps are then scheduled at
these calculated times.
The key formula to determine how far a move should travel under
constant acceleration is:
```
time = sqrt(2*distance/accel + (start_velocity/accel)^2) - start_velocity/accel
time = distance/cruise_velocity
move_distance = (start_velocity + .5 * accel * move_time) * move_time
```
and the key formula for movement with constant velocity is:
```
move_distance = cruise_velocity * move_time
```
The key formulas for determining the cartesian coordinate of a move
given a move distance is:
```
cartesian_x_position = start_x + move_distance * total_x_movement / total_movement
cartesian_y_position = start_y + move_distance * total_y_movement / total_movement
cartesian_z_position = start_z + move_distance * total_z_movement / total_movement
```
Cartesian Robots
@@ -157,54 +178,35 @@ Generating steps for cartesian printers is the simplest case. The
movement on each axis is directly related to the movement in cartesian
space.
Key formulas:
```
stepper_x_position = cartesian_x_position
stepper_y_position = cartesian_y_position
stepper_z_position = cartesian_z_position
```
CoreXY Robots
----------------
Generating steps on a CoreXY machine is only a little more complex
than basic cartesian robots. The key formulas are:
```
stepper_a_position = cartesian_x_position + cartesian_y_position
stepper_b_position = cartesian_x_position - cartesian_y_position
stepper_z_position = cartesian_z_position
```
Delta Robots
------------
To generate step times on Delta printers it is necessary to correlate
the movement in cartesian space with the movement on each stepper
tower.
To simplify the math, for each stepper tower, the code calculates the
location of a "virtual tower" that is along the line of movement.
This virtual tower is chosen at the point where the line of movement
(extended infinitely in both directions) would be closest to the
actual tower.
![delta-tower](img/delta-tower.svg.png)
It is then possible to calculate where the head will be along the line
of movement after each step is taken on the virtual tower.
![virtual-tower](img/virtual-tower.svg.png)
The key formula is Pythagoras's theorem:
Step generation on a delta robot is based on Pythagoras's theorem:
```
distance_to_tower^2 = arm_length^2 - tower_height^2
stepper_position = (sqrt(arm_length^2
- (cartesian_x_position - tower_x_position)^2
- (cartesian_y_position - tower_y_position)^2)
+ cartesian_z_position)
```
One complexity is that if the print head passes the virtual tower
location then the stepper direction must be reversed. In this case
forward steps will be taken at the start of the move and reverse steps
will be taken at the end of the move.
### Delta movements beyond simple XY plane ###
Movement calculation is more complicated if a single move contains
both XY movement and Z movement. These moves are rare, but they must
still be handled correctly. A virtual tower along the line of movement
is still calculated, but in this case the tower is not at a 90 degree
angle relative to the line of movement:
![xy+z-tower](img/xy+z-tower.svg.png)
The code continues to calculate step times using the same general
scheme as delta moves within an XY plane, but the slope of the tower
must also be used in the calculations.
Should the move contain only Z movement (ie, no XY movement at all)
then the same math is used - just in this case the tower is parallel
to the line of movement.
### Stepper motor acceleration limits ###
With delta kinematics it is possible for a move that is accelerating
@@ -236,8 +238,10 @@ independently from the step time calculations of the print head
movement.
Basic extruder movement is simple to calculate. The step time
generation uses the same constant acceleration and constant velocity
formulas that cartesian robots use.
generation uses the same formulas that cartesian robots use:
```
stepper_position = requested_e_position
```
### Pressure advance ###
@@ -264,7 +268,7 @@ through the nozzle orifice (as in
key idea is that the relationship between filament, pressure, and flow
rate can be modeled using a linear coefficient:
```
extra_filament = pressure_advance_coefficient * extruder_velocity
stepper_position = requested_e_position + pressure_advance_coefficient * nominal_extruder_velocity
```
See the [pressure advance](Pressure_Advance.md) document for

View File

@@ -49,13 +49,6 @@ Common startup commands:
and 255 indicating a full on state. This command may be useful for
enabling CPU and nozzle cooling fans.
* `send_spi_message pin=%u msg=%*s` : This command can be used to
transmit messages to a serial-peripheral-interface (SPI) component
connected to the micro-controller. It has been used to configure the
startup settings of AD5206 digipots. The 'pin' parameter specifies
the chip select line to use during the transmission. The 'msg'
indicates the binary message to transmit to the given chip.
Low-level micro-controller configuration
========================================
@@ -182,6 +175,22 @@ This section lists some commonly used config commands.
specifies the maximum number of steppers that this endstop may need
to halt during a homing operation (see end_stop_home below).
* `config_spi oid=%c bus=%u pin=%u mode=%u rate=%u shutdown_msg=%*s` :
This command creates an internal SPI object. It is used with
spi_transfer and spi_send commands (see below). The "bus"
identifies the SPI bus to use (if the micro-controller has more than
one SPI bus available). The "pin" specifies the chip select (CS) pin
for the device. The "mode" is the SPI mode (should be between 0 and
3). The "rate" parameter specifies the SPI bus rate (in cycles per
second). Finally, the "shutdown_msg" is an SPI command to send to
the given device should the micro-controller go into a shutdown
state.
* `config_spi_without_cs oid=%c bus=%u mode=%u rate=%u
shutdown_msg=%*s` : This command is similar to config_spi, but
without a CS pin definition. It is useful for SPI devices that do
not have a chip select line.
Common commands
===============
@@ -217,11 +226,11 @@ only of interest to developers looking to gain insight into Klipper.
pins attached to thermistors controlling heaters - it can be used to
check that a heater is within a temperature range.
* `get_status` : This command causes the micro-controller to generate
a "status" response message. The host sends this command once a
second to obtain the value of the micro-controller clock and to
estimate the drift between host and micro-controller clocks. It
enables the host to accurately estimate the micro-controller clock.
* `get_clock` : This command causes the micro-controller to generate a
"clock" response message. The host sends this command once a second
to obtain the value of the micro-controller clock and to estimate
the drift between host and micro-controller clocks. It enables the
host to accurately estimate the micro-controller clock.
Stepper commands
----------------
@@ -283,3 +292,15 @@ It is the responsibility of the host to ensure that there is available
space in the queue before sending a queue_step command. The host does
this by calculating when each queue_step command completes and
scheduling new queue_step commands accordingly.
SPI Commands
------------
* `spi_transfer oid=%c data=%*s` : This command causes the
micro-controller to send 'data' to the spi device specified by 'oid'
and it generates a "spi_transfer_response" response message with the
data returned during the transmission.
* `spi_send oid=%c data=%*s` : This command is similar to
"spi_transfer", but it does not generate a "spi_transfer_response"
message.

View File

@@ -4,16 +4,25 @@ machine. The host code is intended to run on a low-cost
general-purpose machine such as a Raspberry Pi, while the
micro-controller code is intended to run on commodity micro-controller
chips. Read [features](Features.md) for reasons to use Klipper. See
[installation](Installation.md) to get started with Klipper.
[installation](Installation.md) to get started with Klipper. See
[config checks](Config_checks.md) for a guide to verify basic pin
settings in the config file.
The Klipper configuration is stored in a simple text file on the host
machine. The [config/example.cfg](../config/example.cfg) file serves
as a reference for the config file. The
as a reference for the config file. See the [Slicers](Slicers.md)
document for information on configuring a slicer with Klipper. See the
[Endstop Phase](Endstop_Phase.md) document for information on
Klipper's "stepper phase adjusted endstop" system. See the
[Delta Calibrate](Delta_Calibrate.md) document for information on
calibrating delta printers. The
[Pressure Advance](Pressure_Advance.md) document contains information
on tuning the pressure advance config.
The [kinematics](Kinematics.md) document provides some technical
details on how Klipper implements motion.
details on how Klipper implements motion. The [FAQ](FAQ.md) answers
some common questions. The [G-Codes](G-Codes.md) document lists
currently supported run-time commands.
The history of Klipper releases is available at
[releases](Releases.md). See [contact](Contact.md) for information on
@@ -25,7 +34,8 @@ Developer Documentation
There are also several documents available for developers interested
in understanding how Klipper works. Start with the
[code overview](Code_Overview.md) document - it provides information
on the structure and layout of the Klipper code.
on the structure and layout of the Klipper code. See the
[contributing](CONTRIBUTING.md) document to submit improvements to Klipper.
See [protocol](Protocol.md) for information on the low-level messaging
protocol between host and micro-controller. See also
@@ -33,6 +43,6 @@ protocol between host and micro-controller. See also
commands implemented in the micro-controller software.
See [debugging](Debugging.md) for information on how to test and debug
Klipper.
See [todo](Todo.md) for information on possible future code features.
Klipper. See [stm32f1](stm32f1.md) for information on the STM32F1
micro-controller port. See [bootloaders](Bootloaders.md) for developer
information on micro-controller flashing.

31
docs/Packaging.md Normal file
View File

@@ -0,0 +1,31 @@
# Packaging klipper
Klipper is somewhat of a packaging anomaly among python programs, as it doesn't
use setuptools to build and install. Some notes regarding how best to package it
are as follows:
## C modules
Klipper uses a C module to handle some kinematics calculations more quickly.
This module needs to be compiled at packaging time to avoid introducing a
runtime dependency on a compiler. To compile the C module, run `python2
klippy/chelper/__init__.py`.
## Compiling python code
Many distributions have a policy of compiling all python code before packaging
to improve startup time. You can do this by running `python2 -m compileall
klippy`.
## Versioning
If you are building a package of Klipper from git, it is usual practice not to
ship a .git directory, so the versioning must be handled without git. To do
this, use the script shipped in `scripts/make_version.py` which should be run as
follows: `python2 scripts/make_version.py YOURDISTRONAME > klippy/.version`.
## Sample packaging script
klipper-git is packaged for Arch Linux, and has a PKGBUILD (package build
script) available at
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=klipper-git.

View File

@@ -1,36 +1,36 @@
This document provides information on tuning the "pressure advance"
configuration variables for a particular nozzle and filament. The
configuration variable for a particular nozzle and filament. The
pressure advance feature can be helpful in reducing ooze. For more
information on how pressure advance is implemented see the
[kinematics](Kinematics.md) document.
Prerequisites
=============
In order to tune the pressure advance setting the printer must be
configured and operational. The tuning test involves printing objects
and inspecting the differences between objects. In particular, the
extruder
[E steps](http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide#E_steps)
and
[nozzle temperature](http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide#Nozzle_Temperature)
should be tuned prior to tuning pressure advance.
Tuning pressure advance
=======================
Pressure advance does two useful things - it reduces ooze during
non-extrude moves and it reduces blobbing during cornering. This guide
uses the second feature (reducing blobbing during cornering) as a
mechanism for measuring and tuning the pressure advance configuration.
mechanism for tuning.
Start by changing the extruder section of the config file so that
pressure_advance is set to 0.0. (Make sure to issue a RESTART command
after each update to the config file so that the new configuration
takes effect.) Then print at least 10 layers of a large hollow square
at high speed (eg, 100mm/s). See
[docs/prints/square.stl](prints/square.stl) file for an STL file that
one may use. While the object is printing, make a note of which
In order to calibrate pressure advance the printer must be configured
and operational. The tuning test involves printing objects and
inspecting the differences between objects. It is a good idea to read
this document in full prior to running the test.
Use a slicer to generate g-code for the large hollow square found in
[docs/prints/square.stl](prints/square.stl). Use a high speed (eg,
100mm/s) and a coarse layer height (the layer height should be around
75% of the nozzle diameter). It is fine to use a low infill (eg, 10%).
Prepare for the test by issuing the following G-Code commands:
`SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1 ACCEL=500` and
`SET_PRESSURE_ADVANCE ADVANCE_LOOKAHEAD_TIME=0`. These commands make
the nozzle travel slower through corners and they emphasize the
effects of extruder pressure.
For the first print use a pressure advance of zero by running
`SET_PRESSURE_ADVANCE ADVANCE=0.000`. Then print at least 10 layers of
the test object. While the object is printing, make a note of which
direction the head is moving during external perimeters. What many
people see here is blobbing occurring at the corners - extra filament
at the corner in the direction the head travels followed by a possible
@@ -41,15 +41,13 @@ lack of filament on the side immediately after that corner:
This blobbing is the result of pressure in the extruder being released
as a blob when the head slows down to corner.
The next step is to set pressure_advance_lookahead_time to 0.0, slowly
increase pressure_advance (eg, start with 0.05), and reprint the test
object. (Be sure to issue RESTART between each config change.) The
goal is to attempt to eliminate the blobbing during cornering. (With
pressure advance, the extruder will retract when the head slows down,
thus countering the pressure buildup and ideally eliminate the
blobbing.)
The next step is to increase pressure advance (start with
`SET_PRESSURE_ADVANCE ADVANCE=0.050`) and reprint the test object.
With pressure advance, the extruder will retract when the head slows
down, thus countering the pressure buildup and ideally eliminate the
blobbing.
If a test run is done with a pressure_advance setting that is too
If a test run is done with a pressure advance setting that is too
high, one typically sees a dimple in the corner followed by possible
blobbing after the corner (too much filament is retracted during slow
down and then too much filament is extruded during the following speed
@@ -57,38 +55,89 @@ up after cornering):
![corner-dimple](img/corner-dimple.jpg)
The goal is to find the smallest pressure_advance value that results
The goal is to find the smallest pressure advance value that results
in good quality corners:
![corner-good](img/corner-good.jpg)
Typical pressure_advance values are between 0.05 and 0.20 (the high
end usually only with bowden extruders).
It is not unusual for one corner of the test print to be consistently
different than the other three corners. This typically occurs when the
slicer arranges to always change Z height at that corner. If this
occurs, then ignore that corner and tune pressure_advance using the
other three corners.
Once a good pressure_advance value is found, return
pressure_advance_lookahead_time to its default (0.010). This parameter
controls how far in advance to check if a head slow-down is
immediately followed by a speed-up - it reduces pointless pressure
changes in the head. It's possible to tune this - higher values will
decrease the number of pressure changes in the nozzle at the expense
of permitting more blobbing during cornering. (Tuning this value is
unlikely to impact ooze.) The default of 10ms should work well on most
printers.
Typical pressure advance values are between 0.050 and 1.000 (the high
end usually only with bowden extruders). If there is no significant
improvement after gradually increasing pressure advance to 1.000, then
pressure advance is unlikely to improve the quality of prints. Return
to a default configuration with pressure advance disabled.
Although this tuning exercise directly improves the quality of
corners, it's worth remembering that a good pressure advance
configuration can reduce ooze throughout the print.
configuration also reduces ooze throughout the print.
Finally, once pressure_advance is tuned in Klipper, it may still be
useful to configure a small retract value in the slicer (eg, 0.75mm)
and to utilize the slicer's "wipe on retract option" if available.
These slicer settings may help counteract ooze caused by filament
cohesion (filament pulled out of the nozzle due to the stickiness of
the plastic). It is recommended to disable the slicer's "z-lift on
retract" option.
At the completion of this test, update the extruder's pressure_advance
setting in the configuration file and issue a RESTART command. The
RESTART command will also return the acceleration, cornering speeds,
and look-ahead times to their normal values.
Important Notes
===============
* The pressure advance value is dependent on the extruder, the nozzle,
and the filament. It is common for filament from different
manufactures or with different pigments to require significantly
different pressure advance values. Therefore, one should calibrate
pressure advance on each printer and with each spool of filament.
* Printing temperature and extrusion rates can impact pressure
advance. Be sure to tune the extruder
[E steps](http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide#E_steps)
and
[nozzle temperature](http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide#Nozzle_Temperature)
prior to tuning pressure advance.
* It is not unusual for one corner of the test print to be
consistently different than the other three corners. This typically
occurs when the slicer arranges to always change Z height at that
corner. If this occurs, then ignore that corner and tune pressure
advance using the other three corners.
* Check for warping at the corners during the test prints (the corners
detaching from the bed and rising a small distance upwards during
the print). If one corner appears warped then ignore that corner
when tuning. If significant warping is seen throughout the test then
typical solutions are to reduce the slicer's first layer speed,
adjust the bed temperature, and/or to use the slicer's brim feature.
Pressure advance itself is unlikely to impact warping, but this
tuning test is sensitive to it.
* If a high pressure advance value (eg, over 0.200) is used then one
may find that the extruder skips when returning to the printer's
normal acceleration. The pressure advance system accounts for
pressure by pushing in extra filament during acceleration and
retracting that filament during deceleration. With a high
acceleration and high pressure advance the extruder may not have
enough torque to push the required filament. If this occurs, either
use a lower acceleration value or disable pressure advance.
* The pressure_advance_lookahead_time parameter controls how far in
advance to check if a head slow-down is immediately followed by a
speed-up - it reduces pointless pressure changes in the head. It is
recommended to follow the steps above so that it is set to zero
during tuning and to use the default (0.010) during normal prints.
It is possible to tune this setting - higher values will reduce the
amount of pressure change in the nozzle during cornering, but
setting it too high can cause blobbing during cornering. (Tuning
this value is unlikely to impact ooze.) The default of 10ms should
work well on most printers.
* Once pressure advance is tuned in Klipper, it may still be useful to
configure a small retract value in the slicer (eg, 0.75mm) and to
utilize the slicer's "wipe on retract option" if available. These
slicer settings may help counteract ooze caused by filament cohesion
(filament pulled out of the nozzle due to the stickiness of the
plastic). It is recommended to disable the slicer's "z-lift on
retract" option.
* Configuring pressure advance results in extra extruder movement
during move acceleration and deceleration. That extra movement is
not further constrained by any other other configuration parameter.
The pressure advance settings only impact extruder movement; they do
not alter toolhead XYZ movement or look-ahead calculations. A change
in pressure advance will not change the path or timing of the
toolhead nor will it change the overall printing time.

View File

@@ -174,20 +174,20 @@ message block:
set_digital_out pin=86 value=1
set_digital_out pin=85 value=0
get_config
get_status
get_clock
```
and encoded into the following eight VLQ integers:
```
<id_set_digital_out><86><1><id_set_digital_out><85><0><id_get_config><id_get_status>
<id_set_digital_out><86><1><id_set_digital_out><85><0><id_get_config><id_get_clock>
```
In order to encode and parse the message contents, both the host and
micro-controller must agree on the command ids and the number of
parameters each command has. So, in the above example, both the host
and micro-controller would know that "id_set_digital_out" is always
followed by two parameters, and "id_get_config" and "id_get_status"
followed by two parameters, and "id_get_config" and "id_get_clock"
have zero parameters. The host and micro-controller share a "data
dictionary" that maps the command descriptions (eg, "set_digital_out
pin=%u value=%c") to their integer command-ids. When processing the

View File

@@ -1,6 +1,71 @@
History of Klipper releases. Please see
[installation](Installation.md) for information on installing Klipper.
Klipper 0.7.0
=============
Available on 20181220. Major changes in this release:
* Klipper now supports "mesh" bed leveling
* New support for "enhanced" delta calibration (calibrates print x/y
dimensions on delta printers)
* Support for run-time configuration of Trinamic stepper motor drivers
(tmc2130, tmc2208, tmc2660)
* Improved temperature sensor support: MAX6675, MAX31855, MAX31856,
MAX31865, custom thermistors, common pt100 style sensors
* Several new modules: temperature_fan, sx1509, force_move, mcp4451,
z_tilt, quad_gantry_level, endstop_phase, bltouch
* Several new commands added: SAVE_CONFIG, SET_PRESSURE_ADVANCE,
SET_GCODE_OFFSET, SET_VELOCITY_LIMIT, STEPPER_BUZZ, TURN_OFF_HEATERS,
M204, custom g-code macros
* Expanded LCD display support:
* Support for run-time menus
* New display icons
* Support for "uc1701" and "ssd1306" displays
* Additional micro-controller support:
* Klipper ported to: LPC176x (Smoothieboards), SAM4E8E (Duet2),
SAMD21 (Arduino Zero), STM32F103 ("Blue pill" devices), atmega32u4
* New Generic USB CDC driver implemented on AVR, LPC176x, SAMD21, and
STM32F103
* Performance improvements on ARM processors
* The kinematics code was rewritten to use an "iterative solver"
* New automatic test cases for the Klipper host software
* Many new example config files for common off-the-shelf printers
* Documentation updates for bootloaders, benchmarking,
micro-controller porting, config checks, pin mapping, slicer
settings, packaging, and more
* Several bug fixes and code cleanups
Klipper 0.6.0
=============
Available on 20180331. Major changes in this release:
* Enhanced heater and thermistor hardware failure checks
* Support for Z probes
* Initial support for automatic parameter calibration on deltas (via a
new delta_calibrate command)
* Initial support for bed tilt compensation (via bed_tilt_calibrate
command)
* Initial support for "safe homing" and homing overrides
* Initial support for displaying status on RepRapDiscount style 2004
and 12864 displays
* New multi-extruder improvements:
* Support for shared heaters
* Initial support for dual carriages
* Support for configuring multiple steppers per axis (eg, dual Z)
* Support for custom digital and pwm output pins (with a new SET_PIN command)
* Initial support for a "virtual sdcard" that allows printing directly
from Klipper (helps on machines too slow to run OctoPrint well)
* Support for setting different arm lengths on each tower of a delta
* Support for G-Code M220/M221 commands (speed factor override /
extrude factor override)
* Several documentation updates:
* Many new example config files for common off-the-shelf printers
* New multiple MCU config example
* New bltouch sensor config example
* New FAQ, config check, and G-Code documents
* Initial support for continuous integration testing on all github commits
* Several bug fixes and code cleanups
Klipper 0.5.0
=============

71
docs/Slicers.md Normal file
View File

@@ -0,0 +1,71 @@
This document provides some tips for configuring a "slicer"
application for use with Klipper. Common slicers used with Klipper are
Slic3r, Cura, Simplify3D, etc.
# Set the G-Code flavor to Marlin
Many slicers have an option to configure the "G-Code flavor". The
default is frequently "Marlin" and that works well with Klipper. The
"Smoothieware" setting also works well with Klipper.
# Klipper gcode_macro
Slicers will often allow one to configure "Start G-Code" and "End
G-Code" sequences. It is often convenient to define custom macros in
the Klipper config file instead - such as: `[gcode_macro START_PRINT]`
and `[gcode_macro END_PRINT]`. Then one can just run START_PRINT and
END_PRINT in the slicer's configuration. Defining these actions in the
Klipper configuration may make it easier to tweak the printer's start
and end steps as changes do not require re-slicing.
See the [example-extras.cfg](../config/example-extras.cfg) file for
details on defining a gcode_macro.
# Large retraction settings may require tuning Klipper
The maximum speed and acceleration of retraction moves are controlled
in Klipper by the `max_extrude_only_velocity` and
`max_extrude_only_accel` config settings. These settings have a
default value that should work well on many printers. However, if one
has configured a large retraction in the slicer (eg, 5mm or greater)
then one may find they limit the desired speed of retractions.
If using a large retraction, consider tuning Klipper's
[pressure advance](Pressure_Advance.md) instead. Otherwise, if one
finds the toolhead seems to "pause" during retraction and priming,
then consider explicitly defining `max_extrude_only_velocity` and
`max_extrude_only_accel` in the Klipper config file.
# Do not enable "coasting"
The "coasting" feature is likely to result in poor quality prints with
Klipper. Consider using Klipper's
[pressure advance](Pressure_Advance.md) instead.
Specifically, if the slicer dramatically changes the extrusion rate
between moves then Klipper will perform deceleration and acceleration
between moves. This is likely to make blobbing worse, not better.
In contrast, it is okay (and often helpful) to use a slicer's
"retract" setting, "wipe" setting, and/or "wipe on retract" setting.
# Disable any "advanced extruder pressure" settings
Some slicers advertise an "advanced extruder pressure" capability. It
is recommended to keep these options disabled when using Klipper as
they are likely to result in poor quality prints. Consider using
Klipper's [pressure advance](Pressure_Advance.md) instead.
Specifically, these slicer settings can instruct the firmware to make
wild changes to the extrusion rate in the hope that the firmware will
approximate those requests and the printer will roughly obtain a
desirable extruder pressure. Klipper, however, utilizes precise
kinematic calculations and timing. When Klipper is commanded to make
significant changes to the extrusion rate it will plan out the
corresponding changes to velocity, acceleration, and extruder
movement - which is not the slicer's intent. The slicer may even
command excessive extrusion rates to the point that it triggers
Klipper's maximum extrusion cross-section check.
In contrast, it is okay (and often helpful) to use a slicer's
"retract" setting, "wipe" setting, and/or "wipe on retract" setting.

View File

@@ -1,92 +0,0 @@
There are several features still to be implemented in Klipper. In no
particular order:
Host user interaction
=====================
* See if there is a better way to report errors. Octoprint sometimes
doesn't highlight an error (one has to look in the terminal tab to
find the error) and errors written to the log can be non-obvious to
a user.
* Improve gcode interface:
* Provide a better way to handle print nozzle z offsets. The M206
command is cryptic to use and it is too easy to set the value
incorrectly or to forget to set it.
* Provide a way to temporarily disable endstop checks so that a user
can issue commands that potentially move the head past
position_min/position_max.
* Improve logging:
* Possibly collate and report the statistics messages in the log in a
more friendly way.
* Possibly support a mechanism for the host to limit maximum velocity
so that the mcu is never requested to step at a higher rate than it
can support.
Safety features
===============
* Support loading a valid step range into the micro-controller
software after homing. This would provide a sanity check in the
micro-controller that would reduce the risk of the host commanding a
stepper motor past its valid step range. To maintain high
efficiency, the micro-controller would only need to check
periodically (eg, every 100ms) that the stepper is in range.
* Possibly support periodically querying the endstop switches and use
multiple step ranges depending on the switch state. This would
enable runtime endstop detection. (However, it's unclear if runtime
endstop detection is a good idea because of spurious signals caused
by electrical noise.)
* Support validating that heaters are heating at expected rates. This
can be useful to detect a sensor failure (eg, thermistor short) that
could otherwise cause the PID to command excessive heating.
Testing features
================
* Complete the host based simulator. It's possible to compile the
micro-controller for a "host simulator", but that simulator doesn't
do anything currently. It would be useful to expand the code to
support more error checks, kinematic simulations, and improved
logging.
Documentation
=============
* Add documentation describing how to perform bed-leveling accurately
in Klipper. Improve description of stepper phase based bed leveling.
Hardware features
=================
* Port to additional micro-controller architectures:
* Smoothieboard / NXP LPC1769 (ARM cortex-M3)
* Support for additional kinematics: scara, etc.
* Support shared motor enable GPIO lines.
* Support for bed-level probes.
* Possible support for touch panels attached to the micro-controller.
(In general, it would be preferable to attach touch panels to the
host system and have octoprint interact with the panel directly, but
it would also be useful to handle panels already hardwired to the
micro-controller.)
Misc features
=============
* Possibly support a "feed forward PID" that takes into account the
amount of plastic being extruded. If the extrude rate changes
significantly during a print it can cause heating bumps that the PID
overcompensates for. The temperature change due to the extrusion
rate could be modeled to eliminate these bumps and make the
extrusion temperature more consistent.

View File

@@ -54,7 +54,6 @@ sudo systemctl start octoprint
Make sure the octoprint web server is accessible - it should be at:
[http://beaglebone:5000/](http://beaglebone:5000/)
Building the micro-controller code
==================================
@@ -72,9 +71,9 @@ make flash
sudo service klipper start
```
For the Replicape, it is also necessary to compile and install the
micro-controller code for a Linux host process. Run "make menuconfig"
a second time and configure it for a "Linux process":
It is also necessary to compile and install the micro-controller code
for a Linux host process. Run "make menuconfig" a second time and
configure it for a "Linux process":
```
make menuconfig
```
@@ -92,3 +91,13 @@ Remaining configuration
Complete the installation by configuring Klipper and Octoprint
following the instructions in
[the main installation document](Installation.md#configuring-klipper).
Printing on the Beaglebone
==========================
Unfortunately, the Beaglebone processor can sometimes struggle to run
OctoPrint well. Print stalls have been known to occur on complex
prints (the printer may move faster than OctoPrint can send movement
commands). If this occurs, consider using the "virtual_sdcard" feature
(see [config/example-extras.cfg](../config/example-extras.cfg) for
details) to print directly from Klipper.

View File

@@ -0,0 +1,37 @@
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

BIN
docs/img/attach-issue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
docs/img/delta-a-pillar.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1,273 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="97.22496mm"
height="32.550285mm"
viewBox="0 0 344.49789 115.33566"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="delta-tower.svg">
<defs
id="defs4">
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker6618"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
id="path6620"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0.0"
refX="0.0"
id="marker6500"
style="overflow:visible;"
inkscape:isstock="true">
<path
id="path6502"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1;fill:#4b4b4b;fill-opacity:1"
transform="scale(0.4) rotate(180) translate(10,0)" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="marker6082"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Mend"
inkscape:collect="always">
<path
transform="scale(0.4) rotate(180) translate(10,0)"
style="fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1;fill:#4b4b4b;fill-opacity:1"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path6084" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Mend"
style="overflow:visible;"
inkscape:isstock="true"
inkscape:collect="always">
<path
id="path5747"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1;fill:#4b4b4b;fill-opacity:1"
transform="scale(0.4) rotate(180) translate(10,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Mstart"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Mstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path5744"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1;fill:#4b4b4b;fill-opacity:1"
transform="scale(0.4) translate(10,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mend-1"
style="overflow:visible"
inkscape:isstock="true"
inkscape:collect="always">
<path
inkscape:connector-curvature="0"
id="path4329-1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.4,0,0,-0.4,-4,0)" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker6082-9"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend"
inkscape:collect="always">
<path
inkscape:connector-curvature="0"
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
id="path6084-2" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.75"
inkscape:cx="172.24895"
inkscape:cy="45.708959"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="928"
inkscape:window-height="628"
inkscape:window-x="162"
inkscape:window-y="50"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
showborder="false"
inkscape:snap-global="false"
showguides="false">
<inkscape:grid
type="xygrid"
id="grid3436" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-135.22429,-249.96955)">
<ellipse
style="fill:#4d4d4d;stroke:#4b4b4b;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:2, 1, 0.5, 1;stroke-dashoffset:0;stroke-opacity:1"
id="path4255"
cx="353.79568"
cy="327.87662"
rx="4.2857141"
ry="4.8571429" />
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000006;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-start:url(#Arrow1Mstart);marker-end:url(#Arrow1Mend)"
d="M 181.50998,381.87664 359.22427,275.01949"
id="path5510"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="371.22427"
y="354.44806"
id="text6058"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan6060"
x="371.22427"
y="354.44806">stepper</tspan><tspan
sodipodi:role="line"
x="371.22427"
y="366.94806"
id="tspan9337">tower</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="166.65283"
y="304.16235"
id="text6062"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan6064"
x="166.65283"
y="304.16235">line of movement</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:10.0000006px;line-height:125%;font-family:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'DejaVu Sans, Normal';font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;"
x="252.93855"
y="384.16235"
id="text6066"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan6068"
x="252.93855"
y="384.16235">move</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000006;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#marker6618)"
d="m 382.65284,344.73378 c -0.19273,-13.52091 -9.87887,-14.83602 -20.57143,-14.85715"
id="path6070"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker6500)"
d="m 254.65284,374.44806 c 3.39239,-12.86009 -2.06023,-20.09154 -15.42857,-22.28571"
id="path6072"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6082)"
d="m 257.50997,296.16234 c 31.05376,-3.13332 32.38959,-1.23784 42.28572,10.28572"
id="path6074"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Mend-1)"
d="m 219.61431,358.80126 57.78715,-34.48307"
id="path3514-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:0.50000003;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 351.22427,323.59092 -20.57143,-32"
id="path3358"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="244.36713"
y="257.30521"
id="text4460"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4462"
x="244.36713"
y="257.30521">virtual tower</tspan><tspan
sodipodi:role="line"
x="244.36713"
y="269.80521"
id="tspan5867">location</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6082-9)"
d="m 310.90661,257.14111 c 21.29088,8.40268 18.35244,16.28958 20.57143,29.7143"
id="path6074-6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -1,241 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64.619751mm"
height="27.45583mm"
viewBox="0 0 228.96762 97.284438"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="virtual-tower.svg">
<defs
id="defs4">
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker6618"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
id="path6620"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0"
refX="0"
id="marker6500"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path6502"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.4,0,0,-0.4,-4,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mend"
style="overflow:visible"
inkscape:isstock="true"
inkscape:collect="always">
<path
id="path5747"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.4,0,0,-0.4,-4,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Mstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path5744"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
transform="matrix(0.4,0,0,0.4,4,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mend-1"
style="overflow:visible"
inkscape:isstock="true"
inkscape:collect="always">
<path
inkscape:connector-curvature="0"
id="path4329-1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.4,0,0,-0.4,-4,0)" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker6082"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend"
inkscape:collect="always">
<path
inkscape:connector-curvature="0"
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
id="path6084" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.75"
inkscape:cx="169.7719"
inkscape:cy="-4.0565054"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="922"
inkscape:window-height="628"
inkscape:window-x="162"
inkscape:window-y="50"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
showborder="false"
inkscape:snap-global="false"
showguides="false">
<inkscape:grid
type="xygrid"
id="grid3436"
originx="-14.085234"
originy="-95.286988" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-149.30952,-172.73378)">
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow1Mstart);marker-end:url(#Arrow1Mend)"
d="m 176.36712,256.16235 200.00001,-0.57143"
id="path5510"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-254.01012"
y="369.20834"
id="text6058"
sodipodi:linespacing="125%"
transform="matrix(-0.01833576,-0.99983189,0.99983189,-0.01833576,0,0)"
inkscape:transform-center-x="-8.0000002"
inkscape:transform-center-y="12.571429"><tspan
sodipodi:role="line"
id="tspan10365"
x="-254.01012"
y="369.20834">virtual tower</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="148.36713"
y="269.87662"
id="text6062"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan6064"
x="148.36713"
y="269.87662">line of movement</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="237.50998"
y="251.01949"
id="text6066"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan6068"
x="237.50998"
y="251.01949">move</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:7.00000048;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 358.08141,255.01949 0,-82.28571"
id="path10351"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 220.36713,255.01949 357.50998,173.30521"
id="path10373"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="200.36713"
y="187.59093"
id="text10375"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan10377"
x="200.36713"
y="187.59093">virtual arm</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6082)"
d="m 261.76375,182.85539 c 22.73118,-0.70136 26.45506,3.7437 40.00001,18.28573"
id="path6074"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Mend-1)"
d="m 219.61431,255.37268 70.93001,0.37408"
id="path3514-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -1,241 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64.619751mm"
height="27.45583mm"
viewBox="0 0 228.96762 97.284438"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="xy+z-tower.svg">
<defs
id="defs4">
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker6618"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
id="path6620"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0"
refX="0"
id="marker6500"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path6502"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.4,0,0,-0.4,-4,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mend"
style="overflow:visible"
inkscape:isstock="true"
inkscape:collect="always">
<path
id="path5747"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.4,0,0,-0.4,-4,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Mstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mstart"
style="overflow:visible"
inkscape:isstock="true">
<path
id="path5744"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
transform="matrix(0.4,0,0,0.4,4,0)"
inkscape:connector-curvature="0" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mend-1"
style="overflow:visible"
inkscape:isstock="true"
inkscape:collect="always">
<path
inkscape:connector-curvature="0"
id="path4329-1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
transform="matrix(-0.4,0,0,-0.4,-4,0)" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker6082"
refX="0"
refY="0"
orient="auto"
inkscape:stockid="Arrow1Mend"
inkscape:collect="always">
<path
inkscape:connector-curvature="0"
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#4b4b4b;fill-opacity:1;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
id="path6084" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.75"
inkscape:cx="169.7719"
inkscape:cy="-4.0565054"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="922"
inkscape:window-height="628"
inkscape:window-x="162"
inkscape:window-y="50"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
showborder="false"
inkscape:snap-global="false"
showguides="false">
<inkscape:grid
type="xygrid"
id="grid3436"
originx="-14.085234"
originy="-95.286988" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-149.30952,-172.73378)">
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#Arrow1Mstart);marker-end:url(#Arrow1Mend)"
d="m 176.36712,256.16235 200.00001,-0.57143"
id="path5510"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-119.27526"
y="434.37329"
id="text6058"
sodipodi:linespacing="125%"
transform="matrix(0.32454206,-0.94587127,0.94587127,0.32454206,0,0)"
inkscape:transform-center-x="-3.9400734"
inkscape:transform-center-y="14.789029"><tspan
sodipodi:role="line"
id="tspan10365"
x="-119.27526"
y="434.37329">virtual tower</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="148.36713"
y="269.87662"
id="text6062"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan6064"
x="148.36713"
y="269.87662">line of movement</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="237.50998"
y="251.01949"
id="text6066"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan6068"
x="237.50998"
y="251.01949">move</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:7.00000048;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 354.70239,255.76769 28.12779,-77.32895"
id="path10351"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 220.36713,255.01949 380.93855,178.44807"
id="path10373"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.00000095px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="200.36713"
y="187.59093"
id="text10375"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan10377"
x="200.36713"
y="187.59093">virtual arm</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#4b4b4b;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6082)"
d="m 261.76375,182.85539 c 22.73118,-0.70136 26.45506,3.7437 40.00001,18.28573"
id="path6074"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Mend-1)"
d="m 219.61431,255.37268 70.93001,0.37408"
id="path3514-5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

2
docs/issue_template.md Normal file
View File

@@ -0,0 +1,2 @@
<!-- Klipper do something undesirable? YOU MUST ATTACH THE KLIPPER LOG FILE.
See: https://github.com/KevinOConnor/klipper/blob/master/docs/Contact.md -->

View File

@@ -0,0 +1,77 @@
// Calibration object for delta sizing
//
// Generate STL using OpenSCAD:
// openscad calibrate_size.scad -o calibrate_size.stl
base_radius = 70;
base_height = 1.5;
base_width = 8;
cylinder_height = 5;
cylinder_radius = 5;
cylinder_outer_dist = 65;
ridge_cut_radius = .5;
text_height = 1;
text_size = 5;
spoke_angles = [0, 60, 120, 180, 240, 300];
CUT=0.01;
// Circular ring around entire object (to help reduce warping)
module base_ring() {
difference() {
cylinder(h=base_height, r=base_radius);
translate([0, 0, -CUT])
cylinder(h=base_height + 2*CUT, r=base_radius-base_width);
}
}
// The base ring plus the base spokes
module base() {
base_ring();
// Spokes
for (angle=spoke_angles)
rotate([0, 0, angle])
translate([-base_width/2, -CUT, 0])
cube([base_width, base_radius-base_width+2*CUT, base_height]);
}
// Cylinder that measurement ridges are cut out of
module measuring_cylinder() {
cut_width = cylinder_radius;
difference() {
cylinder(h=cylinder_height+CUT, r=cylinder_radius, $fn=60);
for (angle=spoke_angles)
rotate([0, 0, angle])
translate([-cut_width, cylinder_radius - ridge_cut_radius, -CUT])
cube([2*cut_width, cut_width, cylinder_height+3*CUT]);
}
}
// All the measuring cylinders around the ring
module measuring_cylinders() {
measuring_cylinder();
for (angle=spoke_angles)
rotate([0, 0, angle])
translate([0, cylinder_outer_dist, 0])
measuring_cylinder();
}
// Text writing
module write_text(angle, dist, msg) {
text_offset = dist + 1 - text_size/2;
rotate([0, 0, angle])
translate([0, text_offset, base_height - CUT])
linear_extrude(height=text_height + CUT)
text(msg, size=text_size, halign="center");
}
// Final object with text descriptions
module calibration_object() {
base();
translate([0, 0, base_height-CUT])
measuring_cylinders();
write_text(120, cylinder_outer_dist - 20, "A");
write_text(240, cylinder_outer_dist - 20, "B");
write_text(0, cylinder_outer_dist - 20, "C");
}
calibration_object();

11622
docs/prints/calibrate_size.stl Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -7,10 +7,39 @@ square_width = 5;
square_size = 60;
square_height = 5;
difference() {
cube([square_size, square_size, square_height]);
translate([square_width, square_width, -1])
cube([square_size-2*square_width, square_size-2*square_width, square_height+2]);
translate([-.5, square_size/2 - 4, -1])
cube([1, 2, square_height+2]);
module hollow_square() {
difference() {
cube([square_size, square_size, square_height]);
translate([square_width, square_width, -1])
cube([square_size-2*square_width, square_size-2*square_width,
square_height+2]);
}
}
module notch() {
CUT = 0.01;
depth = .5;
width = 1;
translate([-depth, -width, -CUT])
cube([2*depth, 2*width, square_height + 2*CUT]);
}
module square_with_notches() {
difference() {
// Start with initial square
hollow_square();
// Remove four notches on inside perimeter
translate([square_width, square_size/2 - 4, 0])
notch();
translate([square_size/2, square_size - square_width, 0])
rotate([0, 0, 90])
notch();
translate([square_size - square_width, square_size/2, 0])
notch();
translate([square_size/2, square_width, 0])
rotate([0, 0, 90])
notch();
}
}
square_with_notches();

View File

@@ -2,20 +2,6 @@ solid OpenSCAD_Model
facet normal -1 0 0
outer loop
vertex 0 0 0
vertex 0 26 5
vertex 0 26 0
endloop
endfacet
facet normal -1 -0 0
outer loop
vertex 0 26 5
vertex 0 0 0
vertex 0 0 5
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0 28 0
vertex 0 60 5
vertex 0 60 0
endloop
@@ -23,92 +9,176 @@ solid OpenSCAD_Model
facet normal -1 -0 0
outer loop
vertex 0 60 5
vertex 0 28 0
vertex 0 28 5
vertex 0 0 0
vertex 0 0 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 5 25 5
vertex 4.5 25 5
vertex 5 5 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 29 5 5
vertex 5 5 5
vertex 29 4.5 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 60 60 5
vertex 55 55 5
vertex 55.5 31 5
vertex 60 0 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 60 60 5
vertex 5 55 5
vertex 55 55 5
vertex 55.5 31 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 60 60 5
vertex 31 55.5 5
vertex 55 55 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 60 60 5
vertex 29 55.5 5
vertex 31 55.5 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 29 55.5 5
vertex 5 55 5
vertex 0.5 28 5
vertex 5 5 5
vertex 29 55 5
endloop
endfacet
facet normal -0 0 1
outer loop
vertex 0 60 5
vertex 5 55 5
vertex 29 55.5 5
vertex 60 60 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0 28 5
vertex 5 55 5
vertex 4.5 27 5
vertex 5 27 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0 0 5
vertex 4.5 27 5
vertex 0 60 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 5 55 5
vertex 0 28 5
vertex 0.5 28 5
vertex 0 60 5
vertex 4.5 27 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 29 55.5 5
vertex 0 60 5
vertex 5 55 5
endloop
endfacet
facet normal -0 0 1
outer loop
vertex 55.5 29 5
vertex 60 0 5
vertex 55.5 31 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 55 5 5
vertex 55.5 29 5
vertex 55 29 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 55.5 29 5
vertex 55 5 5
vertex 60 0 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 31 4.5 5
vertex 55 5 5
vertex 31 5 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 55 5 5
vertex 31 4.5 5
vertex 60 0 5
endloop
endfacet
facet normal -0 0 1
outer loop
vertex 29 4.5 5
vertex 60 0 5
vertex 31 4.5 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0 0 5
vertex 29 4.5 5
vertex 5 5 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 4.5 27 5
vertex 0 0 5
vertex 4.5 25 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 29 4.5 5
vertex 0 0 5
vertex 60 0 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 4.5 25 5
vertex 0 0 5
vertex 5 5 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 55.5 31 5
vertex 55 55 5
endloop
endfacet
facet normal -0 0 1
outer loop
vertex 5 5 5
vertex 60 0 5
vertex 55 5 5
endloop
endfacet
facet normal -0 0 1
outer loop
vertex 0.5 26 5
vertex 5 5 5
vertex 0.5 28 5
endloop
endfacet
facet normal -0 0 1
outer loop
vertex 0 26 5
vertex 5 5 5
vertex 0.5 26 5
vertex 55 31 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 5 5 5
vertex 0 0 5
vertex 60 0 5
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0 0 5
vertex 5 5 5
vertex 0 26 5
vertex 55 55 5
vertex 31 55.5 5
vertex 31 55 5
endloop
endfacet
facet normal 1 -0 0
@@ -139,88 +209,172 @@ solid OpenSCAD_Model
vertex 0 60 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 5 27 0
vertex 4.5 27 0
vertex 5 55 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 29 55 0
vertex 5 55 0
vertex 29 55.5 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 60 0 0
vertex 55 5 0
vertex 55.5 29 0
vertex 60 60 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 60 0 0
vertex 5 5 0
vertex 55 5 0
vertex 55.5 29 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 60 0 0
vertex 31 4.5 0
vertex 55 5 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.5 28 0
vertex 60 0 0
vertex 29 4.5 0
vertex 31 4.5 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 29 4.5 0
vertex 5 5 0
vertex 0.5 26 0
vertex 29 5 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0 0 0
vertex 5 5 0
vertex 29 4.5 0
vertex 60 0 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0 26 0
vertex 5 5 0
vertex 4.5 25 0
vertex 5 25 0
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 4.5 25 0
vertex 0 0 0
vertex 4.5 27 0
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 5 5 0
vertex 0 0 0
vertex 4.5 25 0
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 29 4.5 0
vertex 0 0 0
vertex 5 5 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 55.5 31 0
vertex 60 60 0
vertex 55.5 29 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 55 55 0
vertex 55.5 31 0
vertex 55 31 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 55.5 31 0
vertex 55 55 0
vertex 60 60 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 31 55.5 0
vertex 55 55 0
vertex 31 55 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 55 55 0
vertex 31 55.5 0
vertex 60 60 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 29 55.5 0
vertex 60 60 0
vertex 31 55.5 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0 60 0
vertex 29 55.5 0
vertex 5 55 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0 60 0
vertex 4.5 27 0
vertex 0 0 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 5 5 0
vertex 0 26 0
vertex 0.5 26 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 55 55 0
vertex 60 60 0
vertex 55 5 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 5 55 0
vertex 60 60 0
vertex 55 55 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 5 5 0
vertex 0.5 28 0
vertex 5 55 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0 28 0
vertex 5 55 0
vertex 0.5 28 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 5 55 0
vertex 29 55.5 0
vertex 0 60 0
vertex 60 60 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 4.5 27 0
vertex 0 60 0
vertex 5 55 0
vertex 0 28 0
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 55.5 29 0
vertex 55 5 0
vertex 55 29 0
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 55 5 0
vertex 31 4.5 0
vertex 31 5 0
endloop
endfacet
facet normal 0 -1 0
@@ -240,6 +394,20 @@ solid OpenSCAD_Model
facet normal 1 -0 0
outer loop
vertex 5 5 5
vertex 5 25 0
vertex 5 25 5
endloop
endfacet
facet normal 1 0 0
outer loop
vertex 5 25 0
vertex 5 5 5
vertex 5 5 0
endloop
endfacet
facet normal 1 -0 0
outer loop
vertex 5 27 5
vertex 5 55 0
vertex 5 55 5
endloop
@@ -247,13 +415,27 @@ solid OpenSCAD_Model
facet normal 1 0 0
outer loop
vertex 5 55 0
vertex 5 5 5
vertex 5 5 0
vertex 5 27 5
vertex 5 27 0
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 55 5 0
vertex 55 29 5
vertex 55 29 0
endloop
endfacet
facet normal -1 -0 0
outer loop
vertex 55 29 5
vertex 55 5 0
vertex 55 5 5
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 55 31 0
vertex 55 55 5
vertex 55 55 0
endloop
@@ -261,78 +443,232 @@ solid OpenSCAD_Model
facet normal -1 -0 0
outer loop
vertex 55 55 5
vertex 55 31 0
vertex 55 31 5
endloop
endfacet
facet normal 0 1 -0
outer loop
vertex 29 5 0
vertex 5 5 5
vertex 29 5 5
endloop
endfacet
facet normal 0 1 0
outer loop
vertex 5 5 5
vertex 29 5 0
vertex 5 5 0
endloop
endfacet
facet normal 0 1 -0
outer loop
vertex 55 5 0
vertex 31 5 5
vertex 55 5 5
endloop
endfacet
facet normal 0 1 0
outer loop
vertex 31 5 5
vertex 55 5 0
vertex 31 5 0
endloop
endfacet
facet normal 0 -1 0
outer loop
vertex 5 55 0
vertex 55 55 5
vertex 29 55 5
vertex 5 55 5
endloop
endfacet
facet normal 0 -1 -0
outer loop
vertex 55 55 5
vertex 29 55 5
vertex 5 55 0
vertex 55 55 0
endloop
endfacet
facet normal 0 1 -0
outer loop
vertex 55 5 0
vertex 5 5 5
vertex 55 5 5
endloop
endfacet
facet normal 0 1 0
outer loop
vertex 5 5 5
vertex 55 5 0
vertex 5 5 0
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 0.5 26 0
vertex 0.5 28 5
vertex 0.5 28 0
endloop
endfacet
facet normal -1 -0 0
outer loop
vertex 0.5 28 5
vertex 0.5 26 0
vertex 0.5 26 5
vertex 29 55 0
endloop
endfacet
facet normal 0 -1 0
outer loop
vertex 0 28 0
vertex 0.5 28 5
vertex 0 28 5
vertex 31 55 0
vertex 55 55 5
vertex 31 55 5
endloop
endfacet
facet normal 0 -1 -0
outer loop
vertex 0.5 28 5
vertex 0 28 0
vertex 0.5 28 0
vertex 55 55 5
vertex 31 55 0
vertex 55 55 0
endloop
endfacet
facet normal 1 -0 0
outer loop
vertex 4.5 25 5
vertex 4.5 27 0
vertex 4.5 27 5
endloop
endfacet
facet normal 1 0 0
outer loop
vertex 4.5 27 0
vertex 4.5 25 5
vertex 4.5 25 0
endloop
endfacet
facet normal 0 -1 0
outer loop
vertex 4.5 27 0
vertex 5 27 5
vertex 4.5 27 5
endloop
endfacet
facet normal 0 -1 -0
outer loop
vertex 5 27 5
vertex 4.5 27 0
vertex 5 27 0
endloop
endfacet
facet normal 0 1 -0
outer loop
vertex 0.5 26 0
vertex 0 26 5
vertex 0.5 26 5
vertex 5 25 0
vertex 4.5 25 5
vertex 5 25 5
endloop
endfacet
facet normal 0 1 0
outer loop
vertex 0 26 5
vertex 0.5 26 0
vertex 0 26 0
vertex 4.5 25 5
vertex 5 25 0
vertex 4.5 25 0
endloop
endfacet
facet normal 0 -1 0
outer loop
vertex 29 55.5 0
vertex 31 55.5 5
vertex 29 55.5 5
endloop
endfacet
facet normal 0 -1 -0
outer loop
vertex 31 55.5 5
vertex 29 55.5 0
vertex 31 55.5 0
endloop
endfacet
facet normal 1 -0 0
outer loop
vertex 29 55 5
vertex 29 55.5 0
vertex 29 55.5 5
endloop
endfacet
facet normal 1 0 0
outer loop
vertex 29 55.5 0
vertex 29 55 5
vertex 29 55 0
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 31 55 0
vertex 31 55.5 5
vertex 31 55.5 0
endloop
endfacet
facet normal -1 -0 0
outer loop
vertex 31 55.5 5
vertex 31 55 0
vertex 31 55 5
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 55.5 29 0
vertex 55.5 31 5
vertex 55.5 31 0
endloop
endfacet
facet normal -1 -0 0
outer loop
vertex 55.5 31 5
vertex 55.5 29 0
vertex 55.5 29 5
endloop
endfacet
facet normal 0 -1 0
outer loop
vertex 55 31 0
vertex 55.5 31 5
vertex 55 31 5
endloop
endfacet
facet normal 0 -1 -0
outer loop
vertex 55.5 31 5
vertex 55 31 0
vertex 55.5 31 0
endloop
endfacet
facet normal 0 1 -0
outer loop
vertex 55.5 29 0
vertex 55 29 5
vertex 55.5 29 5
endloop
endfacet
facet normal 0 1 0
outer loop
vertex 55 29 5
vertex 55.5 29 0
vertex 55 29 0
endloop
endfacet
facet normal 0 1 -0
outer loop
vertex 31 4.5 0
vertex 29 4.5 5
vertex 31 4.5 5
endloop
endfacet
facet normal 0 1 0
outer loop
vertex 29 4.5 5
vertex 31 4.5 0
vertex 29 4.5 0
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 31 4.5 0
vertex 31 5 5
vertex 31 5 0
endloop
endfacet
facet normal -1 -0 0
outer loop
vertex 31 5 5
vertex 31 4.5 0
vertex 31 4.5 5
endloop
endfacet
facet normal 1 -0 0
outer loop
vertex 29 4.5 5
vertex 29 5 0
vertex 29 5 5
endloop
endfacet
facet normal 1 0 0
outer loop
vertex 29 5 0
vertex 29 4.5 5
vertex 29 4.5 0
endloop
endfacet
endsolid OpenSCAD_Model

52
docs/stm32f1.md Normal file
View File

@@ -0,0 +1,52 @@
This document describes how the STM32F1 port operates and how it can be used on
STM32-based boards, such as the "Blue Pill". STM32 MCUs are not used on any
Arduino boards, so their restrictions aren't as widely known and less straight
forward compared to common Arduino compatible boards. There aren't any standard
pin mappings either.
General considerations
======================
The STM32 port currently requires an 8 MHz crystal for correct
operation. The port is currently designed for and tested with
STM32F103xB series MCUs, but it should work with any STM32F103 series
MCUs with minimal changes.
Unlike Arduino-based boards, typically there is no automatic reset on serial
connection with STM32 boards. Please use `restart_method: command` with the
STM32F1 port.
Fixed pins
==========
When using serial, the UART used for communication with the host is
fixed to pins PA9 (TX) and PA10 (RX). When using USB, the PA11 (D-)
and PA12 (D+) pins are reserved. The USB code assumes that PA12 (D+)
has a fixed pullup resistor attached to it.
SWD pins (PA13/PA14) are enabled for debugging and cannot be used for
any I/O. SPI uses pins PB13/PB14/PB15, but the pins can be used as
general I/O if SPI is not used.
Digital I/O
===========
All pins that aren't part of the fixed set can be used for digital I/O. Pins are
referred to by their primary name, e.g. `PA1`. Do not try to use Arduino pin
aliases in your configuration. See ST's datasheets for more details. The
[STM32Duino](http://wiki.stm32duino.com/index.php?title=Blue_Pill) wiki has more
info on the popular "Blue Pill" board.
Analog inputs
=============
All ADC-capable pins can be used as analog inputs with the same naming as
digital I/O pins. Small packages MCUs (e.g. LFQP48) have 10 channels (PA0-PA7,
PB0-PB1), while larger package devices have 16 channels (PA0-PA7, PB0-PB1,
PC0-PC5).
SPI
===
SPI uses pin PB13 (SCK), PB14 (MISO) and PB15 (MOSI). The clock speed range is
0.15..18 MHz. Chip select pins do not have any restrictions.

View File

@@ -1,135 +0,0 @@
# Code for handling the kinematics of cartesian robots
#
# Copyright (C) 2016 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import logging
import stepper, homing
StepList = (0, 1, 2)
class CartKinematics:
def __init__(self, toolhead, printer, config):
self.steppers = [stepper.PrinterHomingStepper(
printer, config.getsection('stepper_' + n), n)
for n in ['x', 'y', 'z']]
max_velocity, max_accel = toolhead.get_max_velocity()
self.max_z_velocity = config.getfloat(
'max_z_velocity', max_velocity, above=0., maxval=max_velocity)
self.max_z_accel = config.getfloat(
'max_z_accel', max_accel, above=0., maxval=max_accel)
self.need_motor_enable = True
self.limits = [(1.0, -1.0)] * 3
# Setup stepper max halt velocity
max_halt_velocity = toolhead.get_max_axis_halt()
self.steppers[0].set_max_jerk(max_halt_velocity, max_accel)
self.steppers[1].set_max_jerk(max_halt_velocity, max_accel)
self.steppers[2].set_max_jerk(
min(max_halt_velocity, self.max_z_velocity), max_accel)
def set_position(self, newpos):
for i in StepList:
self.steppers[i].mcu_stepper.set_position(newpos[i])
def home(self, homing_state):
# Each axis is homed independently and in order
for axis in homing_state.get_axes():
s = self.steppers[axis]
self.limits[axis] = (s.position_min, s.position_max)
# Determine moves
if s.homing_positive_dir:
pos = s.position_endstop - 1.5*(
s.position_endstop - s.position_min)
rpos = s.position_endstop - s.homing_retract_dist
r2pos = rpos - s.homing_retract_dist
else:
pos = s.position_endstop + 1.5*(
s.position_max - s.position_endstop)
rpos = s.position_endstop + s.homing_retract_dist
r2pos = rpos + s.homing_retract_dist
# Initial homing
homing_speed = s.get_homing_speed()
homepos = [None, None, None, None]
homepos[axis] = s.position_endstop
coord = [None, None, None, None]
coord[axis] = pos
homing_state.home(list(coord), homepos, [s], homing_speed)
# Retract
coord[axis] = rpos
homing_state.retract(list(coord), homing_speed)
# Home again
coord[axis] = r2pos
homing_state.home(
list(coord), homepos, [s], homing_speed/2.0, second_home=True)
# Set final homed position
coord[axis] = s.position_endstop + s.get_homed_offset()
homing_state.set_homed_position(coord)
def query_endstops(self, print_time, query_flags):
return homing.query_endstops(print_time, query_flags, self.steppers)
def motor_off(self, print_time):
self.limits = [(1.0, -1.0)] * 3
for stepper in self.steppers:
stepper.motor_enable(print_time, 0)
self.need_motor_enable = True
def _check_motor_enable(self, print_time, move):
need_motor_enable = False
for i in StepList:
if move.axes_d[i]:
self.steppers[i].motor_enable(print_time, 1)
need_motor_enable |= self.steppers[i].need_motor_enable
self.need_motor_enable = need_motor_enable
def _check_endstops(self, move):
end_pos = move.end_pos
for i in StepList:
if (move.axes_d[i]
and (end_pos[i] < self.limits[i][0]
or end_pos[i] > self.limits[i][1])):
if self.limits[i][0] > self.limits[i][1]:
raise homing.EndstopMoveError(
end_pos, "Must home axis first")
raise homing.EndstopMoveError(end_pos)
def check_move(self, move):
limits = self.limits
xpos, ypos = move.end_pos[:2]
if (xpos < limits[0][0] or xpos > limits[0][1]
or ypos < limits[1][0] or ypos > limits[1][1]):
self._check_endstops(move)
if not move.axes_d[2]:
# Normal XY move - use defaults
return
# Move with Z - update velocity and accel for slower Z axis
self._check_endstops(move)
z_ratio = move.move_d / abs(move.axes_d[2])
move.limit_speed(
self.max_z_velocity * z_ratio, self.max_z_accel * z_ratio)
def move(self, print_time, move):
if self.need_motor_enable:
self._check_motor_enable(print_time, move)
for i in StepList:
axis_d = move.axes_d[i]
if not axis_d:
continue
mcu_stepper = self.steppers[i].mcu_stepper
move_time = print_time
start_pos = move.start_pos[i]
axis_r = abs(axis_d) / move.move_d
accel = move.accel * axis_r
cruise_v = move.cruise_v * axis_r
# Acceleration steps
if move.accel_r:
accel_d = move.accel_r * axis_d
mcu_stepper.step_const(
move_time, start_pos, accel_d, move.start_v * axis_r, accel)
start_pos += accel_d
move_time += move.accel_t
# Cruising steps
if move.cruise_r:
cruise_d = move.cruise_r * axis_d
mcu_stepper.step_const(
move_time, start_pos, cruise_d, cruise_v, 0.)
start_pos += cruise_d
move_time += move.cruise_t
# Deceleration steps
if move.decel_r:
decel_d = move.decel_r * axis_d
mcu_stepper.step_const(
move_time, start_pos, decel_d, cruise_v, -accel)

View File

@@ -1,6 +1,6 @@
# Wrapper around C helper code
#
# Copyright (C) 2016,2017 Kevin O'Connor <kevin@koconnor.net>
# Copyright (C) 2016-2018 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import os, logging
@@ -11,28 +11,28 @@ import cffi
# c_helper.so compiling
######################################################################
COMPILE_CMD = "gcc -Wall -g -O2 -shared -fPIC -o %s %s"
SOURCE_FILES = ['stepcompress.c', 'serialqueue.c', 'pyhelper.c']
COMPILE_CMD = ("gcc -Wall -g -O2 -shared -fPIC"
" -flto -fwhole-program -fno-use-linker-plugin"
" -o %s %s")
SOURCE_FILES = [
'pyhelper.c', 'serialqueue.c', 'stepcompress.c', 'itersolve.c',
'kin_cartesian.c', 'kin_corexy.c', 'kin_delta.c', 'kin_extruder.c'
]
DEST_LIB = "c_helper.so"
OTHER_FILES = ['list.h', 'serialqueue.h', 'pyhelper.h']
OTHER_FILES = [
'list.h', 'serialqueue.h', 'stepcompress.h', 'itersolve.h', 'pyhelper.h'
]
defs_stepcompress = """
struct stepcompress *stepcompress_alloc(uint32_t max_error
, uint32_t queue_step_msgid, uint32_t set_next_step_dir_msgid
, uint32_t invert_sdir, uint32_t oid);
struct stepcompress *stepcompress_alloc(uint32_t oid);
void stepcompress_fill(struct stepcompress *sc, uint32_t max_error
, uint32_t invert_sdir, uint32_t queue_step_msgid
, uint32_t set_next_step_dir_msgid);
void stepcompress_free(struct stepcompress *sc);
int stepcompress_reset(struct stepcompress *sc, uint64_t last_step_clock);
int stepcompress_set_homing(struct stepcompress *sc, uint64_t homing_clock);
int stepcompress_queue_msg(struct stepcompress *sc, uint32_t *data, int len);
int32_t stepcompress_push(struct stepcompress *sc, double step_clock
, int32_t sdir);
int32_t stepcompress_push_const(struct stepcompress *sc, double clock_offset
, double step_offset, double steps, double start_sv, double accel);
int32_t stepcompress_push_delta(struct stepcompress *sc
, double clock_offset, double move_sd, double start_sv, double accel
, double height, double startxy_sd, double arm_d, double movez_r);
struct steppersync *steppersync_alloc(struct serialqueue *sq
, struct stepcompress **sc_list, int sc_num, int move_num);
void steppersync_free(struct steppersync *ss);
@@ -41,6 +41,43 @@ defs_stepcompress = """
int steppersync_flush(struct steppersync *ss, uint64_t move_clock);
"""
defs_itersolve = """
struct move *move_alloc(void);
void move_fill(struct move *m, double print_time
, double accel_t, double cruise_t, double decel_t
, double start_pos_x, double start_pos_y, double start_pos_z
, double axes_d_x, double axes_d_y, double axes_d_z
, double start_v, double cruise_v, double accel);
int32_t itersolve_gen_steps(struct stepper_kinematics *sk, struct move *m);
void itersolve_set_stepcompress(struct stepper_kinematics *sk
, struct stepcompress *sc, double step_dist);
double itersolve_calc_position_from_coord(struct stepper_kinematics *sk
, double x, double y, double z);
void itersolve_set_commanded_pos(struct stepper_kinematics *sk, double pos);
double itersolve_get_commanded_pos(struct stepper_kinematics *sk);
"""
defs_kin_cartesian = """
struct stepper_kinematics *cartesian_stepper_alloc(char axis);
"""
defs_kin_corexy = """
struct stepper_kinematics *corexy_stepper_alloc(char type);
"""
defs_kin_delta = """
struct stepper_kinematics *delta_stepper_alloc(double arm2
, double tower_x, double tower_y);
"""
defs_kin_extruder = """
struct stepper_kinematics *extruder_stepper_alloc(void);
void extruder_move_fill(struct move *m, double print_time
, double accel_t, double cruise_t, double decel_t, double start_pos
, double start_v, double cruise_v, double accel
, double extra_accel_v, double extra_decel_v);
"""
defs_serialqueue = """
#define MESSAGE_MAX 64
struct pull_queue_message {
@@ -56,11 +93,11 @@ defs_serialqueue = """
void serialqueue_free_commandqueue(struct command_queue *cq);
void serialqueue_send(struct serialqueue *sq, struct command_queue *cq
, uint8_t *msg, int len, uint64_t min_clock, uint64_t req_clock);
void serialqueue_encode_and_send(struct serialqueue *sq
, struct command_queue *cq, uint32_t *data, int len
, uint64_t min_clock, uint64_t req_clock);
void serialqueue_pull(struct serialqueue *sq, struct pull_queue_message *pqm);
void serialqueue_pull(struct serialqueue *sq
, struct pull_queue_message *pqm);
void serialqueue_set_baud_adjust(struct serialqueue *sq, double baud_adjust);
void serialqueue_set_receive_window(struct serialqueue *sq
, int receive_window);
void serialqueue_set_clock_est(struct serialqueue *sq, double est_freq
, double last_clock_time, uint64_t last_clock);
void serialqueue_get_stats(struct serialqueue *sq, char *buf, int len);
@@ -73,6 +110,15 @@ defs_pyhelper = """
double get_monotonic(void);
"""
defs_std = """
void free(void*);
"""
defs_all = [
defs_pyhelper, defs_serialqueue, defs_std, defs_stepcompress, defs_itersolve,
defs_kin_cartesian, defs_kin_corexy, defs_kin_delta, defs_kin_extruder
]
# Return the list of file modification times
def get_mtimes(srcdir, filelist):
out = []
@@ -107,9 +153,8 @@ def get_ffi():
check_build_code(srcdir, DEST_LIB, SOURCE_FILES, COMPILE_CMD
, OTHER_FILES)
FFI_main = cffi.FFI()
FFI_main.cdef(defs_stepcompress)
FFI_main.cdef(defs_serialqueue)
FFI_main.cdef(defs_pyhelper)
for d in defs_all:
FFI_main.cdef(d)
FFI_lib = FFI_main.dlopen(os.path.join(srcdir, DEST_LIB))
# Setup error logging
def logging_callback(msg):
@@ -126,7 +171,7 @@ def get_ffi():
HC_COMPILE_CMD = "gcc -Wall -g -O2 -o %s %s -lusb"
HC_SOURCE_FILES = ['hub-ctrl.c']
HC_SOURCE_DIR = '../lib/hub-ctrl'
HC_SOURCE_DIR = '../../lib/hub-ctrl'
HC_TARGET = "hub-ctrl"
HC_CMD = "sudo %s/hub-ctrl -h 0 -P 2 -p %d"
@@ -135,3 +180,7 @@ def run_hub_ctrl(enable_power):
hubdir = os.path.join(srcdir, HC_SOURCE_DIR)
check_build_code(hubdir, HC_TARGET, HC_SOURCE_FILES, HC_COMPILE_CMD)
os.system(HC_CMD % (hubdir, enable_power))
if __name__ == '__main__':
get_ffi()

46
klippy/chelper/compiler.h Normal file
View File

@@ -0,0 +1,46 @@
#ifndef __COMPILER_H
#define __COMPILER_H
// Low level definitions for C languange and gcc compiler.
#define barrier() __asm__ __volatile__("": : :"memory")
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#define noinline __attribute__((noinline))
#ifndef __always_inline
#define __always_inline inline __attribute__((always_inline))
#endif
#define __visible __attribute__((externally_visible))
#define __noreturn __attribute__((noreturn))
#define PACKED __attribute__((packed))
#ifndef __aligned
#define __aligned(x) __attribute__((aligned(x)))
#endif
#ifndef __section
#define __section(S) __attribute__((section(S)))
#endif
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
#define ALIGN_DOWN(x,a) ((x) & ~((typeof(x))(a)-1))
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
#define __stringify_1(x) #x
#define __stringify(x) __stringify_1(x)
#define ___PASTE(a,b) a##b
#define __PASTE(a,b) ___PASTE(a,b)
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define DIV_ROUND_CLOSEST(x, divisor)({ \
typeof(divisor) __divisor = divisor; \
(((x) + ((__divisor) / 2)) / (__divisor)); \
})
#endif // compiler.h

238
klippy/chelper/itersolve.c Normal file
View File

@@ -0,0 +1,238 @@
// Iterative solver for kinematic moves
//
// Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net>
//
// This file may be distributed under the terms of the GNU GPLv3 license.
#include <math.h> // sqrt
#include <stdlib.h> // malloc
#include <string.h> // memset
#include "compiler.h" // __visible
#include "itersolve.h" // struct coord
#include "pyhelper.h" // errorf
#include "stepcompress.h" // queue_append_start
/****************************************************************
* Kinematic moves
****************************************************************/
struct move * __visible
move_alloc(void)
{
struct move *m = malloc(sizeof(*m));
memset(m, 0, sizeof(*m));
return m;
}
// Populate a 'struct move' with a velocity trapezoid
void __visible
move_fill(struct move *m, double print_time
, double accel_t, double cruise_t, double decel_t
, double start_pos_x, double start_pos_y, double start_pos_z
, double axes_d_x, double axes_d_y, double axes_d_z
, double start_v, double cruise_v, double accel)
{
// Setup velocity trapezoid
m->print_time = print_time;
m->move_t = accel_t + cruise_t + decel_t;
m->accel_t = accel_t;
m->cruise_t = cruise_t;
m->cruise_start_d = accel_t * .5 * (cruise_v + start_v);
m->decel_start_d = m->cruise_start_d + cruise_t * cruise_v;
// Setup for accel/cruise/decel phases
m->cruise_v = cruise_v;
m->accel.c1 = start_v;
m->accel.c2 = .5 * accel;
m->decel.c1 = cruise_v;
m->decel.c2 = -m->accel.c2;
// Setup for move_get_coord()
m->start_pos.x = start_pos_x;
m->start_pos.y = start_pos_y;
m->start_pos.z = start_pos_z;
double inv_move_d = 1. / sqrt(axes_d_x*axes_d_x + axes_d_y*axes_d_y
+ axes_d_z*axes_d_z);
m->axes_r.x = axes_d_x * inv_move_d;
m->axes_r.y = axes_d_y * inv_move_d;
m->axes_r.z = axes_d_z * inv_move_d;
}
// Find the distance travel during acceleration/deceleration
static inline double
move_eval_accel(struct move_accel *ma, double move_time)
{
return (ma->c1 + ma->c2 * move_time) * move_time;
}
// Return the distance moved given a time in a move
inline double
move_get_distance(struct move *m, double move_time)
{
if (unlikely(move_time < m->accel_t))
// Acceleration phase of move
return move_eval_accel(&m->accel, move_time);
move_time -= m->accel_t;
if (likely(move_time <= m->cruise_t))
// Cruising phase
return m->cruise_start_d + m->cruise_v * move_time;
// Deceleration phase
move_time -= m->cruise_t;
return m->decel_start_d + move_eval_accel(&m->decel, move_time);
}
// Return the XYZ coordinates given a time in a move
inline struct coord
move_get_coord(struct move *m, double move_time)
{
double move_dist = move_get_distance(m, move_time);
return (struct coord) {
.x = m->start_pos.x + m->axes_r.x * move_dist,
.y = m->start_pos.y + m->axes_r.y * move_dist,
.z = m->start_pos.z + m->axes_r.z * move_dist };
}
/****************************************************************
* Iterative solver
****************************************************************/
struct timepos {
double time, position;
};
// Find step using "false position" method
static struct timepos
itersolve_find_step(struct stepper_kinematics *sk, struct move *m
, struct timepos low, struct timepos high
, double target)
{
sk_callback calc_position = sk->calc_position;
struct timepos best_guess = high;
low.position -= target;
high.position -= target;
if (!high.position)
// The high range was a perfect guess for the next step
return best_guess;
int high_sign = signbit(high.position);
if (high_sign == signbit(low.position))
// The target is not in the low/high range - return low range
return (struct timepos){ low.time, target };
for (;;) {
double guess_time = ((low.time*high.position - high.time*low.position)
/ (high.position - low.position));
if (fabs(guess_time - best_guess.time) <= .000000001)
break;
best_guess.time = guess_time;
best_guess.position = calc_position(sk, m, guess_time);
double guess_position = best_guess.position - target;
int guess_sign = signbit(guess_position);
if (guess_sign == high_sign) {
high.time = guess_time;
high.position = guess_position;
} else {
low.time = guess_time;
low.position = guess_position;
}
}
return best_guess;
}
// Generate step times for a stepper during a move
int32_t __visible
itersolve_gen_steps(struct stepper_kinematics *sk, struct move *m)
{
struct stepcompress *sc = sk->sc;
sk_callback calc_position = sk->calc_position;
double half_step = .5 * sk->step_dist;
double mcu_freq = stepcompress_get_mcu_freq(sc);
struct timepos last = { 0., sk->commanded_pos }, low = last, high = last;
double seek_time_delta = 0.000100;
int sdir = stepcompress_get_step_dir(sc);
struct queue_append qa = queue_append_start(sc, m->print_time, .5);
for (;;) {
// Determine if next step is in forward or reverse direction
double dist = high.position - last.position;
if (fabs(dist) < half_step) {
seek_new_high_range:
if (high.time >= m->move_t)
// At end of move
break;
// Need to increase next step search range
low = high;
high.time = last.time + seek_time_delta;
seek_time_delta += seek_time_delta;
if (high.time > m->move_t)
high.time = m->move_t;
high.position = calc_position(sk, m, high.time);
continue;
}
int next_sdir = dist > 0.;
if (unlikely(next_sdir != sdir)) {
// Direction change
if (fabs(dist) < half_step + .000000001)
// Only change direction if going past midway point
goto seek_new_high_range;
if (last.time >= low.time && high.time > last.time) {
// Must seek new low range to avoid re-finding previous time
high.time = (last.time + high.time) * .5;
high.position = calc_position(sk, m, high.time);
continue;
}
int ret = queue_append_set_next_step_dir(&qa, next_sdir);
if (ret)
return ret;
sdir = next_sdir;
}
// Find step
double target = last.position + (sdir ? half_step : -half_step);
struct timepos next = itersolve_find_step(sk, m, low, high, target);
// Add step at given time
int ret = queue_append(&qa, next.time * mcu_freq);
if (ret)
return ret;
seek_time_delta = next.time - last.time;
if (seek_time_delta < .000000001)
seek_time_delta = .000000001;
last.position = target + (sdir ? half_step : -half_step);
last.time = next.time;
low = next;
if (last.time >= high.time)
// The high range is no longer valid - recalculate it
goto seek_new_high_range;
}
queue_append_finish(qa);
sk->commanded_pos = last.position;
return 0;
}
void __visible
itersolve_set_stepcompress(struct stepper_kinematics *sk
, struct stepcompress *sc, double step_dist)
{
sk->sc = sc;
sk->step_dist = step_dist;
}
double __visible
itersolve_calc_position_from_coord(struct stepper_kinematics *sk
, double x, double y, double z)
{
struct move m;
memset(&m, 0, sizeof(m));
move_fill(&m, 0., 0., 1., 0., x, y, z, 0., 1., 0., 0., 1., 0.);
return sk->calc_position(sk, &m, 0.);
}
void __visible
itersolve_set_commanded_pos(struct stepper_kinematics *sk, double pos)
{
sk->commanded_pos = pos;
}
double __visible
itersolve_get_commanded_pos(struct stepper_kinematics *sk)
{
return sk->commanded_pos;
}

View File

@@ -0,0 +1,49 @@
#ifndef ITERSOLVE_H
#define ITERSOLVE_H
#include <stdint.h> // uint32_t
struct coord {
double x, y, z;
};
struct move_accel {
double c1, c2;
};
struct move {
double print_time, move_t;
double accel_t, cruise_t;
double cruise_start_d, decel_start_d;
double cruise_v;
struct move_accel accel, decel;
struct coord start_pos, axes_r;
};
struct move *move_alloc(void);
void move_fill(struct move *m, double print_time
, double accel_t, double cruise_t, double decel_t
, double start_pos_x, double start_pos_y, double start_pos_z
, double axes_d_x, double axes_d_y, double axes_d_z
, double start_v, double cruise_v, double accel);
double move_get_distance(struct move *m, double move_time);
struct coord move_get_coord(struct move *m, double move_time);
struct stepper_kinematics;
typedef double (*sk_callback)(struct stepper_kinematics *sk, struct move *m
, double move_time);
struct stepper_kinematics {
double step_dist, commanded_pos;
struct stepcompress *sc;
sk_callback calc_position;
};
int32_t itersolve_gen_steps(struct stepper_kinematics *sk, struct move *m);
void itersolve_set_stepcompress(struct stepper_kinematics *sk
, struct stepcompress *sc, double step_dist);
double itersolve_calc_position_from_coord(struct stepper_kinematics *sk
, double x, double y, double z);
void itersolve_set_commanded_pos(struct stepper_kinematics *sk, double pos);
double itersolve_get_commanded_pos(struct stepper_kinematics *sk);
#endif // itersolve.h

View File

@@ -0,0 +1,46 @@
// Cartesian kinematics stepper pulse time generation
//
// Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net>
//
// This file may be distributed under the terms of the GNU GPLv3 license.
#include <stdlib.h> // malloc
#include <string.h> // memset
#include "compiler.h" // __visible
#include "itersolve.h" // move_get_coord
#include "pyhelper.h" // errorf
static double
cart_stepper_x_calc_position(struct stepper_kinematics *sk, struct move *m
, double move_time)
{
return move_get_coord(m, move_time).x;
}
static double
cart_stepper_y_calc_position(struct stepper_kinematics *sk, struct move *m
, double move_time)
{
return move_get_coord(m, move_time).y;
}
static double
cart_stepper_z_calc_position(struct stepper_kinematics *sk, struct move *m
, double move_time)
{
return move_get_coord(m, move_time).z;
}
struct stepper_kinematics * __visible
cartesian_stepper_alloc(char axis)
{
struct stepper_kinematics *sk = malloc(sizeof(*sk));
memset(sk, 0, sizeof(*sk));
if (axis == 'x')
sk->calc_position = cart_stepper_x_calc_position;
else if (axis == 'y')
sk->calc_position = cart_stepper_y_calc_position;
else if (axis == 'z')
sk->calc_position = cart_stepper_z_calc_position;
return sk;
}

View File

@@ -0,0 +1,38 @@
// CoreXY kinematics stepper pulse time generation
//
// Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net>
//
// This file may be distributed under the terms of the GNU GPLv3 license.
#include <stdlib.h> // malloc
#include <string.h> // memset
#include "compiler.h" // __visible
#include "itersolve.h" // struct stepper_kinematics
static double
corexy_stepper_plus_calc_position(struct stepper_kinematics *sk, struct move *m
, double move_time)
{
struct coord c = move_get_coord(m, move_time);
return c.x + c.y;
}
static double
corexy_stepper_minus_calc_position(struct stepper_kinematics *sk, struct move *m
, double move_time)
{
struct coord c = move_get_coord(m, move_time);
return c.x - c.y;
}
struct stepper_kinematics * __visible
corexy_stepper_alloc(char type)
{
struct stepper_kinematics *sk = malloc(sizeof(*sk));
memset(sk, 0, sizeof(*sk));
if (type == '+')
sk->calc_position = corexy_stepper_plus_calc_position;
else if (type == '-')
sk->calc_position = corexy_stepper_minus_calc_position;
return sk;
}

Some files were not shown because too many files have changed in this diff Show More