-
Notifications
You must be signed in to change notification settings - Fork 5
DriveFrame
The traditional way to build a robot is to start with an ideal kinematic model (i.e., Cartesian, rotary delta, SCARA, etc.) and then build physical robots to match that ideal kinematic model. This approach requires exquisite care in engineering and manufacturing design. All that care costs a lot up front, but is repaid abundantantly in product volume. But, however successful this approach may be for industry, it makes little sense for DIY robots assembled on a whim.
DIY robots are never ideal. They are made out of plastic parts that grow and shrink during the day or when it rains. Their axes are never exactly at right angles. Their drive belts stretch (and their operators ignore that). Parts come loose and even drop off (and their operators ignore that). DIY robots are all cranky, temperamental individuals: no two are exactly the same.
Kinann is designed for robots with personality. In fact, Kinann totally ignores ideal kinematics and focuses instead on modeling robot kinematic invariants. All DIY robots rely on the same invariants: the position of each drive with respect to its homing origin. Kinann makes no assumption about how drives are positioned with respect to each other. But you can train a Kinann neural network (KNN) to behave like an ideal robot--even if its arms are at 60 degrees to each other when they should be at 90.
Kinann models robot-centric kinematics with the DriveFrame class. The DriveFrame class relies on a non-orthogonal reference frame of drive-based coordinates to represent robot state. Using drive coordinates as a reference frame for robot state makes a DriveFrame "self-centered" by design. Oddly, this is good, because self-centered kinematics are robust and unambiguous--you can tell your robot to position itself at [10,20,30] and it will. Always. But...
Of course, if robot state is based on self-centered kinematics,
it is also decoupled from application reality.
In particular, this means that an untrained Kinann robot
is lost and useless until it is calibrated.
For calibration, the application simply invokes the calibrate() method
to iterate over training examples that map intrinsic "self-centered" positions
to their corresponding extrinsic "real-world" positions.
Once calibrated, a DriveFrame
controlled robot responds with application ideal kinematics.
A DriveFrame is a collection of drive Variables that together define the intrinsic position state of a robot. For a 3-axis robot, we might have the following state variables:
- state[0]: x-drive position in millimeters
- state[1]: y-drive position in millimeters
- state[2]: z-drive position in millimeters
DriveFrame state is independent of robot geometry, but together they determine extrinsic or "real world" position. For example, knowing that a 3-axis robot is in DriveFrame state [10,20,30] only helps us if we know the robot's current geometry. Calibration gives us the relationship between intrinsic DriveFrame state and extrinsic robot position.
Since backlash is intrinsic to each drive, we incorporate it into the DriveFrame state as deadband position:
- x-drive position in millimeters
- y-drive position in millimeters
- z-drive positionin millimeters
- x-drive deadband position [-0.5,0.5]
- y-drive deadband position [-0.5,0.5]
- z-drive deadband position [-0.5,0.5]
DriveFrame automatically calculates deadband position using hyperbolic tangent (tanh) function, which has an abrupt but smooth transition from -1 to 1: