DerAndere1 / Marlin

Optimized firmware for RepRap 3D printers based on the Arduino platform. The branch Marlin2ForPipetBot is optimized firmware for cartesian robots (lab robots, also known as liquid handling robots or pipetting robots)
https://derandere.gitlab.io/pipetbot-a8
GNU General Public License v3.0
53 stars 20 forks source link

[BUG][bf2_6axis_dev] Axes I, J and K do not move #1

Closed DerAndere1 closed 4 years ago

DerAndere1 commented 5 years ago

Description

With the files from the bf_6axes_dev branch downloaded today, when specifying #define NON_E_AXES = 4 or #define NON_E_AXES = 5 or #define NON_E_AXES = 6 only axes XYZ can be moved by issuing G-code G1.

Steps to Reproduce

  1. Use the original PipetBot-A8 as detailed at https://it-by-derandere.blogspot.com/p/pipetbot-a8.html.
  2. visit https://github.com/DerAndere1/Marlin/tree/bf2_6axis_dev and download the files from that branch.
  3. Copy the content of Marlin/src/config/examples/DerAndere/PipetBot-A8 to Marlin/ and confirm the replacement of the existing files Marlin/Configuration.h and Marlin/Configuration_adv.h
  4. Upload the configured firmware from step 3 to the microcontroller of the PipetBot-A8
  5. Issue G-code command G28 I or G28 or G-code commands like G1 I10 F100 or G1 X5 Y6 Z3 I40 J50 K60 E70 F100 (e.g. via USB serial connection using either printrun or Universal G-code sender (UGS))

Expected behavior: The stepper motors connected to the pins for AXIS_I, AXIS_J, AXIS_K should move similar to those connected to pins for AXIS_X, AXIS_Y and AXIS_Z.

Actual behavior: Only stepper motors connected to the pins for AXIS_X, AXIS_Y and AXIS_Z move. Steppers for I,J and K cannot be moved manually without applying high load. This indicates that these steppers are enabled.

Additional Information

None

hobiseven commented 4 years ago

@DerAndere1 I sent you an invite as collaborator in my git so you can also touch the code...

DerAndere1 commented 4 years ago

OK. I saw some minor issues in your fork, hobiseven. I will have a closer look at it tomorrow. Arduino IDE was not reliable anymore for compiling. So I switched from Eclipse + Arduino IDE to VS code + PlatformIO. My next branch bf2_6axis_dev7 now also compiles for NON_E_AXES 3 and most other errors are fixed too. Now I came to the point where the template<typename T> struct XYZval in types.h is the causing errors for NON_E_AXES 4 (cannot convert to float). I expected issues with types.h because I absolutely do not know how it works and what it does. My changes there were pure guesswork.

hobiseven commented 4 years ago

Ok. I actually corrected typos in type.h about the XYZval > there is a mistake as you defined it like XYZ_Eval > I changed that and have commited it...I am now stuck with an error I do not yet understand . It is related to the eprom... . Let s see tomorrow! I also use platformio / vscode

hobiseven commented 4 years ago

I have the test setup ready, steppers working in the 3 axis mode. I am still stuck in the 4 axis mode with a compile error in the configuration_storage.cpp.. Related to macros, and so far did not figure out : Marlin\src\module\configuration_store.cpp: In static member function 'static void MarlinSettings::report(bool)': Marlin\src\module../inc/../core/serial.h:195:59: error: no matching function for call to 'serial_echopair_PGM(float, float)'

define _SELP_2_P(PRE,V) do{ serial_echopair_PGM(PRE,V); SERIAL_EOL(); }while(0)

                                                       ^

Marlin\src\module../inc/../core/serial.h:197:49: note: in expansion of macro '_SELP_2_P'

define _SELP_4_P(a,b,V...) do{ _SEP_2_P(a,b); _SELP_2_P(V); }while(0)

hobiseven commented 4 years ago

@DerAndere1 Code is compiling with 4 axis, I fixed M206, as I think the modification for 4 to 6 axis was wrongly placed. Testing now...

hobiseven commented 4 years ago

@DerAndere1 @GabrielBeraldo All menus look fine with proper preload values on I j and k. EPROM has a problem. Moving x fine but I moves about 1/4 of X and j moves 1/4 of I.... Need to focus now on the TODO that are not done....

DerAndere1 commented 4 years ago

