With this planar robot you can play with forward and inverse kinematics and control algorithms.
The second and third version are based on the Teensy 3.2 microcontroller, stepper motors and limit switches.
The third version has two additional holes to attach two incremental encoders connected to the robot joints using timing GT2 belts.
The first version involves the closed loop control of a DC motor coupled with an encoder and at the same time the kinematics concepts in robotics.
The basic program of the second version uses the teensystep.h library:
Three libraries are needed to start running the program with the optical mouse:
If you want to control the robot with the mouse (It can be controlled with many other interfaces like touchscreens, joysticks or sending trajectories form a vector) you need this library:
The motor driver library (Other motor driers can be used such as L298N):
The PID Controller library to control the motor position in closed loop with the encoder position: