Forward kinematics is used to compute the pose (position and orientation) the end-effector of a robot from the joint angles. Simialry, higher order forward kineamtics can be defined to calcualte the velocities of the end-effector from the volocities (and angular positions) of the joints. The same can be done for accelerations.
Inverse kinematics represents the same transformation but in a reversed direction. It is used to calculate the joint angles from the end-effectro pose. Simialry, higher order inverse kinematics can be defined for calculating joint velocities from end-effectro velocities (and pose). The same can be done for accelerations.
A curve is given in Cartesian space as a string of points. For each point the inverse kinematics problem can be solved, and so, a string of points in joint space can be computed. This string of points will consist of joint angle coordinates. If the joints are set to thee values, one after another, the end-effectro will describe the given path. Please be advised, that the points have to be close to one another. The closer they are, the more precise the curve will be.
The motors of all joints have to be commanded to turn in the positive or negative direction in order to reach the desired point. This is what the PID controller does. It gets the reference value (the desired angle) and then calculates the PWM duty cycle toe make the motor move. The PWM duty cycle, as a simplistic explanation, is proportional to the maximum speed of the motor. 100% duty cycle will turin the motor with full speed, 50% will turin the motor with half speed. The PID Controller calcultes the PWM duty cycle based on how far the desired point is from the current point. If far, high speeds will be reached, if it is near, only slow speed will be necesary.
So, if you want to make the robot follow a path, a simplisic approach is to:
- Define the curve in cartesian space a string of points
- Compute the joint coordinates of the robot for each point
- Select the First point in the list
- Command the motors of the robot to turn to the selected point
- Wait for the robot to arrive
- If there are point left in the list select the next point in the list and go to 3 if not end
A more advancced appraoch would need also velocity information from the Cartesian Space and would transfomr those velocitey to joint space and not just set motor positions but also motor velocities to generate a smoother motion.