Commit 0f94f6c8 decreased the MAX_HEAT_TIME from 5 seconds to 3
seconds. However, that also decreased the amount of tolerance for
lost temperature updates from 1.25 seconds to 0.75 seconds. With the
default temperature update every 300ms, only 2 consecutive missing
temperature updates could lead to a fault.
Tweak the internal "next_pwm_time" setting so that it is more tolerant
of two consecutive lost temperature updates.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 9399e738 changed the manual_stepper class to no longer
explicitly flush all steps after each move. As a result, calls to
self.rail.get_commanded_position() may no longer reflect the last
requested position. This discrepancy could result in "internal
stepcompress" errors.
Change the manual_stepper code to internally track the last requested
position and use that when scheduling moves. This allows the
manual_stepper code to utilize the standard "lazy" step flushing
mechanism.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The "relative_reference_index" was deprecated on 20230619 and removed
on 20240215. So, remove the last references from the documentation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support storing a reference to 'struct stepper_kinematics' in 'struct
stepcompress' and support globally generating steps via the
steppersync mechanism.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use the existing register_flush_callback() system to implement motor
activity checking. This simplifies the generate_steps() code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move code from flush_steppersync() to existing flush_motion_queues()
and clean_motion_queues() functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't implement history expiration from the main steppersync_flush()
code. Instead, have callers directly invoke
steppersync_history_expire().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allocate the low-level C stepcompress object in the motion_queuing
module. This simplifies the mcu.py code as it no longer needs to
track the stepqueues for the steppersync object.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add an allocate_trapq() helper function to facilitate the creation of
a low-level C trapq object. Track all trapq objects and clear history
on them globally when the main motion queues are flushed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Create a new module to assist with host management of motion queues.
Register all MCU_stepper objects with this module and use the module
for step generation.
All steppers will now automatically generate steps whenever
toolhead._advance_flush_time() is invoked. It is no longer necessary
for callers to individually call stepper.generate_steps().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change note_mcu_movequeue_activity() to default to setting the
step_gen_time (instead of the previous default to not set it).
Most users of the mcu "move queue" will be for stepper activity.
There is also little harm in incrementing the tracking of the last
possible step generation time, but accidentally generating a step
without incrementing the tracking can lead to very hard to debug
failures.
The two cases (output_pin.py and pwm_tool.py) where
note_mcu_movequeue_activity() is called and definitely not related to
step generation can explicitly pass 'is_step_gen=False'.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the g-code command handlers to a new class. This reduces the
size of the main Toolhead() class.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Python 2.7 does not allow loading the cffi lib
inside the thread, but function calls are allowed
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
enable long file support, needed for boards using swspi and long filenames for firmware like mks robin 1.1/1.2
added MKS robin nano 1.2 board with description what and why
Signed-off-by: Leszek Zajac <zajc3w@gmail.com>
If switching a pin from output low to input with pullup, there is an
intermediate state of either driven high or high impedance without a
pullup. Similarly, when switching from output high to input without a
pullup, there is an intermediate state of either driven low or high
impedence with a pullup. In both cases it is preferable for the
latter transition.
Also, calculate the final setting prior to making any changes to
reduce the time in that intermediate state.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't leave the wires in a high output state during setup - leave them
in a high-impedance with pullup state.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The get_temp() code will stop reporting the last temperature of the
heater if there hasn't been any recent temperature updates. However,
on a full mcu communication loss this can cause the verify_heater code
to report a heating error prior to the mcu code reporting the
communication failure. Increase the heater timeout from 5 to 7
seconds to make it more likely the mcu failure is reported first.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>