Commit Graph

59 Commits

Author SHA1 Message Date
Kevin O'Connor db6346e7e5 serialqueue: Improve canbus timing
Adjust timing based on the minimum transmission time of canbus
messages.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-29 11:40:54 -04:00
Kevin O'Connor 9ec9742484 extruder: Add support for reversing the direction of extruder stepper movement
Extend SET_EXTRUDER_ROTATION_DISTANCE to support reversing the
direction of extruder movement.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-02-10 13:24:21 -05:00
Kevin O'Connor 29724a7411 extruder: Don't store pressure_advance value in trapq moves
Store the pressure_advance value in "struct extruder_stepper" instead
of in the trapq's "struct move".  This makes it possible for multiple
stepper motors to have different pressure advance values while still
using the same trapq.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:01:15 -05:00
Dmitry Butyugin 54e21a7c26 input_shaper: Factored out AxisInputShaper class
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-26 16:14:50 -04:00
Dmitry Butyugin d5a7a7f00f input_shaper: Define input shapers in a single place in Python code
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-26 16:14:50 -04:00
Kevin O'Connor b17ec3d2e9 stepcompress: Pass clock to stepcompress_set_last_position()
Using sc->last_step_clock for the last position marker does not work
properly, because the stepper.py code calls stepcompress_reset() prior
to calling stepcompress_set_last_position().  Fix by passing an
explicit clock to stepcompress_set_last_position().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-06 11:19:36 -04:00
Kevin O'Connor 7013a7b15f stepcompress: Support extracting stepcompress history
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00
Kevin O'Connor 07f0ecb4d0 trapq: Store toolhead.set_position() updates in trapq history
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00
Kevin O'Connor 45c232b2c7 trapq: Keep history of recent trapq moves
Store trapq moves in a separate "history" list after each move is
nominally expired.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00
Kevin O'Connor e2f483aea3 trapq: Rename trapq_free_moves() to trapq_finalize_moves()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00
Tircown 4d559633e3
kinematics: Add dual_carriage to hybrid-corexyz (#4296)
- Add dual_carriage abilities for hybrid-corexy and hybrid-corexz
- Introduce the module idex_mode
- Fix add_stepper to the correct rail in hybrid-corexy

Signed-off-by: Fabrice GALLET <tircown@gmail.com>
2021-06-27 18:37:05 -04:00
Kevin O'Connor e1f7748e1a trdispatch: Support fast responses to trsync_state messages
Add C code that can process trsync_state messages and dispatch
responses with low-latency.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-06-09 18:58:35 -04:00
Kevin O'Connor 620f77ddb7 msgblock: Add clock estimation helper functions
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-06-09 18:58:35 -04:00
Kevin O'Connor 1865080a07 msgblock: Move message manipulation code from serialqueue.c to new msgblock.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-06-09 18:58:35 -04:00
Kevin O'Connor 2559a2dd5a pollreactor: Move C pollreactor code from serialqueue.c to its own file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-06-09 18:58:35 -04:00
Kevin O'Connor 81428265bd stepcompress: Add support for tracking history of queue_step commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-13 15:19:43 -05:00
Kevin O'Connor 8b4ad34e22 serialqueue: Support sending messages over a CAN bus
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-13 11:29:41 -05:00
Kevin O'Connor 70a1b752c9 chelper: Move logging_callback() to global scope
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-01 13:30:02 -05:00
Kevin O'Connor 81da5379d4 buildcommands: Extend number of available mcu messages from 96 to 128
Some internal code treats the message ids as encoded "variable length
quantities", while other internal code assumes the message id is
always one byte long.  Continue using this scheme, but convert the VLQ
users to use the name "msgtag" while the 1-byte users use "msgid".
Increase the number of available msgids from 96 to 127 - the higher
values get encoded as negative "msgtags".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-18 15:21:32 -05:00
Kevin O'Connor 1049282eec chelper: Fix check for failed code build
Commit 73b78af6 inadvertently removed the check for a successful gcc
compilation.  Add the check back in.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-02-07 20:48:21 -05:00
Kevin O'Connor 04b822c3aa chelper: Use standard C type definition for pyhelper_logging_callback
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-09-26 20:15:21 -04:00
Kevin O'Connor 73b78af6b2 chelper: Rework check for building C code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-09-26 20:15:10 -04:00
Kevin O'Connor a92d995727 chelper: Set compiler flags to never use "x387" floating point math
The default on X86 32bit machines is to use 80bit floating point math
(as found in the ancient "387 coprocessor").  This can cause numerical
stability problems.  Set the compiler flags to make sure the newer SSE
math is always used on X86.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-09-15 17:12:53 -04:00
Voron 9213646c63
corexz: Add CoreXZ kinematics (#3129)
Add a CoreXZ kinematics

Signed-off-by: Maks Zolin <mzolin@vorondesign.com>
2020-07-30 12:42:23 -04:00
Dmitry Butyugin 4bdc11a8b3
input_shaper: Initial support of input shaping (#3032)
Input shaping can help to reduce printer vibrations due to resonances
and eliminate or reduce ghosting in prints.

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2020-07-05 20:54:38 -04:00
Kevin O'Connor c6c360c4e1 serialqueue: Support notification of when a command is processed
Add ability for the host code to get a notification when the ack for a
command sent to the micro-controller is received.  This is in
preparation for improved detection of message loss between mcu and
host.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-02-20 12:01:21 -05:00
Kevin O'Connor d1972b1e9c itersolve: Add ability to query the active_flags state
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-23 20:47:01 -05:00
Kevin O'Connor ac863a95b6 rotary_delta: Initial support for rotary delta kinematics
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:52:42 -05:00
Kevin O'Connor e43ad4c953 itersolve: Export itersolve_calc_position_from_coord()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-01-06 11:49:41 -05:00
Kevin O'Connor 080ee0b512 kin_extruder: Apply pressure advance in kin_extruder.c
Implement the pressure advance calculations while performing the
definitive integral calculations.  This simplifies both the
extruder.py and kin_extruder.c code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-12-08 20:41:35 -05:00
Kevin O'Connor 6d0c55b6c1 extruder: Initial support for "smoothed pressure advance"
Support averaging the extruder position over a time range to "smooth
out" the velocity changes that occur during pressure advance.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-21 13:18:19 -05:00
Kevin O'Connor d39142139e stepper: Remove set_commanded_position() call
Now that the only caller to set_commanded_position() is
set_position(), remove the set_commanded_position() method and pass
the set_position() call directly to the itersolve.c code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-13 19:35:26 -05:00
Kevin O'Connor f63f68bbbb chelper: Report an error if the C host code does not compile
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-07 11:32:20 -05:00
Kevin O'Connor 86121ff79e toolhead: Calculate and store axes_r in move class
Calculate the ratio of axis distance to total move distance (axis_d /
move_d) and store in a new member variable axes_r.  This avoids
needing to recalculate the value in other code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 076a66f791 trapq: Use separate 'move' entries for accel, cruise, and decel phases
Only track a single acceleration movement in a 'struct move' instance.
Break the classic trapezoid movement (accel, cruise, decel) into three
separate movements.  This simplifies the calculation logic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 1acaaa98c2 trapq: Remove move_fill()
Now that all callers use the trapq system to queue moves, it is no
longer necessary to individually allocate and fill a 'struct move'.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 797dcfcb12 itersolve: Remove unused gen_steps()
Eliminate the old gen_steps() call now that all callers have been
converted to the newer trapq based generate_steps().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor f3ef9c1889 itersolve: Add support for generating steps from a trapq
Support associating a stepper_kinematics with a trapq.  Support
generating steps from a time range on the given trapq.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor d3afe4f1d8 trapq: Initial support for building a queue of trapezoidal velocity moves
Add support for building a list of moves in the trapq.c code.  Update
the toolhead code so that moves generated from the look-ahead code are
added to that list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor fdbdb3c707 trapq: Add new trapq.c file with code for trapezoidal velocity handling
Move the "struct move" code from itersolve.c to new file trapq.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor c3fe3d0d2c stepcompress: Remove no longer needed stepcompress_set_homing()
Now that homing is implemented via "drip moves", it is no longer
necessary for the stepcompress code to have special homing logic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor af882ee0fe chelper: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:20:57 -05:00
Kevin O'Connor 5dc74f3152 winch: Add experimental support for cable winch kinematics
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-24 11:38:59 -05:00
Kevin O'Connor ec9cb3a1b3 polar: Experimental support for polar kinematics
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-24 11:38:59 -05: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
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 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 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 bbe53cf8e5 extruder: Convert to using iterative solver
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-20 09:26:10 -04:00