Commit Graph

58 Commits (19dcfcef790cd51df26e52af8a63006420a0b657)

Author SHA1 Message Date
D.R.racer 19dcfcef79 Revert selector's config back after testing on real HW 2021-10-21 07:55:41 +02:00
D.R.racer ee247246ee Fix unit tests
- fix homing procedure for Idler and Selector
  (homing now ends with a move to the Parking position)
- fix unit tests' startup conditions with regard to necessary
  homing of Idler and Selector

TODO: still test_cut_filament fails for minor reasons
2021-10-21 07:55:41 +02:00
Alex Voinea 7380cb740a Pulley SG increased 2021-10-21 07:55:41 +02:00
Alex Voinea a87b981a3d Homing initial 2021-10-21 07:55:41 +02:00
D.R.racer 0fbcb9dac2 Tag all source files with @file for doxygen 2021-10-18 17:59:46 +02:00
D.R.racer 5b9c6ec36e Fix (workaround) LED blink when millis overflow + unit test 2021-10-18 16:30:08 +02:00
D.R.racer abe2567c84 Fixes for loading filament into nozzle
Slower speed once we reach the fsensor + avoid grind while disengaging the Idler
while the printer is already pulling the filament.
2021-10-18 07:29:13 +02:00
D.R.racer e1af08b3d5 Fix unit tests
That includes:
- introduce pulley slow feedrate and fsensor-to-nozzle distance
  in config necessary for slowly feeding the filament from fsensor into the nozzle.
  (the constant is subject to extraction into some other config as it has to be used in the printer as well).
- update FeedToBondtech accordingly to perform a gentle push into the nozzle
  after fsensor detects the filament + update its unit tests.
- slight cleanup of LoadFilament + fix its unit tests
- add FeedingToNozzle progress code, as it might be interesting
  to inform the printer about this task in the future
- revert non-clean changes from RetractFromFinda - it should not disengage the idler
- revert incorrect + fix ToolChange
- clean-up UnloadFilament
2021-10-12 18:11:05 +02:00
Alex Voinea 34442469a3 More extreme speeds. They reveal errors in the motion planner 2021-10-12 18:11:05 +02:00
Alex Voinea ef997a6352 Update cuttingEdgeRetract 2021-10-12 18:11:05 +02:00
3d-gussner 28c8e09bcf Use config.h to define DEBUGS 2021-10-12 18:11:05 +02:00
D.R.racer 53b329941f Keep constants start with lowercase letter
and remove a few warnings from the build
2021-10-12 18:11:05 +02:00
D.R.racer ac1f13672a Fix format config.h 2021-10-12 18:11:05 +02:00
3d-gussner 0bead533df clang-format 2021-10-12 18:11:05 +02:00
3d-gussner 15adeaa180 Add DEBUG_LOGIC 2021-10-12 18:11:05 +02:00
3d-gussner 2f2f4d7be3 Add some distances and put axis settings together 2021-10-12 18:11:05 +02:00
Alex Voinea 82a9eaae43 Fix selector noise. IRUN=31(VS=1), MRES=x8 2021-09-16 10:30:27 +02:00
Alex Voinea bec3f73864 Fix typo
typo
2021-09-16 10:30:27 +02:00
Alex Voinea e0babfa4ba Updated motor currents and added freewheeling 2021-09-16 10:30:27 +02:00
3d-gussner 59db864329 Clean up code findaADC.. 2021-08-31 06:59:29 +02:00
3d-gussner 003b2f6899 Change FINDA from ADC to digital
Fix rebase issues
2021-08-31 06:59:29 +02:00
Yuri D'Elia e9e43f744d Correct pulley steps by experimentation
Test performed by moving 500mm of filament back&forth 5 times across 5
pulleys of a MMU2 unit.

