stepTimerQuantum introduces discretization error, which makes the
acceleration curves noisy.
In rampgen generate ramps for a single moving axis in addition
of two axes moving together.
Then, in test_ramp_gen, test a single axis moving accurately, while
allow for some discretization error when two (or more) axes are running.
Avoid calling PulseGen::Step() on idle axes by checking for a non-zero
queue size (which is more efficient to compute).
Increase stepTimerQuantum to 128us to ensure acceleration can be
computed in realtime for 3 axes at the same time.
Fix the logic of the static assertion, which was flipped: we need to
create slices larger than the maximal step frequency in order to ensure
no axis is starved while moving.
TogglePin was incorrectly using the PINx pin for toggling, causing the
current pins (in addition to the requested ones) to be toggled, causing
stepping havoc.
This is a tentative/crude implementation of an Init and ISR for the MMU
in order to check the motion API.
We remove the "extern void Isr", declaring it "static inline" instead.
We need to inline the ISR here in order to avoid the function call.
Include the missing speed_table data in the executable. This bumps the
code size to ~60% of the flash.
Implemement motion::Init to setup the ISR and timers, and replace the
call in main from tmc::Init to motion::Init. Motion will init each
driver every time the axis is enabled, so there should be no need for
a global module initialization (we need SPI, but this is initialized
earlier on by it's own module anyway).
The timer is currently setup without any HAL or proper TIMER1 wrapper.
This is to be improved later.
The real MMU unit seems to slow down quite a bit during acceleration.
At this point we need to inline some methods in PulseGen to avoid
overhead, however this breaks the stubs.
Pulley doesn't result in an exact step count due to the fractional
count.result in an exact step count due to the fractional count.
Use Selector instead to test values exacly.
Still check Pulley and Idler, but allowing for a +/-1 step of rounding
error.
The parameter config::AxisConfig::uSteps was supposed to be
microstepping resolution, but it's instead being used as the driver's
MRES directly.
To avoid a runtime conversion, rename the field to mRes and define a new
enum listing all the possible (and valid) microstepping resolutions.
This simplifies the code and makes clear the stepsPerUnit scale.
Assign correct stepsPerUnit to all axes as a result, including working
limits.
- Add additional information in the output generated by rampgen in order
to allow recalculating the acceleration curves independently
- Implement motion ramp checks inside test_motion_ramp.py
test_motion_ramp reads the output of a merged stepping sequence and
splits the motion of each axis, checking the acceleration curves
independently.
This ensures both that the acceleration curves are correct (as generated
by the PulseGen class) and that the multiplexed moves are too.
The nominal rate is checked exactly, while the acceleration/deceleration
segment allow for some deviation from an ideal curve.
This is currently 5% for both expected speed and acceleration, with
an absolute limit of 20mm/s of maximum difference in each point.
- Remove motion::dual_move_ramp from the Catch2 tests and reimplement
it as a minimal c++ program for the ramp validation.
- Add a skeleton python validator to check the ramp output
- Use test "fixtures" to ensure the rampgen is run (both as a test,
and to generate output) when the test_motion_ramp.py is requested.
Besides Unload Filament, which only operates on active slot, all other
top level state machines check the validity of the command's parameter.
If the parameter is out of range for available slots, they return
ErrorCode::INVALID_TOOL now.
Extracted from the previous FW, may need some tuning based on units selected
for each of these axes (degrees, millimeters) - waiting for an update
of the motion implementation.
Updated starting conditions of the unit tests to reflect the global configuration.
MMU-58