Motor Keyframer
In animation and visual effects, an artist uses “keyframes” to specify the position of a given element in a scene at a particular time, and using multiple of these keyframes, the animation software calculates the positions and times in between the keyframes to create a smooth animation. This project applies the sample principle to real-life cameras, and enables accurate and repeatable motion control.
Software
https://github.com/TheBigSasha/MotorKeyframer
Motor Movement

We already know that a digital animation is just a collection of keyframes, and that a keyframe is just a time value with a corresponding position value, so to design a keyframe system, all we need is an array of data with a time and position axis. To simplify the code, this system treats all motor positions as one “keyframeable” value – each time coordinate corresponds to 4 motor positions values. This reduces the size of the packet and makes accessing the data far simpler, and asynchronous control can be achieved by interpolating position values for motors whose movement is to be unaffected by a given keyframe.
The system receives a keyframe as a string, with commas separating integers. It knows that the data follows a standard format – time, positions, time – where the number of positions is defined in the software based on the number of motors in the system.
Based on this string, the data is parsed into an array which enables easier math operations looking forward and backwards in time to calculate the ideal velocities (and perhaps in future acceleration curves and PID Parameters) in order to make the motors move to their positions efficiently.
The system accurately times the moves and ensures their accuracy by referencing a millisecond (in future, microsecond) timer and position feedback.
Data Acquisition

The goal of the system software is to acquire a parcel of move data, and move the motors accordingly when given the signal. Data can be acquired in any way so long as the data is returned as a correctly formatted string. In the current version, there are 2 data acquisition modes.
Bluetooth Mode

Creating an good user interface on the hardware of the Motor Keyframer is possible, but it is both more difficult and less elegant than using an existing device to send data over bluetooth. This is why the primary interface with the keyframer is bluetooth (or any other serial port). Since bluetooth is used for various purposes – control, debugging, mode switching – one cannot directly send the move data without context. Because of this, the data is encoded in a packet which includes a type identifier, the data, and an end marker.
Recorder Mode
Normally, backlash from gearing, position loss upon restart, and missed steps would reduce the accuracy of a motion control system. In order to prevent this, each motor, or more accurately degree of freedom in this system must have position feedback. Since we have access to the positions of each axis regardless of the motors, if the motors are disengaged, the system can be used in order to encode a manmade move which the motors can subsequently replicate.

To start recording, the system is given the sample rate and optionally a recording time, and when the recording is finished it returns a string of the manmade move, of the same sort as it could receive over bluetooth or otherwise.
Hardware
Expandable, Standard Chassis Design
The hardware of the motion control rig follows the same philosophy as the software – complete modularity.
Closed-Loop Positioning System
Using encoders placed after all the gearing of the motors, directly on the point of rotation, the most accurate possible position data can be gathered. Because of this encoder placement, any motor can be used to drive the joints with positioning being maintained.
Standard, Adjustable Components
Throughout the motion keyframer’s hardware, considerations are made for expandability and compatibility. All of the stepper mounts are a standard NEMA 23, the servo control is standard Dynamixel TTL, and the encoders are connected in a motor-independent manner.
Using aluminium X beams, the NEMA23 stepper mount and bevel gear have adjustable spacing in order to ensure gear meshing regardless of shaft length.