Close
0%
0%

[Insert Robot name here] the Matlab Robot

This is a friendly DIY Robot I made for a class at my university that uses Matlab over a closed connection to process images and sound

Similar projects worth following
This is my fourth year studying Electronics Engineering so I decided to make a Robot for a class I attended last semester. The class was called Theory of Systems and Signals and there I became fascinated of the things we can accomplish with simple mathematical operations powered by the computing capabilities of a programs such as Matlab or Scylab.
The main purpose of this robot is to study the way we can process visual, and sonic information through a computer using different methods. Plus the project can expand to do a wide variety of things do to it's scalability The robot is based on open source hardware thus the configurations of the robot can be modified for even a bipedal form (Working on it, for the moment the biped robot tries to tear it's limbs appart, but totally working on it).

The Robot it's based on a Raspberry Pi model B+ configured with a custom Wheezy OS provided by Mathworks (Still don't know if it's simple wheezy with some basic programs installed or a heavily modified version of it, I'm new to Linux please help). This allows the board to connect to a computer connected in the same network thus you'll need a network cable for the original set up, or yu can use a WiFi dongle, but i don't recommend it because it takes extra time to configure. Afeter the connection is set you can execute remote Shell commands through Matlab itself or control the GPIO form the matlab command window.

JPEG Image - 892.94 kB - 11/23/2016 at 02:02

Preview
Download

MPEG-4 Video - 1.91 MB - 11/23/2016 at 02:02

Download

JPEG Image - 1.16 MB - 11/23/2016 at 02:02

Preview
Download

  • 1 × Raspberry Pi B+
  • 1 × Arduino Pro Mini
  • 1 × Custom PCB
  • 2 × DC Motor Whells
  • 2 × S3003 Servo Motors

View all 9 components

  • 1
    Step 1

    So I needed to set up the robot to be wireless, to have a camera and to drive 2 DC motors and 2 Servos wile reading the input from the sensors and camera, eeeeasy. Well for the wireless part I required the robot to move freely without Ethernet cables, the best way i found to do this is to make a WiFi hotspot in he Raspberry Pi itself. I'll leave links to how i setted up this and the next few thing in this project page. After that the computer can connect to the raspi with no effort and establish an SSH connection with the Pi, the bonus here is that the Pi always gets the same IP address so I didn't have to modify the script every time it runs. For the camera I first saw the example of the Raspi cam in the Mathworks page, but being honest in my country the Rapi cam costs as much as the devboard, so i opted for a webcam that i knew it was compatible. Now I needed to get the images from a cam not supported on the Matlab original functions, the work around here is to establish an IP Camera through the 8080 port in the Pi and reading the images with Matlabs Ip Cam support packages (I'm still trying to do this, right now i used the motion program but I have a 2 sec delay, now I'm leaning toward the mjpeg streamer but couldn't configure it quite nice yet). It's worth to mention that if you have a Raspi Camera this set up is very straight forward and doesn't requiere this much configuration.

    As every blog on the internet points put, the Raspi doesn't handle quite well PWM. The response I always get in the forums is that the core frequency of the Raspi can fluctuate thus generating discrepancies in the PWM output signals. So i can't drive the wheels nor the servos with it. My solution, use Arduino. I made a simple communication standard between the to using matrices from Matlab sent over serial, addapting voltages with a two resistor voltage divider, so that thing was done. After a couple of hours I designed a Raspbery Hat that can hold the Arduino Pro Mini and regulate the voltage to 5v for both devices, using Eagle CAD. The board also has connections for all the pins of both devboards, an L293D as a DC Motor Driver, a Voltage Regulator, In Serial Programer pinout, and Servo and DC motor output pins.

    In the middle of all this electronics and software mess I managed to design a Chasis in AutoCAD, and tested it's structural stability and part clearance with Autodesk Inventor (Did this because as I mentioned the previous robot had a tendency to tear itself apart and I used an easily breakable material on it, not a great combination after all; but as I said I'm still working on it). The day after I had my chasis printed in my local Laser cutting workshop, and by that afternoon it was complete (this was on August 9th).

    This is my first update on the project, and hopefully I'll have more to present to you guys in a couple of weeks. The finished date of this project is on the 1st of March according to my University, but that does not mean that I'll be done with it, told you we can make a lot of things with this thing and I'm sure I won't by March. You can follow updates on my works via instagram (@ich_heisse_augusto) and fell free to tweet me (@Fre4k4zoid) . Lastly I'll leave you with some reference links down below, thanks for reading :)

    Raspi Matlab Getting Started Guide

    http://www.mathworks.com/help/supportpkg/raspberrypiio/examples/getting-started-with-matlab-support-package-for-raspberry-pi-hardware.html

    Raspi as Hotspot Setup

    http://raspberrypihq.com/how-to-turn-a-raspberry-pi-into-a-wifi-router/

    Raspi as IP Cam Setup

    https://pimylifeup.com/raspberry-pi-security-camera/

  • 2
    Step 2

    Today 30/11/2016 I just finished compiling mjpg-streamer for the Raspi, took me quite some tiime to find a good guide on how to do so but yesterday I found this link (https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=100818) which explains perfectly how to do so. This allowed me to have a continuos image stream over Wi Fi with a latency of at most 100ms. Next week I'll be working on the face tracking algorithm since I discovered it wasn't behaving correctly.

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates