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

Patch A4982 step-position conversion functions #267

Merged
merged 3 commits into from
Oct 9, 2020
Merged

Conversation

leptun
Copy link
Collaborator

@leptun leptun commented Oct 9, 2020

Description

Fixes steps/mm being calculated incorrectly on miniRambo based boards.

Behaviour/ Breaking changes

None

Have you tested the changes?

Tested Prusa_MK2_mR13 variant with two different microstepping configurations. Both worked as expected.

Linked issues:

closes #253

image
image

@leptun leptun requested a review from vintagepc October 9, 2020 16:13
@vintagepc
Copy link
Owner

Thanks. I'll review this after work. Fix seems a little counter-intuitive given how the variable step resolution is handled, but if it works, it works and I'll update the automated tests accordingly.

@leptun
Copy link
Collaborator Author

leptun commented Oct 9, 2020

The uiStepsPerMM configuration option already represents x16 microsteps. On the TMC2130 (Einsy board) this value is *16 in the configuration file. So you handled an issue that didn't exist and ended up creating another.
Speaking of issues, the test fails now. Not sure how to fix it as the TestBoard uiStepsPerMM is erroneously 10, but I think it should be 10/16 (impossible as well). I hope what I just said is correct. Another possibility is that I just have to regenerate the png files for the A4982 test.

@vintagepc
Copy link
Owner

vintagepc commented Oct 9, 2020

Ah, something I did for the TMCs crept in to the miniRambo and I didn't finish the implementation. That would definitely do it. I was thinking the steps per mm was still the direct firmware value and not corrected for this.

The test will likely just need some adjusting in the script - it was doing some assorted step counting to ensure that we were hitting the correct number of steps before hitting the endstops in various configurations. I suspect the number of steps counted by the micro might have changed as a result of this.

Don't feel obligated to dive too much into that but test can be run standalone with make Run_test_A4982. I don't think the images will need to change, but if they do the way is to push the corrected test and grab them from the report that is uploaded after the runner completes. I tried finding a compatibile config that produced the same results locally but did not have any success with that. GL implementations just seem to be subtly different between my machine and the build runner's software rendering.

@vintagepc
Copy link
Owner

strange, not sure why the PR isn't picking up my commit that should fix the tests.

vintagepc
vintagepc previously approved these changes Oct 9, 2020
@github-actions
Copy link

github-actions bot commented Oct 9, 2020

Automated Test Code Coverage Report

View details...

File Lines Exec Cover
MK404.cpp 202 191 94%
parts/ADCPeripheral.h 30 30 100%
parts/BasePeripheral.h 38 37 97%
parts/Board.cpp 229 193 84%
parts/Board.h 24 23 95%
parts/I2CPeripheral.cpp 102 97 95%
parts/I2CPeripheral.h 1 1 100%
parts/IKeyClient.cpp 3 3 100%
parts/IKeyClient.h 1 1 100%
parts/IScriptable.cpp 47 31 65%
parts/IScriptable.h 3 3 100%
parts/KeyController.cpp 43 43 100%
parts/KeyController.h 3 2 66%
parts/PinSpec.h 10 10 100%
parts/Printer.cpp 14 12 85%
parts/Printer.h 4 4 100%
parts/PrinterFactory.cpp 22 16 72%
parts/PrinterFactory.h 19 19 100%
parts/SPIPeripheral.cpp 16 16 100%
parts/SPIPeripheral.h 2 2 100%
parts/ScriptHost.cpp 280 202 72%
parts/ScriptHost.h 13 13 100%
parts/Scriptable.cpp 17 15 88%
parts/Scriptable.h 2 2 100%
parts/SoftPWMable.cpp 17 17 100%
parts/SoftPWMable.h 9 9 100%
parts/TelemetryHost.cpp 106 71 66%
parts/TelemetryHost.h 11 7 63%
parts/Wiring.h 10 10 100%
parts/boards/EinsyRambo.cpp 136 129 94%
parts/boards/EinsyRambo.h 1 1 100%
parts/boards/MM_Control_01.cpp 61 61 100%
parts/boards/MM_Control_01.h 3 3 100%
parts/boards/MiniRambo.cpp 88 88 100%
parts/boards/MiniRambo.h 3 3 100%
parts/boards/Test_Board.cpp 87 87 100%
parts/boards/Test_Board.h 3 3 100%
parts/components/A4982.cpp 168 168 100%
parts/components/A4982.h 5 5 100%
parts/components/ADC_Buttons.cpp 51 48 94%
parts/components/ADC_Buttons.h 1 1 100%
parts/components/Beeper.cpp 92 71 77%
parts/components/Beeper.h 4 4 100%
parts/components/Button.cpp 39 39 100%
parts/components/Button.h 2 2 100%
parts/components/EEPROM.cpp 86 71 82%
parts/components/EEPROM.h 1 1 100%
parts/components/Fan.cpp 82 81 98%
parts/components/Fan.h 2 2 100%
parts/components/GCodeSniffer.cpp 24 24 100%
parts/components/GCodeSniffer.h 3 3 100%
parts/components/GLHelper.cpp 81 78 96%
parts/components/GLHelper.h 1 1 100%
parts/components/HC595.cpp 39 36 92%
parts/components/HC595.h 2 2 100%
parts/components/HD44780.cpp 247 193 78%
parts/components/HD44780.h 14 14 100%
parts/components/HD44780GL.cpp 105 105 100%
parts/components/HD44780GL.h 1 1 100%
parts/components/Heater.cpp 97 96 98%
parts/components/Heater.h 3 3 100%
parts/components/IRSensor.cpp 65 63 96%
parts/components/IRSensor.h 1 1 100%
parts/components/LED.cpp 38 38 100%
parts/components/MMU1.cpp 54 54 100%
parts/components/MMU1.h 2 2 100%
parts/components/MMU2.cpp 109 98 89%
parts/components/MMU2.h 1 1 100%
parts/components/PAT9125.cpp 140 114 81%
parts/components/PAT9125.h 6 6 100%
parts/components/PINDA.cpp 127 120 94%
parts/components/PINDA.h 2 2 100%
parts/components/RotaryEncoder.cpp 106 103 97%
parts/components/RotaryEncoder.h 3 3 100%
parts/components/SDCard.cpp 308 288 93%
parts/components/SDCard.h 9 9 100%
parts/components/SerialLineMonitor.cpp 89 81 91%
parts/components/SerialLineMonitor.h 1 1 100%
parts/components/TMC2130.cpp 184 172 93%
parts/components/TMC2130.h 6 6 100%
parts/components/Thermistor.cpp 56 52 92%
parts/components/Thermistor.h 1 1 100%
parts/components/UART_Logger.cpp 0 0 --%
parts/components/VoltageSrc.cpp 31 29 93%
parts/components/VoltageSrc.h 2 2 100%
parts/components/uart_pty.cpp 157 127 80%
parts/components/uart_pty.h 3 3 100%
parts/components/w25x20cl.cpp 201 177 88%
parts/components/w25x20cl.h 1 1 100%
parts/pinspecs/PinSpec_2560.h 2 2 100%
parts/pinspecs/PinSpec_32u4.h 2 2 100%
parts/printers/Prusa_MK1_13.cpp 15 15 100%
parts/printers/Prusa_MK1_13.h 1 1 100%
parts/printers/Prusa_MK25S_13.cpp 6 6 100%
parts/printers/Prusa_MK25S_13.h 1 1 100%
parts/printers/Prusa_MK25_13.cpp 16 16 100%
parts/printers/Prusa_MK25_13.h 1 1 100%
parts/printers/Prusa_MK2MMU_13.cpp 32 32 100%
parts/printers/Prusa_MK2MMU_13.h 1 1 100%
parts/printers/Prusa_MK2_13.cpp 112 83 74%
parts/printers/Prusa_MK2_13.h 1 1 100%
parts/printers/Prusa_MK3.cpp 8 8 100%
parts/printers/Prusa_MK3.h 1 1 100%
parts/printers/Prusa_MK3MMU2.cpp 9 9 100%
parts/printers/Prusa_MK3MMU2.h 1 1 100%
parts/printers/Prusa_MK3S.cpp 122 120 98%
parts/printers/Prusa_MK3S.h 2 2 100%
parts/printers/Prusa_MK3SMMU2.cpp 33 29 87%
parts/printers/Prusa_MK3SMMU2.h 3 3 100%
parts/printers/Test_Printer.cpp 39 39 100%
parts/printers/Test_Printer.h 3 3 100%
parts/wiring/Einsy_1_0a.h 6 6 100%
parts/wiring/Einsy_1_1a.h 19 19 100%
parts/wiring/MM_Control_01.h 6 6 100%
parts/wiring/Test_Wiring.h 6 6 100%
parts/wiring/miniRAMBo_1_1b.h 6 6 100%
parts/wiring/miniRAMBo_1_3a.h 20 20 100%
utility/Color.cpp 67 53 79%
utility/Config.h 6 6 100%
utility/FatImage.cpp 83 75 90%
utility/FatImage.h 2 2 100%
utility/GLObj.cpp 180 171 95%
utility/GLObj.h 6 6 100%
utility/GLPrint.cpp 259 250 96%
utility/GLPrint.h 11 7 63%
utility/MK3SGL.cpp 507 440 86%
utility/MK3SGL.h 14 14 100%
utility/MK3S_Bear.cpp 79 78 98%
utility/MK3S_Bear.h 9 6 66%
utility/MK3S_Full.cpp 10 10 100%
utility/MK3S_Full.h 4 4 100%
utility/MK3S_Lite.cpp 72 71 98%
utility/MK3S_Lite.h 12 10 83%
utility/OBJCollection.cpp 16 16 100%
utility/OBJCollection.h 8 7 87%
utility/PrintVisualType.h 8 8 100%
utility/SerialPipe.cpp 62 39 62%
utility/Util.h 15 15 100%
TOTAL 6417 5785 90%

TOTAL: 6417 lines of code, 5785 lines executed, 90% covered.

@vintagepc vintagepc merged commit 9062cc7 into master Oct 9, 2020
@vintagepc vintagepc deleted the fix_A4982 branch October 9, 2020 22:50
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.

[BUG] MK2 PINDA doesn't trigger
2 participants