# Controlling 4 stepper motors with a formula

Please excuse lack of knowledge brand new to this!! (Picture attached for reference)
I want to mount 4 x nema 17 stepper motors on a square board at each corner (A,B,C,D) each motor will have a pulley on it with a line , all four lines will attach to a central weighted point (Point of pyramid) . I would like to send co ordinates to the arduino in the form of (X,Y,Z) which will control the motors to extend or retract the lines and move the central point to the co ordinates sent.
I have created a formula on excel to calculate the length of each line needed in correspondence to the co ordinates entered. (Attached pic)
I would like to use a program like Fusion 360 to create a profile and create tool paths , then generate the G code and be able to send that to the Ardruino

I have the Arduino mega board with CNC shields

What i would like help with:

1. How to I translate the formula i have to each motor
2. what do i load to get the G code to the arduino or can i just use some thing like Grbl controller

Or any advise to assist would be great
Sorry again for lack of knowledge still learning !!!
Thanks

(mod edit)

There are 3D printers that work like that but they usually just have 3 motors. I can't remember what they are called but I'm pretty sure there is ready-made software to control them based on GCode that is sent to them. And I suspect the GCode just represents the tool position the same as for any type of 3D printer with the calculations for motor movements done in the Arduino program.

Have a look on the RepRap Forum.

...R

This is called kinematics - the mapping from actuator position(s) to device position(s).
The task of determining actuator positions from desired device position values is called "inverse kinematics".

The question is where to put that mapping in your system - once you have G-code you'd have to do
that inside the G-code interpreter really, or else have a G-code re-writing tool that could do this?

I note there's a python library, pygcode, which can parse and output gcode, perhaps that's one route to
explore?

[ And one worry, you need 4 coordinated axes, not just 3, which might be beyond simple G-code systems ]

There are many programs out there that will take a simple 3d representation and convert it to g-code.
Open source versions are often better in many respects as they can be quite simple.

Maybe a simple diagram explaining how you will employ the 4 steppers would be in order ?
Grbl shields do have some limitations in that most just CLONE another axis for the 4th motor and I suspect you actually need a seperate (independent) control which many of the 3d printer boards offer. (as mentioned)

So separate X,Y,Z,A axis is what you are looking for until we see how you intend to employ the mechanics.

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.