Welcome! Log In Create A New Profile

Advanced

Inquiry Regarding Marlin Firmware and Custom Stepper Motor Configuration for Circular Motion

Posted by hajiarab 
I trust this email finds you well. My name is Mahdi, and I'm currently using the Marlin firmware for my CNC setup. I am reaching out to seek guidance on a specific aspect of stepper motor configuration within the Marlin firmware.

To provide more context, I have recently configured the Marlin firmware with five axes and four servo motors. Notably, I have two stepper motors positioned along the X-axis, designated as X and U, respectively.

My current objective is to implement circular motion on the XY plane, with the added requirement of being able to choose between stepper X and stepper U for contributing to the circular path. In practical terms, I aim to draw circles using either stepper Y and X or stepper Y and U.

I am aware of the capabilities of G-code in supporting conditional statements, but I am uncertain about the precise implementation within the Marlin firmware for this specific use case. Could you kindly provide more detailed guidance on how to achieve the desired flexibility in stepper motor selection for circular motion?

If there are specific examples, code snippets, or detailed documentation available, I would greatly appreciate being directed to those resources. Additionally, any insights or best practices related to this customization would be immensely helpful.

Thank you for your time and assistance. I look forward to your prompt response and appreciate your support in navigating this matter.

Best regards,
Dear Marlin Support Team,

I hope this message finds you well. My name is [Your Name], and I am currently exploring the feasibility of implementing a specific G-code sequence within the Marlin firmware for my CNC setup. I would appreciate your guidance on whether this code is compatible and can be effectively utilized.

------------------------
; Initial settings
G21 ; Set units to millimeters
G90 ; Move to absolute coordinate mode
G92 X0 Y0 ; Set current coordinates to origin

; Select stepper motor (X or U)
#1 = 0 ; 0 for stepper X and 1 for stepper U

; Circle settings
Xc = 10 ; X coordinate of circle center
Yc = 5 ; Y coordinate of circle center
R = 3 ; Circle radius

; Select stepper motor based on condition
IF [#1 EQ 0]
G02 X[Xc + R] Y[Yc] R[R] ; Move in a circle using stepper Y and X
ELSE
G02 U[Xc + R] Y[Yc] R[R] ; Move in a circle using stepper Y and U
END

-------------------

I understand that Marlin supports G-code, and I am curious to know if the provided code aligns with Marlin's capabilities. Your insights on whether this code can be effectively employed for my CNC operations would be greatly appreciated.

Thank you for your time and assistance. I look forward to hearing from you soon.

Best regards
Sorry, only registered users may post in this forum.

Click here to login