Back to previous page

Some academic and extracurricular projects

Robot learning using DDQN and NEAT for a 2 DOF pointer robot

May 1st, 2020

Just for fun, I wanted to build a robot that learns by experience. I designed and built a small robot that learns to control a laser beam using Deep Reinforcement Learning, Neuroevolution, and Computer Vision. The 2 DOF robot learned to point its laser beam to reach a target located at the center of two marks. It received the graphic information from a smartphone’s camera. Then, it identified the beam and marks' positions in real-time using computer vision. The high-level processing is done on a computer and the Arduino acts as the robot's low-level controller. For the communication between these devices, I used my PyDuino Bridge Library, which I developed in 2020, before the LLM era, and which is freely available for the community.

The setup, the learning loop, my PyDuino Bridge library (developed in 2020, before the LLM era) and how DDQN and NEAT learn, both mapping 4 inputs to 4 moves of the laser dot, ending with the DDQN run; the network diagrams are schematic. Music: Sascha Ende, ende.app (CC BY 4.0). Sound effects: Kenney (CC0). Visuals include public project media.

The algorithms tested were the Double Deep Q-Learning (DDQN) and NeuroEvolution of Augmenting Topologies (NEAT). The first algorithm performed better, and its results are shown below.

Inputs and outputs of both models: the camera view gives the beam and target positions, and DDQN or NEAT chooses one of 4 moves of the laser dot: up, right, down, or left
Inputs and outputs of both models: computer vision gives the beam and target positions in the camera image (4 numbers), and the model chooses one of 4 moves of the laser dot: up, right, down, or left.
Physical setup of the pointer robot during its first trials
Pointer robot learning to move the laser beam to the midpoint between two bottle caps
First image: Physical setup of the robot while executing its first trials (please ignore the little hole in my wall, as the robot does). Second image: Robot learning to move the beam to the desired position, which is the midpoint of the segment that links the red and green bottle caps (that target point is marked with a blue dot).