Category Archives: Raspberry Pi

Lidar Robot

This is a video of my DIY Lidar robot. Here it is using a spinning laser distance sensor (Xiaomi robot vacuum spare part) to drive around and avoid obstacles. The sensor is connected to a Raspberry Pi running a Python script that is the main behavior program. There is no mapping going on, the robot is just going forward and turning away from things that are to close. The Raspberry Pi then sends serial data to an Arduino that controls stepper motors driving the robot.

The Xiaomi laser distance sensor is connected to a Teensy 3.2 running code from this project: https://github.com/getSurreal/XV_Lidar_Controller

The Teensy 3.2 is running PID speed control for the DC motor that spins the sensor. It is also reading the binary sensor data and sends it in easy to understand ASCII-messages over serial to the Raspberry Pi. The sensor spins at 5 revolutions per second and makes a distance measurement for every degree. Resulting in 360*5 = 1800 measurements per second. The accuracy is within a few centimeters. This sensor trigonometry to measure distance, in that way it is not a real Lidar sensor.


Indoor navigation robot update

It has been some time since a worked on this robot. This is a video of me building and installing the main PCB on the robot. The video was actually recorded several months ago, but now I recently found the inspiration to continue to work on this project.

The main board has an Arduino Due that controls the two stepper motors that drive the wheels. The PCB also has a lot of other features including servo outputs/inputs, MOSFET outputs, bumper sensor inputs, 6 DOF IMU (gyro and accelerometer), a few buttons and LEDs, and a couple of other things. In the video, I connect an RC receiver the servo inputs on the board and drive the robot abound using remote control.

The future plans for this robot are to implement a serial interface in the Arduino Due, and then connect it the Rasberry Pi. That way the Rasberry Pi will be able the drive the stepper motors and also read data from the IMU and other sensors. Then I can make a python script or something running on the Pi that gives the robot some interesting behaviors.

I also plan a replacing the Time Of Flight LIDAR sensor mounted on the stepper motor seen in the video with a rotating Laser sensor instead. The problem with the Time Of Flight sensor is that it has a very limited range and sampling time. I recently found out about the rotating Laser Distance Sensor (LDS) used on Xiaomi robot vacuum cleaner robots. It is available for cheap as a replacement part the vacuum robots. There is also an open source project to control the spinning of the sensor an read data from it, which should make it relatively easy to connect to the Rasberry Pi in my robot.

New robot project

This is a new long-term robot project I have been working on for the past couple of months. It is a general purpose indoor robot, that will work as a platform for experimentation. When designing this robot, I have tried to think about and improve everything I have learned from previous robot projects I have made. But this robot will also feature some new stuff I have not tried before. Some of the key features if the robot includes:

  • Stepper motor based four-wheel-drive skid-steering drive system
  • Big Li-Ion battery
  • A lot of custom 3D printed parts
  • Heavy duty bumpers, large ground clearance and large foam wheels
  • Raspberry Pi main computer
  • Arduino Due for controlling low-level peripherals
  • Scanning Lidar sensor
  • Probably a Raspberry Pi camera module mounted on a pan/tilt system

So far, only the majority of the mechanical work is done. Here are a few images, click on them to make them larger:

Balancing robot simple autonomous behavior

Made a new video demonstrating how my Arduino based balancing robot can enter balancing mode by itself. The video also shows the robot doing basic obstacle avoidance using its tree ultrasonic rangefinders. The obstacle avoidance if currently done by one of the Arduinos, but this a typical high level function that will later be handled by the Raspberry Pi.

Balancing robot update

900_DSC_4964

I have made some progress with the self balancing robot. The speed of the motors is now controlled using two cascaded PID regulators. One regulator adjusts the speed of the motors to maintain a setpoint angle. The other PID regulator adjusts this setpoint angle according to a setpoint speed. This new control system allows the robot to return to its original position when disturbed. The robot can also find a new angle for balancing if the center of gravity is moved, or the robot is standing on an inclined plane.

In this video I use the Raspberry Pi for a very basic form of remote control. I connect to the robot using SSH, then I run a serial terminal program on the Raspberry Pi to send ascii characters the the main Arduino. The video also shows an example of video and photo quality from the Raspberry Pi camera.

The three ultrasonic distance sensors and the tilt servo for the camera module are not connected yet…

More info about this project here