Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registers: support writing axis acceleration value #337

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gudnimg
Copy link
Collaborator

@gudnimg gudnimg commented Dec 23, 2024

The read operation now returns the actual used value instead of the maximum allowed acceleration value.

Fixes #333

Change in memory:
Flash: + 78 bytes
SRAM: 0 bytes

Copy link

github-actions bot commented Dec 23, 2024

All values in bytes. Δ Delta to base

ΔFlash ΔSRAM Used Flash Used SRAM Free Flash Free SRAM
78 0 28210 1667 462 893

@DRracer
Copy link
Collaborator

DRracer commented Dec 23, 2024

🤔 does it really work? I supposed we didn't have those runtime accelerations used in the code.

@3d-gussner 3d-gussner force-pushed the acceleration-registers branch from b97c64c to 0f4e7d6 Compare December 23, 2024 17:53
Copy link

Automated Test Code Coverage Report

View details...

File Lines Exec Cover
src/application.cpp 169 14 8%
src/application.h 3 3 100%
src/hal/circular_buffer.h 52 52 100%
src/hal/eeprom.h 1 0 0%
src/hal/gpio.h 18 7 38%
src/hal/progmem.h 6 6 100%
src/hal/tmc2130.cpp 113 9 7%
src/hal/tmc2130.h 31 27 87%
src/logic/command_base.cpp 139 118 84%
src/logic/command_base.h 4 3 75%
src/logic/cut_filament.cpp 117 80 68%
src/logic/eject_filament.cpp 77 60 77%
src/logic/feed_to_bondtech.cpp 60 57 95%
src/logic/feed_to_bondtech.h 1 1 100%
src/logic/feed_to_finda.cpp 48 45 93%
src/logic/feed_to_finda.h 1 1 100%
src/logic/home.cpp 18 12 66%
src/logic/load_filament.cpp 85 77 90%
src/logic/load_filament.h 1 0 0%
src/logic/move_selector.cpp 21 0 0%
src/logic/no_command.h 2 1 50%
src/logic/retract_from_finda.cpp 27 21 77%
src/logic/retract_from_finda.h 1 1 100%
src/logic/set_mode.cpp 5 0 0%
src/logic/set_mode.h 1 0 0%
src/logic/start_up.cpp 38 26 68%
src/logic/start_up.h 4 4 100%
src/logic/tool_change.cpp 108 82 75%
src/logic/unload_filament.cpp 76 69 90%
src/logic/unload_to_finda.cpp 40 39 97%
src/logic/unload_to_finda.h 1 1 100%
src/modules/axisunit.h 21 21 100%
src/modules/buttons.cpp 11 11 100%
src/modules/buttons.h 7 7 100%
src/modules/crc.h 13 13 100%
src/modules/debouncer.cpp 28 24 85%
src/modules/debouncer.h 7 7 100%
src/modules/finda.cpp 7 3 42%
src/modules/finda.h 2 2 100%
src/modules/fsensor.cpp 6 6 100%
src/modules/fsensor.h 3 3 100%
src/modules/globals.cpp 47 42 89%
src/modules/globals.h 34 24 70%
src/modules/idler.cpp 89 82 92%
src/modules/idler.h 12 12 100%
src/modules/leds.cpp 44 42 95%
src/modules/leds.h 16 15 93%
src/modules/math.h 6 6 100%
src/modules/motion.cpp 59 40 67%
src/modules/motion.h 66 64 96%
src/modules/movable_base.cpp 73 70 95%
src/modules/movable_base.h 16 16 100%
src/modules/permanent_storage.cpp 144 89 61%
src/modules/protocol.cpp 216 184 85%
src/modules/protocol.h 72 70 97%
src/modules/pulley.cpp 33 25 75%
src/modules/pulley.h 8 5 62%
src/modules/pulse_gen.cpp 95 89 93%
src/modules/pulse_gen.h 53 51 96%
src/modules/selector.cpp 69 62 89%
src/modules/selector.h 5 5 100%
src/modules/speed_table.h 26 24 92%
src/modules/user_input.cpp 39 39 100%
src/modules/user_input.h 12 12 100%
src/modules/voltage.cpp 4 0 0%
src/registers.cpp 107 37 34%
src/unit.h 12 12 100%
TOTAL 2730 2030 74%

TOTAL: 2730 lines of code, 2030 lines executed, 74% covered.

@3d-gussner
Copy link
Collaborator

This PR makes #334 obsolete, right?

@3d-gussner
Copy link
Collaborator

3d-gussner commented Dec 24, 2024

M708 A0x0e X790 is rejected.

