Zumy

Zumy! This is a project to keep me sane through the monotony of school.

It all started with a Pi. A while back I made an attempt at building a wifi connected robot on a boe-bot chassis. After joining the military, moving, and schooling I lost track of the project. So here is round two. I bought a Raspberry Pi model A+, Pololu Zumo chassis, two micro gear motors, an arduino pro-mini 3.3v 8Mhz, a wifi adaptor, and a DRV8833 motor driver carrier.

The pi

So first things first. I messed around with the layout. My goal was to keep it as compact and low to the ground as possible. So, I mounted the Arduino Pro Mini (henceforth refered to as APM), and the motor controller on the back of the chassis. This allowed me to reserve the main mounting surface for the Raspberry Pi,(hencefort refered to as RPI). The mounting is a bit unconventional, and not the best for heat dissipation but it fit my goals.

 

Layout

So with the layout determined and the connections made between the APM and motor controller(henceforth refered to as DRV). I set out to write a serial motor control program for the APM to control the DRV. Basically I used switch-case statements and did not allow for speed control, which was a issued I intended to fix, until something bad happened(*suspense music), which I will address later.

So the motor control program worked well enough and I mounted the RPI. I made the connections from the RPI's UART pins to the APM's. I connected a 7805 5V regulator and powered the RPI from the pins, I know it's not the best method, but again it fit with my goals. I know that the regualtor needs above a certain threshold to regulate voltage the reliably, but being stubborn I wired it to the 4AA batteries in the Zumo chassis, I even added capacitors for brown-out. As i should have expected, everytime the motors stalled the terminal voltage dropped and the RPI reset. So I went about writing some python code to communicate with the APM and provide a simple GUI. 'WASD' were my directional control keys and 'Q' activated the DRV's sleep mode. It indicated if the serial port was open, whether the sleep function was activated, and whether or not debugging data was being recieved from the APM. This worked wonderfully, but alas tradgedy strikes.

Add the Pi!

I bought a rechargable USB battery pack and mounted it to the chassis. In the midst of rewiring the RPI,DRV,and APM I used an multi-meter set to measure ohms to figure out which wire was which in the jumble of connections. I forgot to disconnect the TX pin and measured the resistance to determine which wire was which. because a voltmeter produces voltage to measure resistance, i believe this shorted the TX pin to +3.3v. Sad day. Communication between the RPI UART and APM ceased. After a good bit of troubleshooting I determined that the pin on the RPI was at fault. Rookie mistake.

Current Setup

Above is the current setup. I rewired the DRV to connect to the RPI GPIO pins, therefore  I have no PWM to control speed. It works quite well in light of this.

 


 

     The majority of the preceding text was more or less a description of the hardware. The control aspect of this has taken many forms. Originally it was controlled via SSH and Minicom. I sent the command characters directly to the serial port. Then, still in the mindset of SSH I started to use Paramiko and write a simple gui based around that. Being a fan of simplicity, I installed TightVNC and have it start on boot. The I wrote a python program using Pyserial and the Pygame modules. It worked quite well and gave me good troubleshooting feedback. Then the incident with the TX pin occured and rather than writing a new program I used the GPIO library and use it to control the pins as inputs to the DRV which is an H-bridge. My goal is to mount a NOIR camera and a pan-tilt servo set on the front. I wanted to use an arduino to do this but since the UART port is broken and there is only one USB port I need to find a way to achieve this. The main issue is time, I am in the military and in one of the most difficult schools they have to offer, so if my updates are spaced rather far apart I apologize. I am not a software or hardware engineer, I enjoy robots as a hobby and know I do not have all of the answers, therefor any suggestions are more than welcome!

___________________________________________________UPDATE________________________________________________

So after finishing up some very difficult schooling I finally have time to work on my bot again! I 3D printed some brackets and such for the camera. I mounted a rechargable cell phone battery to power the RPI. In the base of the zumo chassis is 4 double A's to power the motor and servo. One of the newer things I did is use a Picaxe 08M2 to be a servo controller. Initially i had a APM to provide a hardware PWM signal for the servo, i did this because the software generated PWM signal is really jumpy. So, i porgrammed the 08M2 to increment and decrement when a digital pin is turned on or off. Considering what i need the servo for this is much easier. I've been working on some socket programming to control it over the local network. I also stream the video with netcat and mplayer.

Above is the servo controller with the picaxe 08M2. More to come!


This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/zumy

What are those metal brackets on the bot?

Thanks!

I believe that the RasPi can
I believe that the RasPi can control servos. You would just need a power supply for the power/ground part of the cable.

Yes! I used the GPIO library

Yes! I used the GPIO library and its pwm. It woeks great thanks for the suggestion!

They are what I mounted the

They are what I mounted the pan/tilt servo set on. they also work well to redirect the robot from the wall. Thanks for the question!

So they are not meccano?

Where did you get them from?

Thanks!

Batteries and whatnot

I’d be interested to know what battery pack you used to power the RPI.

Also, and this might just be my being thick… Why did you use an arduino? As oppose to just controlling the motors straight from the RPI’s GPIO ports and a motor controller.

A battery pack like the one

005.jpg

A battery pack like the one pictured above is what I use to power the RPI, I took it out of the casing to save space, it works great! I used the Arduino to provide a hardware PWM for the servo. The RPI can provide a PWM signal but since it's a software generated one it causes the servo the be really jittery. So I eventually replaced the Arduino with a picaxe 08M2 which works great. Let me know if you have any more questions!

I apologize that i didn’t

I apologize that i didn’t see this when it was posted, there is a hobby section in Home depot that keeps things like this stocked.

btw about your goal: "My

btw about your goal: "My goal was to keep it as compact and low to the ground as possible"

why the robot should be compact and low ?

 

because i intended it to be

because i intended it to be a little security bot for around the house. I wanted it to be able to go under the couch and things like that. Also i like seeing how much functionality i can fit into a small space, its a personal challenge! Thanks for the question!