Welcome! Log In Create A New Profile

Advanced

Request for Assistance: Adding 2 New Axes and Replacing Extruder Ports E0 and E1 in Marlin for a 5-Axis CNC

Posted by hajiarab 
Subject: Request for Assistance: Adding 2 New Axes and Replacing Extruder Ports E0 and E1 in Marlin for a 5-Axis CNC

Dear Marlin Development Team,

I hope this message finds you well. I am writing to seek your guidance and support in a project I'm working on that involves customizing Marlin firmware.

I have a specific requirement to add 2 new axes to my 5-axis CNC setup and replace the extruder ports E0 and E1 on the RAMPS board. My hardware configuration consists of an Arduino Mega 2560 and a RAMPS 1.4 board.

Here are the key changes I aim to make:

1. Add 2 New Axes for a 5-Axis CNC:
- Configure Marlin to recognize and control a linear axis connected to port E0 using a TB6600 driver.
- Configure Marlin to recognize and control a rotary axis connected to port E1 using another TB6600 driver.

2. Replace Extruder Ports E0 and E1:
- Replace the existing extruder ports E0 and E1 with the newly added linear and rotary axes on the RAMPS board.

I want to emphasize that I do not intend to create a 3D printer; therefore, I do not require the extruder ports. The personal device I am creating is a 5-axis CNC machine.

I understand that this customization involves changes to the Marlin firmware, and I am eager to learn how to implement these modifications correctly.

Your expertise and guidance on how to configure Marlin for these changes would be greatly appreciated. Additionally, if there are any best practices or considerations I should be aware of while making these alterations, please do share them.

Thank you for your time and support. I look forward to your valuable insights and assistance.

Best regards,

Mahdi
<...snip...>

Edited 1 time(s). Last edit at 10/12/2023 03:36AM by Dust.
Please see [github.com]
Dear Marlin Development Team,

I hope this email finds you well. First and foremost, I would like to express my gratitude and appreciation for the exceptional work that the Marlin Firmware development team has done. Your contributions to the 3D printing community have been invaluable.

I am writing to seek your assistance and guidance with a specific issue I have encountered. I have successfully set up a 5-axis linear configuration on a RAMPS board using the configuration files provided at the following link: GitHub Link]

My intention is to designate the fifth axis as a rotary axis and control it using degrees. To achieve this, I have added the following line to the Marlin configuration:

#define AXIS4_ROTATES

However, I am encountering an error during compilation. I am seeking your expertise and guidance on how to resolve this issue and successfully configure the firmware for the rotary axis.

Any assistance or insights you can provide would be greatly appreciated. Your guidance will be instrumental in enabling me to progress with my project. I am confident that your expertise can help me overcome this obstacle.

Thank you for your time and consideration. I look forward to your response.

Best regards,

Edited 1 time(s). Last edit at 10/11/2023 03:50PM by hajiarab.
add #define HAS_ROTATIONAL_AXES 1 to your Configuration.h as a temporary work around

This is a bug, [github.com]
Much appreciated, Marlin development team. Your efforts mean the world!
Quote
Dust
add #define HAS_ROTATIONAL_AXES 1 to your Configuration.h as a temporary work around

This is a bug, [github.com]

----It does not work----

Marlin\src\module\planner.cpp: In static member function 'static bool Planner::_populate_block(block_t*, const abce_long_t&, feedRate_t, uint8_t, const PlannerHints&)':
Marlin\src\module\planner.cpp:2216:182: error: expected primary-expression before ';' token
distance_sqr = ROTATIONAL_AXIS_GANG(sq(steps_dist_mm.i), + sq(steps_dist_mm.j), + sq(steps_dist_mm.k), + sq(steps_dist_mm.u), + sq(steps_dist_mm.v), + sq(steps_dist_mm.w));
^
Compiling .pio\build\mega2560\src\src\module\stepper.cpp.o
*** [.pio\build\mega2560\src\src\module\planner.cpp.o] Error 1
Compiling .pio\build\mega2560\src\src\module\stepper\indirection.cpp.o
It does work I pre tested it

you added "#define HAS_ROTATIONAL_AXES 1" ? it needs the 1 on the end.

If your sure you did, please attach your Config files for examination
Yes, I've included this command and added '1' at the end:

#define HAS_ROTATIONAL_AXES 1

What does the '1' at the end of this command mean?

When using the above code, I removed this line:

#define AXIS5_ROTATES

Does this mean I should have used both codes side by side?
Because of being utterly drained from too much work and coding, I've gone a bit bonkers and pulled off the most comically absurd blunder! spinning smiley sticking its tongue out grinning smiley

Edited 1 time(s). Last edit at 10/12/2023 08:34PM by hajiarab.
yes it needs both

AXIS5_ROTATES is to say this is a rotating axis

HAS_ROTATIONAL_AXES 1 is patch to make AXIS5_ROTATES work.


these defines with parameters are effectively used as text substitutions

so in code there is #if HAS_ROTATIONAL_AXES , which become #if 1, ie is this true, and yes if 1 is away true so that code is used when HAS_ROTATIONAL_AXES is set to 1

Edited 2 time(s). Last edit at 10/12/2023 11:36PM by Dust.
Sorry, only registered users may post in this forum.

Click here to login