tail -f .octoprint/logs/serial.log|grep -E "[<|>]Re|[<|>]We|[<|>]Rd|[<|>]Wd|M70"
2024-12-24 14:12:31,597 - Send: M707 A0x0e
2024-12-24 14:12:31,602 - Recv: echo:MMU2:>Re*fc.
2024-12-24 14:12:31,606 - Recv: echo:MMU2:<Re A320*dc.
2024-12-24 14:12:43,590 - Send: M708 A0x0e X790
2024-12-24 14:12:43,643 - Recv: echo:MMU2:>We 316*92.
2024-12-24 14:12:43,645 - Recv: echo:MMU2:<We R*ce.
2024-12-24 14:12:55,310 - Send: M707 A0x0e
2024-12-24 14:12:55,315 - Recv: echo:MMU2:>Re*fc.
2024-12-24 14:12:55,319 - Recv: echo:MMU2:<Re A320*dc.

while M708 A0x0d X94 is accepted

tail -f .octoprint/logs/serial.log|grep -E "[<|>]Re|[<|>]We|[<|>]Rd|[<|>]Wd|M70"
2024-12-24 14:14:42,665 - Send: M707 A0x0d
2024-12-24 14:14:42,669 - Recv: echo:MMU2:>Rd*41.
2024-12-24 14:14:42,673 - Recv: echo:MMU2:<Rd A5f*cf.
2024-12-24 14:14:46,727 - Send: M708 A0x0d X94
2024-12-24 14:14:46,733 - Recv: echo:MMU2:>Wd 5e*d5.
2024-12-24 14:14:46,736 - Recv: echo:MMU2:<Wd A*aa.
2024-12-24 14:14:48,918 - Send: M707 A0x0d
2024-12-24 14:14:48,923 - Recv: echo:MMU2:>Rd*41.
2024-12-24 14:14:48,925 - Recv: echo:MMU2:<Rd A5e*da.

The read operation now returns the actual used value instead of the maximum allowed acceleration value.

Change in memory:
Flash: + 78 bytes
SRAM: 0 bytes
@gudnimg gudnimg force-pushed the acceleration-registers branch from 0f4e7d6 to 75a5ba3 Compare December 24, 2024 13:46
@gudnimg
Copy link
Collaborator Author

gudnimg commented Dec 24, 2024

Rebased to sync with main. No functional changes made.

@gudnimg gudnimg marked this pull request as draft December 24, 2024 14:03
@gudnimg
Copy link
Collaborator Author

gudnimg commented Dec 24, 2024

M708 A0x0e X790 is rejected.

tail -f .octoprint/logs/serial.log|grep -E "[<|>]Re|[<|>]We|[<|>]Rd|[<|>]Wd|M70"
2024-12-24 14:12:31,597 - Send: M707 A0x0e
2024-12-24 14:12:31,602 - Recv: echo:MMU2:>Re*fc.
2024-12-24 14:12:31,606 - Recv: echo:MMU2:<Re A320*dc.
2024-12-24 14:12:43,590 - Send: M708 A0x0e X790
2024-12-24 14:12:43,643 - Recv: echo:MMU2:>We 316*92.
2024-12-24 14:12:43,645 - Recv: echo:MMU2:<We R*ce.
2024-12-24 14:12:55,310 - Send: M707 A0x0e
2024-12-24 14:12:55,315 - Recv: echo:MMU2:>Re*fc.
2024-12-24 14:12:55,319 - Recv: echo:MMU2:<Re A320*dc.

while M708 A0x0d X94 is accepted

tail -f .octoprint/logs/serial.log|grep -E "[<|>]Re|[<|>]We|[<|>]Rd|[<|>]Wd|M70"
2024-12-24 14:14:42,665 - Send: M707 A0x0d
2024-12-24 14:14:42,669 - Recv: echo:MMU2:>Rd*41.
2024-12-24 14:14:42,673 - Recv: echo:MMU2:<Rd A5f*cf.
2024-12-24 14:14:46,727 - Send: M708 A0x0d X94
2024-12-24 14:14:46,733 - Recv: echo:MMU2:>Wd 5e*d5.
2024-12-24 14:14:46,736 - Recv: echo:MMU2:<Wd A*aa.
2024-12-24 14:14:48,918 - Send: M707 A0x0d
2024-12-24 14:14:48,923 - Recv: echo:MMU2:>Rd*41.
2024-12-24 14:14:48,925 - Recv: echo:MMU2:<Rd A5e*da.

@3d-gussner If you find time, can you double check you were using the correct firmware? I don't see how the write can be rejected. It should work now when we have a 'write' function defined.

I'll see if I can test this on my MK4S today or tomorrow.

For reference, this is the function which determines if its accepted or rejected. False means Rejected.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write tor acceletation registers not possible.
3 participants