aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/stepcompress.c
Commit message (Collapse)AuthorAgeFilesLines
* stepcompress: Pass clock to stepcompress_set_last_position()Kevin O'Connor2021-08-061-2/+3
| | | | | | | | | 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>
* stepcompress: Support extracting stepcompress historyKevin O'Connor2021-07-291-4/+35
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Rename 'struct history_move' to 'struct history_steps'Kevin O'Connor2021-07-291-25/+25
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Improve numerical stability of step+dir+step filterKevin O'Connor2021-04-111-1/+1
| | | | | | | Apply the step+dir+step filter even if, for some reason, a negative time is found. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Add support for tracking history of queue_step commandsKevin O'Connor2021-03-131-27/+116
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Extend number of available mcu messages from 96 to 128Kevin O'Connor2021-02-181-9/+10
| | | | | | | | | | | 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>
* stepcompress: Implement a step+dir+step filterKevin O'Connor2020-03-131-27/+86
| | | | | | | | | | Some stepper motor drivers do not respond well to rapid "step + direction change + step" events. In particular, it is believed this can cause "over current" events on the tmc2208 drivers when they are in "stealthchop" mode. Detect these events and remove them from the generated step times. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Move code around in stepcompress.cKevin O'Connor2020-03-131-49/+49
| | | | | | Just code movement - no code changes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Remove "queue append" abstractionKevin O'Connor2020-03-041-66/+30
| | | | | | | | | | The queue_append system predates the iterative solver - it was useful when many different kinematic functions directly added steps to the step compression queues. With the iterative solver being the only source of step generation, it is simpler to directly add steps from the iterative solver code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Fix rounding error when interval=0Kevin O'Connor2020-01-251-2/+2
| | | | | | | | | In the rare case where the step generation code finds an interval of zero, it was possible for an integer division of a negative number to cause an incorrect result. Fix that by using the idiv_up() and idiv_down() helpers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Remove no longer needed stepcompress_set_homing()Kevin O'Connor2019-07-101-20/+3
| | | | | | | 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>
* stepcompress: Wrap code to 80 columnsKevin O'Connor2019-02-271-3/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kin_cartesian: Remove stepcompress_push_const()Kevin O'Connor2018-06-201-1/+1
| | | | | | | 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>
* itersolve: Add kinematic iterative solver codeKevin O'Connor2018-06-201-0/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Allow stepcompress_alloc() to be called earlyKevin O'Connor2018-06-201-7/+13
| | | | | | Don't require an mcu connection to allocate the stepcompress object. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* chelper: Move cartesian and delta kinematics code to their own C filesKevin O'Connor2018-06-201-242/+17
| | | | | | | 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>
* chelper: Compile with gcc -fwhole-program optionKevin O'Connor2018-06-201-13/+13
| | | | | | | 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>
* chelper: Add compiler.h headerKevin O'Connor2018-06-201-4/+3
| | | | | | | 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>
* stepcompress: Fix comment typo.Michael Barbour2018-06-041-1/+1
| | | | Signed-off-by: Michael Barbour <barbour.michael.0@gmail.com>
* chelper: Move the host C code to a new klippy/chelper/ directoryKevin O'Connor2018-04-301-0/+852
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>