The error with this factor is centered around +/- 1.5mm depending on the
pulley and tension on the idler.
2021-08-30 12:49:54 +02:00
Yuri D'Elia f77e426af1 Use the MK2 values for the Pulley 2021-08-30 12:49:54 +02:00
Yuri D'Elia a7d8953519 Fix stepsPerUnit for the Pulley
Also use the correct value multiplied by the current ustep resolution to
make the conversion obvious.
2021-08-30 12:49:54 +02:00
Yuri D'Elia 563c8192cd Update motor currents
Use the same values from the original FW as suggested by @leptun
2021-08-30 07:12:24 +02:00
Yuri D'Elia 9c3b31756e Optimize timer multiplexing and increase stepTimerQuantum
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.
2021-08-30 07:10:54 +02:00
D.R.racer a58450acb6 Extract feedrates of Idler and Selector into config.h 2021-08-27 15:31:20 +02:00
Yuri D'Elia 288e74283d Introduce config::MRes and fix (real) axis units
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.
2021-08-25 09:16:56 +02:00
D.R.racer 2c94e76ca9 Allow configurable LED's blinking period 2021-08-04 11:40:02 +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 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 7029b1b03d Reformat config.h after rebase 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 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
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 e9046eed42 tmc2130: More init 2021-07-29 10:01:33 +02:00
Alex Voinea e2ba71fc03 tmc2130: Define the SPI bus for the tmc drivers 2021-07-29 10:01:33 +02:00
Yuri D'Elia d955897829 Convert config::selectorSlotPositions to physical units 2021-07-25 23:13:28 +02:00
Yuri D'Elia 6daf7fd060 Convert config::idlerSlotPositions to physical units 2021-07-25 22:39:18 +02:00
Yuri D'Elia 888cdf7cd5 Introduce compile-time axis unit type checks and conversions
Introduces:

- config::Unit: base class for physical quantities
- motion::AxisUnit: type-checked steps type

"config/unit.h" defines basic physical quantities, which are not
normally used elsewhere besides config.h.

"modules/axisunit.h" extends the modules::motion namespace with
Axis-aware units, with one type per axis per unit.

P_pos_t defines step positions for the pulley, I_pos_t for the idler,
etc. These are defined through the literar operators which are
similarly named and automatically convert a physical quantity to an
AxisUnit at compile time:

P_pos_t pulley_pos = 10.0_P_mm;

Besides type-checking, AxisUnit are otherwise identical to raw step
counts and are intended to be used along with the updated Motion API.

PlanMove/PlanMoveTo has been extended to support moves using these units
or physical quantities. Again, conversion is performed at compile time.
2021-07-25 16:39:54 +02:00
Yuri D'Elia 324fb92fd5 Motion: implement timer multiplexing 2021-07-13 19:21:13 +02:00
Yuri D'Elia d0581bf494 Motion: Add more methods and tests
- Add SetPosition/CurPosition (not only) for testing
- Implement some real tests
2021-07-13 17:43:50 +02:00
Yuri D'Elia 18ced44341 Merge remote-tracking branch 'upstream/main' into motion_wip 2021-07-13 15:31:31 +02:00
Alex Voinea edf0804fd8 Fix Buttons ADC range 2021-07-12 16:55:37 +02:00
Alex Voinea d44de216a9 Fix ADC channels 2021-07-12 16:55:37 +02:00
Yuri D'Elia 066aab7adc Move cpuFrequencyDivider to config::stepTimerFrequencyDivider 2021-07-11 21:17:08 +02:00
Yuri D'Elia d87db1ff76 Revised WIP for the Motion API
- Remove the combined PlanMove(a,b,c,rate) call. If we allow the units
  of the various motors to be changed at compile time, the unit of
  rate can vary between axes.
- Build PlanMove on top of the absolute PlanMoveTo.
- Add required stubs for TMC2130.
- Allow each axis mode to be set independently, since we have this
  feature for free anyway.
- Rework internals to use PulseGen data types and structs.
2021-07-07 16:59:39 +02:00