I usually do not ask for help but for 2 weeks I gave googled myself to death for Arduino code snippets.
I am trying to cut code for a project that has a turntable base (stepper driven) and an extend and retract arm on top of the turn table (Stepper driven). From what I have read, the Scara library should do what I need. Nowhere can I find code on how to implement in the IDE.
Any help would be appreciated.
KimBrussow:
Nowhere can I find code on how to implement in the IDE.
That's the fun of Arduino, you get to write the code yourself.
A typical project would be to move X 200 steps and Y 200 steps to reposition to an exact 45 degrees right and up. The scara library will translate move arm A 45 degrees and arm B 45 degrees to achieve the same effect.
the human arm operates the same way (upper arm and forearm move relative to each other) Cartesian coordinates are move X to here and Y to there. Scara Arm 3D Printer - RobotDigg shows an example.
What, exactly, is the "Scara library" and why do you think it will do what you want?
The link to robotdigg.com posted above clearly states that the robot firmware is not open source.
It sounds like what you want is inverse kinematics, for which there is plenty of open source code. But you haven't described the project clearly enough for us to know.
on my machine the code I am talking about is located under ..\Marlin-1.1.x\Marlin\example_configurations\SCARA\Configuration.h
I know I have not stated my situation properly so let me try again.
On a simple 3D printer there are 3 axis X,Y and Z.
Once you identify HOME and the number of motor steps to move a given distance, it is easy to output to your printer a command to move (100 motor steps = 10mm direction movement)
My situation is different.
My movement is not in a straight line for one axis but rather a rotational movement. The other axis is relative to that rotation.
I need help in developing code to translate Cartesian vs. Polar Coordinates to achieve the same movement.
The attached photo shows my layout
I need help in developing code to translate Cartesian vs. Polar Coordinates to achieve the same movement.
To translate Cartesian to Polar coordinates:
float x = 4.24;
float y = 4.24;
float radius = 0;
float angle = 0;
void setup()
{
Serial.begin(115200);
radius = sqrt(x * x + y * y);
angle = atan(y / x);
Serial.print("Radius = ");
Serial.print( radius, 3);
Serial.print(" Angle = ");
Serial.print(angle);
Serial.print(" radians or ");
Serial.print(degrees(angle));
Serial.print(" degrees");
}
void loop()
{
}
Radius = 5.996 Angle = 0.79 radians or 45.00 degrees
Have you considered reading the documentation for your software?
Thank you for the feedback
there are 1000s of pages of documentation on how to do what. I was simply asking for a little guidance not abuse.
Sorry, I missed that you were hoping we would read the documentation for you, and pass on the relevant bits.
For some great advice on how to get informed help from this forum, please read the "How to use this forum" post at the head of each topic section.
Delta_G and jremington I appreciate your kind words of advice.