Move the end effector through a straight line in polor co-ord with speed profile

I’m looking to move the end effector through a straight line (shown in green) with a certain acceleration & speed profile using a rotation and an extrusion joint as shown in the image.

I’m planning on tackling it in two phases
a,) The first step is to interpolate a certain number waypoints along the straight line in terms of theta and distance of the extrusion joint, highlighted in yellow in the image.
b.) I will know the approximate end effector distance between the waypoints, so from there I think its a matter of controlling the stepper motors over time to create the desired constant acceleration at the start (assuming its within the limits of the individual steppers) constant speed for the “middle” of the line and de-acceleration at the end.

I don’t think a library like AccelStepper works here; as it will do the acceleration on each waypoint sub-segment; not across the entire “straight” line. A somewhat similar discussion https://groups.google.com/g/accelstepper/c/R1Dz3xVNfGM recommends looking at Grbl, as does http://www.buildlog.net/blog/2017/08/the-polar-coaster-a-drink-coaster-drawing-machine/

1.) Am I tackling this problem in a reasonable way; or could I re-frame my approach?

2.) Is Grbl a reasonable library to look at using to execute the required steps over time to achieve the desired end effector movement profile?

3.) What type of functionality will I have to implement if I use Arduino - Stepper directly instead of Grbl?

Thanks

so from there I think its a matter of controlling the stepper motors over time to create the desired constant acceleration at the start

The theta stepping motor will not be making equal angles in equal units of time. As the angle deviates from the vertical you motor moves through a greater angle to achieve the same unit step along the horizontal.

Therefore you need a stepping motor speed profile, calculate to match even spaces on the horizontal but smoothed to prevent discontinuities. Something you are going to have to write yourself.

What is an end effector anyway?

Hi,
I think you had best explain what "end effector" dynamics is about before asking for solutions.

Tell us what your project is and what "end effector" has to do with it, also what involvement Arduino is to the system.

Thanks.. Tom... :slight_smile:

In robotics, an end effector is a device or tool that's connected to the end of a robot arm where the hand would be. I'm just using the term to identify a point in space that is of interest. As Mike pointed out; this point in space (previously called end effector) will move as a function of the changes in the theta angle and extrusion distance.

In terms of writing it myself; any suggestions on reasonable starting points?

The [1] Arduino stepper library is very simple; perhaps I would use it each time I need to step a given Stepper 1 step

Might make sense to take some inspiration from AccelStepper in terms of time since start of movement, allowed acceleration and max speed and then work out if any Stepper should move "right now" (or as soon thereafter as the micro controller can write to a pin)

Grbl is a few orders of magnitude more sophisticated than either of the above; but likely has some/all the lessons learned I need - I'm sure there is priceless info in [2] for example

[1] Stepper/Stepper.cpp at master · arduino-libraries/Stepper · GitHub
[2] grbl/stepper.c at master · gnea/grbl · GitHub

Programmed movement of the end effector along a desired path is called "inverse kinematics", if you want to look it up.

Yes; indeed. I have (somewhat surprisingly) gotten through the Inverse Kinematics; so this post is about exploring actually getting the steppers to go to where the Inverse Kinematics says they need to be.

The result of your study of inverse kinematics will be the equations that produce the desired motion. What are those equations?

The way this forum usually works (see "How to use the forum") is that you post your best code attempt, and explain the difficulties you are having.

The output of the inverse kinematics equations is an angle and a distance.

Currently I am just asking for guidance on a good way to approach implementing moving steppers to achieve said angle and distance.

If I don't get any suggestions I will start typing what seems reasonable to me; but perhaps someone could prevent me from heading down a foolish path; prevention being better than a cure and all those good things.

What have you not posted the equations and code?

The [1] Arduino stepper library is very simple; perhaps I would use it each time I need to step a given Stepper 1 step

Why?
Assuming you have a stepping motor driver then to move one step is simply:-

digitalWrite(stepPin, HIGH);
digitalWrite(stepPin, LOW);

Grbl is a few orders of magnitude more sophisticated than either of the above; but likely has some/all the lessons learned I need

Well I doubt it, that is used for linear movements of motors. Bresenham line algorithm is simply about two dimensional diagonal lines. I can't see that helping you.