@hobiseven: Great progress. You may want to make the dev branch your new master and work on that branch, see https://github.com/hobiseven/Marlin2.0.4.4_6axis_Longer3D/issues/#1. In the dev branch you find a fix for the K stepper. If you add those changes into other places, please first find out how to amend the correct original author info to commits (https://stackoverflow.com/questions/3042437/how-to-change-the-commit-author-for-one-specific-commit) or use git to rebase or cherry-pick commits. Otherwise the copyright status is not clear.... BTW: The TODO comments do not neccessarily mean that changes have to be done. Its just to find the places that have to be tested in case something does not work.

hobiseven commented 4 years ago

Ah ok i will look into this as I am a rookie in github ( same for sw coding...) !

GabrielBeraldo commented 4 years ago

@DerAndere1 @GabrielBeraldo All menus look fine with proper preload values on I j and k. EPROM has a problem. Moving x fine but I moves about 1/4 of X and j moves 1/4 of I.... Need to focus now on the TODO that are not done....

In the case of EEPROM, check if you are iterating through all the additional axes (take a look: https://github.com/MarlinFirmware/Marlin/commit/0fd2a0db4d9d98a6be2b00705e191a8ac56b317c)

hobiseven commented 4 years ago

@DerAndere1 I made a new clone git from tpruvot , created a 6axis Branch and I will put the initial commit as coming from you. I wanted to keep the base as tpruvot as there are quite some changes done for alfawise touchscreen and lcd Hope this will suits you better.

DerAndere1 commented 4 years ago

Ah ok i will look into this as I am a rookie in github ( same for sw coding...) !

You made great contributions and you were kind enough to share your results. Dont worry, my comments were meant as tips, not as critique. I often struggle with git myself.

DerAndere1 commented 4 years ago

First time I had time for a hardware test with Gabriels fork. I had to introduce some if/else preprocessor directives in configuration_store.cpp to get my desired XYZ+I+E setup, but now it works superb. @GabrielBeraldo do you know if after changing configuration_store.cpp it is sufficient to clear EEPROM before flashing Marlin, or do we need a new EEPROM version string each time?

DerAndere1 commented 4 years ago

Some major commits made it difficult to get the 6 axis feature into current upstream MarlinFirmware/Marlin2.0.x: https://github.com/MarlinFirmware/Marlin/commit/8683d4abfd04944d9b015f96c0f4479009ae3a0c and https://github.com/MarlinFirmware/Marlin/commit/455dabb18334c89878a75be62bccebd9f537574d and https://github.com/MarlinFirmware/Marlin/commit/50e4545255605eb506c20eb107270038b0fe7bdb

hobiseven commented 4 years ago

Great that you now have your 5 axis system working after all the work you made!

For marlin2, those cryptic macros.... well if it cannot be done it cannot be done. Just let me know if difficult means impossible.

GabrielBeraldo commented 4 years ago

First time I had time for a hardware test with Gabriels fork. I had to introduce some if/else preprocessor directives in configuration_store.cpp to get my desired XYZ+I+E setup, but now it works superb. @GabrielBeraldo do you know if after changing configuration_store.cpp it is sufficient to clear EEPROM before flashing Marlin, or do we need a new EEPROM version string each time?

Glad to hear great news! You can just use the initialize EEPROM function to overwrite the parameters without changing the sersion and everything should work great. I changed the version only to create a difference and the firmware detects the change to load the hardcoded parameters before i properly initialize the EEPROM, avoiding loading wrong parameters.

GabrielBeraldo commented 4 years ago

Some major commits made it difficult to get the 6 axis feature into current upstream MarlinFirmware/Marlin2.0.x: MarlinFirmware@8683d4a and MarlinFirmware@455dabb and MarlinFirmware@50e4545

Looks like it'll be tricky to figure out a nice solution for these conflicts, should be possible but time consuming...

DerAndere1 commented 4 years ago

The fact that hobiseven got moving axes with our up-to-date code, just wrong speeds, indicates that it should be possible to make the update. It may require some patience and community effort. Currently, my bf2_6axis_dev13 branch compiles for my board, and XYZE axes work all fine. additial axes IJK move too slow. Next I want to rebase Gabriels branch on commit https://github.com/MarlinFirmware/Marlin/commit/ee7558a6228747a7502ab50e2817234fb8a6feb4 (shortly before the breaking upstream changes). @hobiseven: Note that my initial bf2_6axis branch and the fixes by Gabriel were already based on https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x, not Marlin 1.1.9. I close this issue as fixed and open new, more specific issues.

DerAndere1 commented 4 years ago

New approach: My branch https://github.com/DerAndere1/Marlin/tree/bf2_6axis_dev12 (based on https://github.com/MarlinFirmware/Marlin/commit/ee7558a6228747a7502ab50e2817234fb8a6feb4). works well with default config and with 4 axes XYZI + E.