Commit Graph

839 Commits (3189e7845d82701a30058ab04ba67b91e9fba52e)

Author SHA1 Message Date
Alex Voinea 36e63e678c Fix tests 2021-08-23 08:18:47 +02:00
Alex Voinea 2144a3f440 Swap led direction 2021-08-23 08:18:47 +02:00
Alex Voinea 8766642a21 Turn off all LEDs after Init 2021-08-23 08:18:47 +02:00
Yuri D'Elia a6780d2224 Correct motor pins 2021-08-23 08:16:15 +02:00
Yuri D'Elia 3fd11d17cb Make cmake show verbose errors on failure 2021-08-12 17:50:39 +02:00
Yuri D'Elia 0d1441b721 Skip motion::test_motion_ramp test if pandas is not installed 2021-08-12 17:50:07 +02:00
Yuri D'Elia c3509e6296 Remove pandas from bootstrap.py and as docker dependency
We'll not depend on pandas for normal builds, skipping
test_motion_ramp.py if not installed.
2021-08-12 17:50:07 +02:00
Yuri D'Elia 5f643126ba Add pandas as a required dependency for testing 2021-08-12 17:50:07 +02:00
Yuri D'Elia d8454df5af Add rampgen as a dependency of tests 2021-08-12 17:50:07 +02:00
Yuri D'Elia 240f4c28ab Complete motion ramp checks
- 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.
2021-08-12 17:50:07 +02:00
Yuri D'Elia 89ab29dbde Move motion::dual_move_ramp into the separate motion::rampgen test
- 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.
2021-08-12 17:50:07 +02:00
Yuri D'Elia f37c9e363c Remove no-longer-needed operators import 2021-08-12 17:50:07 +02:00
D.R.racer 492208d25a Improve documentation of the startup process 2021-08-12 11:08:09 +02:00
D.R.racer 87d0f1c8f7 Add K1, 2, 3, 4 into unit tests 2021-08-12 10:55:27 +02:00
D.R.racer f0b8cc9895 Fix encoding of Query responses for high numbers of errors
+ improve unit tests directly for the enumerated errors in logic/error_codes.h
2021-08-12 10:55:27 +02:00
D.R.racer a982381728 Only start a new command if the previous one finished
... that means with or without an error
and remember the Command's request message - to identify the responses
2021-08-12 10:30:40 +02:00
D.R.racer e0ea47595f Add unit tests for logic state machines reusal
as it will work in the real FW
2021-08-12 10:30:40 +02:00
D.R.racer ccefe32ba1 Reset the error code for reusal of logic state machines 2021-08-12 10:30:40 +02:00
D.R.racer 9ba116e06e Handle slot indices out of range correctly at top level
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.
2021-08-12 10:30:40 +02:00
D.R.racer c14c79f3ac Do not blink the left LED on start 2021-08-11 10:33:32 +02:00
D.R.racer 2053729a75 Fix LED unit tests 2021-08-04 11:40:02 +02:00
D.R.racer 2c94e76ca9 Allow configurable LED's blinking period 2021-08-04 11:40:02 +02:00
D.R.racer 2f5dff6c5b Introduce short namespace aliases
especially for modules
2021-08-04 11:03:56 +02:00
Alex Voinea 9232e55563 millis interrupt 2021-08-04 10:51:33 +02:00
D.R.racer 2062a604d8 Improve unit computation
based on #76 which added a possibility to perform arithmetic operations
on unit-based quantities
2021-08-02 10:52:18 +02:00
D.R.racer 8694c53033 Fixes after rebase onto main 2021-08-02 10:52:18 +02:00
D.R.racer aa5995368d Update to latest main + fix unit tests
... in relation to the newly introduced stepping in physical units rather than in steps
2021-08-02 10:52:18 +02:00
D.R.racer 16dc129b49 Set real slot positions for the Idler and Selector
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
2021-08-02 10:52:18 +02:00
D.R.racer ef96d998a3 Link top level error reporting to TMC2130 error flags 2021-08-02 07:45:45 +02:00
D.R.racer 7029b1b03d Reformat config.h after rebase 2021-08-02 07:45:45 +02:00
D.R.racer d94ad8b90e Merge coil errors, fix bit masks 2021-08-02 07:45:45 +02:00
D.R.racer f7c3d0b479 Fix axis bit masks 2021-08-02 07:45:45 +02:00
D.R.racer 751ee46450 Add bit masks for error codes for the TMC drivers
+ add common error handling for idler and selector
+ improve error handling in command_base
+ rename ERR1xxxx errors to ERRxxxx (remove the '1')
2021-08-02 07:45:45 +02:00
D.R.racer df2c1ba7fe Add prototype of unified handling of HW errors in the logic layer 2021-08-02 07:45:45 +02:00
D.R.racer f5df642eb5 Improve error codes
- Distinguish among FINDA on/off failuje
- The same applies to newly introduced Filament sensor errors
- Add TMC init error
- Add a communication error ID - to be used on the printer
2021-08-02 07:45:45 +02:00
Yuri D'Elia 7dcd4975e1 Allow units to be scaled by an unitless quantity
This allows Unit<> and AxisUnit<> to be scaled with a fraction as
expected, promoting the scaler to the same unit:

  0.2_mm * 10 => 2_mm (mm*f => mm)

Multiplication type is commutative:

  10 * 0.2_mm => 2_mm (f*mm => mm)

Division isn't:

  0.2_mm / 10 => 0.02_mm (mm*1/f => mm)
  10 / 0.2_mm => error (illegal type conversion)
2021-08-02 07:41:26 +02:00
D.R.racer fae7dead93 20 bits for coostep thr 2021-07-29 10:01:33 +02:00
D.R.racer b61836dd57 Remove shifting in config for TMC + add compile-time checks 2021-07-29 10:01:33 +02:00
D.R.racer a8147be803 Fix unit tests + rebase onto main + extract TMC parameters into config 2021-07-29 10:01:33 +02:00
Alex Voinea aca2cb7e79 tmc: Error flags 2021-07-29 10:01:33 +02:00
Alex Voinea 8577852b09 tmc2130: Stallguard and Isr 2021-07-29 10:01:33 +02:00
D.R.racer 3d1880c006 Make tests compile
Introduces a nasty hack to forcefully write into the constexpr SPI descriptor's registers
(which is the correct way in ASM, but kind of cumbersome in C++ now)
2021-07-29 10:01:33 +02:00
Alex Voinea 364f1bcb0d tmc2130: error handling stack overflow fix 2021-07-29 10:01:33 +02:00
Alex Voinea d071a6abf6 TMC pin map 2021-07-29 10:01:33 +02:00
Alex Voinea 2cdc3bfbc4 tmc2130: report error during init 2021-07-29 10:01:33 +02:00
Alex Voinea 3f20ff88ee Reorder functions 2021-07-29 10:01:33 +02:00
Alex Voinea b97aefcb5c tmc2130: More functions 2021-07-29 10:01:33 +02:00
Alex Voinea 129a89cf07 Fix stall detection polarity 2021-07-29 10:01:33 +02:00
Alex Voinea 5f83667b22 Finish init sequence 2021-07-29 10:01:33 +02:00
Alex Voinea e9046eed42 tmc2130: More init 2021-07-29 10:01:33 +02:00