1

in a 5 axis machine, I use forward kinematics to know the orientation of the tool from the position of C and A axis:

5x head

Forward kinematic it's easy in Qt:

QVector3D forward_kinematic(double C,double A){
  QQuaternion aRotation=QQuaternion::fromAxisAndAngle(-1.0f, 0.0f, 0.0f, A);
  QQuaternion cRotation=QQuaternion::fromAxisAndAngle(0.0f, 0.0f, 1.0f, C );
  QQuaternion totalRotation = cRotation*aRotation   ;
  QVector3D  rotated_tool_axis = totalRotation.rotatedVector(QVector3D(0,0,1)); 
  return rotated_tool_axis;
}

This axis configuration is's very easy, but can be different, for example

aRotation=QQuaternion::fromAxisAndAngle(1.0f, 0.0f, 1.0f, A);;
cRotation=QQuaternion::fromAxisAndAngle(0.0f, 0.0f, 1.0f, C );;

My question is: how can I do inverse kinematics?

From tool orientation vector to C and A axis position

for example, for axis parallels to XYZ I can use auto vect =quaternion.toEulerAngles(); Then, euler angles are equal to axis position.

example, for (1,0,0)and (0,-1,0) axis I use

inline QVector2D forward_kinematic( QVector3D orientation){
 auto quaternion=QQuaternion::rotationTo(QVector3D(0,0,1),orientation);
 auto vect =quaternion.toEulerAngles();
 return  QVector2D(-vect.y(),vect.x());
}

But I don't know how how to do it with others axis configurations

  • Are you sure that you didn't swap the meaning of inverse and forwards kinematic? We're doing robot sim. The usual meanings I know: Forward kin.: compute tool coords from axis values. Inverse kin.: compute axis values from tool coords. I'm read your question 3 times (on 3 days) wondering why somebody had problems to solve forward kin. after having solved inverse. Usually, forward kin. is trivial (just multiplying the matrices) but inverse is more difficult. – Scheff's Cat Dec 06 '18 at 13:30
  • However, in a 5 axis CNC, this is not that complicated (but I must admit I don't know so many CNC machines). 3 translation axes (prismatic joints) for position, 2 rotational axes (revolute joints) for tool orientation. This can be solved analytical: decompose azimuth and elevation from rotation matrix corresponding to tool orientation, transform from TCP to tool frame, and read prismatic joint values from matrix. At least roughly this way... – Scheff's Cat Dec 06 '18 at 13:38
  • You are true. I'm using inline QVector2D inverse_kinematic( QVector3D orientation){ auto quaternion=QQuaternion::rotationTo(QVector3D(0,0,1),orientation); auto vect =quaternion.toEulerAngles(); return QVector2D(-vect.y(),vect.x()); } for machine aixis parallels to XYZ. FOr more complex orientations ist not easy, for example (1,0,1) and (0,0,1) – Miguel Angel Pons Dec 07 '18 at 14:41

0 Answers0