Motion profile generation and control philosophy

Hi Guys,

Sorry, this post became too long but I wanted to give enough info for anyone to understand.

///////////////////////////////////////////////////// Some background info ////////////////////////////////////////////////

  • I have worked on PLC motion control in a lot of ways and one of the way to motion control is with pulse direction servo/stepper motors.
  • In PLC function everything is inbuilt, we pass target position, velocity, acceleration and deceleration and the functions generate the pulse for servo motors to move.
  • The output frequency of pulses define the velocity of servo motors and output number of pulsed define the position. The function does all internally.
  • I am trying to implement that function in future so want to discuss and understand its control philosophy what will be a good starting point for me.

///////////////////////////////////////////////////// Reference implementation from past ////////////////////////////////////////////////
For your info, In past, I have used a methodology in controlling movement of linear hydraulic cylinder in closed loop mode. My PV is position feedback of cylinder, SP is target position and CV is velocity command to valve. I calculate position points from start position to target position, and based on the total time to complete the movement, I give calculated position points as SP to pid controller cyclically and cylinder position feedback acts as PV for pid. Now the pid’s cv acts as velocity for the hydraulic actuator. Using this philosophy i am able to achieve good position control. but PID tuning is required when system changes.

///////////////////////////////////////////////////// Need Help here ////////////////////////////////////////////////

  • For my implementation, I have planned to generate position profile points 3rd degree polynomial from start position to target point then calculate velocity profile from the position profile and generate pulse frequency based on velocity profile.

Does anyone has suggestion or guidance? I am a bit confused where to start with.

Below attached image is position vs velocity what I want to achieve.

1 Like

Maybe have a look at
and on our gitlab.

We realized a profile generator realizing a time-optimal motion under speed, acceleration and jerk constraints.
The position setpoint values are piecewise degree 3 polynomials.

Please have also a look at this document which explains the mathematics behind :
PG_math.pdf (158.5 KB)

1 Like

I forgot to say that this works well for motions along a straight line, typically for pick and place.

CNC machining trajectories are a completely different business since the trajectories are curved, and normal acceleration components arise from the curvature.

Ok ?

1 Like

Thanks for the detailed explanation @Raoul.