Commit Graph

663 Commits

Author SHA1 Message Date
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
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 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
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
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 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 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
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
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 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 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 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