theAgingApprentice / HexaFloorRide

Arduino based six legged robot project
MIT License
0 stars 0 forks source link

Document how the inverse kinematic model works #22

Open theAgingApprentice opened 1 year ago

theAgingApprentice commented 1 year ago

There is a page in our online manual that has a poor attempt at explaining how the leg movement works. That explanation is in the docs/kinematicModel.md page. Update this document with better content.

nerdoug commented 1 year ago

This is as good a place as any to gather notes for a Kinematics document:

Definition of Kinematics: -the branch of mechanics concerned with the motion of objects without reference to the forces which cause the motion. -Kinematics is the study of the motion of mechanical points, bodies and systems without consideration of their associated physical properties and the forces acting on them. The study is often referred to as the geometry of motion, and it models these motions mathematically using algebra.

In our context, it concerns the control functions for the 3 servo motors that control leg positioning, and the resulting position of the end point of the leg, which we call the toe.

There are 2 basic tasks in kinematics:

Forward Kinematics, where the settings for your position controls are known, and you want to calculate the resulting position of the endpoint. In our case the positions of the 3 servos for a given leg are known, and we want to figure out where the toe will end up. This is relatively easy, and consists of apply basic trigonometry to the displacement angles of the servos, and the fixed lengths of the interconnecting body parts

Inverse Kinematics, where the desired location of the end point is known, and you need to work backwards (thus "inverse") to determine what position control settings are needed to achieve this positioning. For us this would mean that the toe position is known, and we want to figure out the angle each servo should be set to in order for the toe to end up in the desired position. In general, this is a more challenging mathematical task, and in some designs, can only be done by iterative methods. In our case, we are able produce the required angles analytically using 3D analytic geometry. This is fortunate, because doing complex iterative calculations for 6 legs at least 20 times a second might not be feasible.

The mathematical model of a leg

Real world constraints

Coordinate systems

Body parts, sizes and connectivity

Applied Forward Kinematics

Applied Inverse Kinematics

Dangers:

nerdoug commented 1 year ago

It may be expedient in the short term, and maybe even the long term, to ignore the rounded nature of the toe, and consider the toe's location to be it's point that is furthest from the ankle servo. This will simplify the math, and may not have much practical impact.

theAgingApprentice commented 1 year ago

I can always change the shape of the toe to end in something closer to a point if that helps.

theAgingApprentice commented 1 year ago

Put the above documentation into this markdown page