Let's Make Robots!

Work in progress. I don't know if this will be 2 robots or one yet. My wife got me an OWI Robotic Arm kit and a DFRobot 4wd Chassis for christmas. I picked up some L293D motor driver shields, ultrasonic senors, IR recievers and a couple micro servos. Last night I got the arm set up to run off the motor board and set up a serial communication controller in java. I still need to put feedback pots on the arm joints to tell rotation vs pulsing the motors for 500ms per click, but for now its a fun little 6v robot arm that can run off a 4 AA battery pack and be controlled by via the computer.

UPDATE: 1/7/2014
Got the motorshield up and running on the chassis and got a decent motor test now.  The DFRobot platform performs terrible on high carpet at <6V  so it can't do skid steering very well.  I compensated by driving one side at full speed and the other at half speed to make it rotate.  You may be able to tell that this still stalls at least one motor pretty regulary on my thick carpet.  But it will work for my purposes.  The 4wd WILL drive over EVERYTHING with sufficient power.  It runs over feet and shoes etc very well and can even flip itself over very easily by running into an obstacle (no sensors yet).  Next step will be to add sensors to the base and then we'll see if i'm making one robot with an arm mounted or just a rover and second project for robotic arm.

 UPDATE 1/14/2014
I was waiting this week for my bluetooth module from adafruit.  Spent some time coding an android controller while i wated... here's a screenshot of how it will work... i can drag around the screen and it will update the direction/motor speeds.  now that i have my bluetooth module i'll be writing the serial communication code from the app.  
Rover App V1
 

UPDATE 1/15/2014
wired up a right angle 6pin out on a proto-shield and hooked up my bluetooth serial module (adafruit bluefruit ez-link).  Updated a motor test to allow serial control.  I configured Bluetooth Serial Controller for Android to have buttons for forward, reverse, left, right and a stop button.  Its very satisfying to drive around with bluetooth from my phone.  I did a quick test run outside on gravel, grass and concrete to see how it drove and it works amazing outside... the carpet in my living room is a bit much for turning, but outside it works great.  Will post video soon.  
I'm also considering outfitting it with a low-power laser diode i have on my work bench to mess with my new kitten tomorrow. I stress low-power because a high powered cutting laser on a robot would be crazy... or would it? (meniacal laughter).

UPDATE 1/17/2014
Uploaded 2 new videos to show the bluetooth control (still don't have the app done so just using Blutooth Serial Controller for now).  I DID end up putting the laser on it.  the cat goes crazy about it... As it turns out i really like the laser because it makes driving easier since you can see where the robot is pointing.
I also got a quick test of the Ultrasound working too.

 

UPDATE 1/22/2014
Nothing exciting to show for the past week.  But i did want to share my sensor rig.  This is the first time i've seen how nice having multiple breadboards is.  I can set up test circuits on them and leave them up (like the  LCD screen).  I also played with I2C and set up a port extender reading and writing to/from the arduino.  I2C Is AWESOME!  I expect to use it a lot in the future.

The photo below shows all the different types of sensors I plan on putting on the final robot.

  • 1 x Ultrasonic Distance Sensor servo mounted in the front  for obstacle avoidance/diretion determination in autonomous mode.
  • 4 x IR Digital Distance Sensors in front of each wheel/corners for small obstacle avoidance/keep from running into chair legs.
  • 4 x 38 Khz IR sensors on each side for directional IR beacon detection.

 

Sensor rig

The goal is to have this thing drive to a beacon (ball), pick it up with a magnet then drive to another beacon (ME) activated after the robot fetches the ball.

 I was struggling with the directional IR homing beacon sensors until i found the project page for blimpduino.  The blimpduino project uses 4 x 56khz sensors and an atmega 328 for directional beacon location.   They provide full source code and i did some tests with it.  The project references the pololu product that does the same thing, but i didn't want to spend the extra money for one of those boards.   I've been testing it with a remote control but it doesn't have very good accuracy right now.  I'll probably need to add a dedicated atmega 328 communicating on I2C.  If anyone has any thoughts on IR Homing Beacon Recievers i'd appreciate the advice.

One other note for this update: I found out this week that my 3 Year Old son can drive a bluetooth controlled robot surprisingly well! 

UPDATE 1/23/2014
I threw together this little sensor mount (head) over lunch.  I made this from a little project box i had laying around like i saw on TOBI  I have holes for the US to fit through and a hole to screw the servo horn into the servo as well as another mounting hole for the laser.  This is a prototyping head only, i plan on making a nice 
 vacuum formed enclosure.

Rover Prototype Head


 UPDATE 1/26/2014

got some code written for the head to do a proper test of the ultrasonic sensor and servo (see video).  next i need to add some leads to my protoshield to connect the head to the same board as my motor driver so i can actually use the sensor and servo while driving :).  In hind sight a different motor driver that wasn't a shield would have been much easier to work with or at least one with passthrough leads instead.  oh well live and learn...

 

UPDATE 1/30/2014

wrote a java application to interpret the sensor data and display it as a sonar like screen.  watch the video The laser (originally for playing with cats) is callibrated (roughly) to be at the edge of where the US measures on the java interface.  so if something is touched by the laser it should show up on the screen.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
TitiMoby's picture

No problem about code quality, I prefer people sharing often what they have than perfectionnist than never contribute for that bad reason :)

I'll give a try at it with Golo Lang (made by friends) which is another JVM language. Java is my daily tool, so this language is close enough to be comfortable, but not to close to mix work and hobby ;)

 

Thanks a lot.

bluesthue's picture

is to have it as a key/value array instead of just values so it can map in either direction.  So the data would look something like:

[0:150]
[3:150]
[6:135]

where the key is the degrees and the value is the distance.  that way it can go in either direction sweeping back and forth and update in "real time"

I am always happy to share what i create.  

Also i code in a bunch of languages professionally (mostly web) and i can say personally i don't really mind doing what i love for a hobby and profession.  Its one of the benefits of being a programmer and loving programming... i actually get to do what i love all day every day.  Code the boring stuff for the suits and then code the awesome stuff i want to build for me. :)

TitiMoby's picture

I watched your app video and:

1) looks very useful

2) yeah yeepee! hurraayyy! I'm not alone to do java stuff around this nasty C bastard called Arduino ;)

At some point, could you share some details on your java app?

bluesthue's picture

First, I'll warn you:  I am not a java developer, but one of my goals for 2014 is to get better at Java, since its the one language in the top 10 programming languages i have the least experience with.


bascially my arduino is sending data like this:

{150,150,123,45,50,65,150,200,180,200,150,...}  

where each point corresponds to a servo rotation.

Then the java reads it using the rxtx library.

import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;
import java.awt.*;
import java.util.*;

public class SensorOutput extends JPanel {

       ArrayList<Ellipse2D> dangerCircles = new ArrayList<Ellipse2D>();

ArrayList<Ellipse2D> innerCircles = new ArrayList<Ellipse2D>();

ArrayList<Ellipse2D> midCircles = new ArrayList<Ellipse2D>();

int maxDistance = 195;

int minDistance = 65;

int midDistance = 130;

int dangerDistance =12;

private static final long serialVersionUID = 1L;

Ellipse2D.Double circle;

 

    public SensorOutput(int radius, String d)

    {

    circle = new Ellipse2D.Double(0, 0, radius, radius);

        setOpaque(false);

 

    d=d.replace("{", "").replace("}", "").replace("\n", "").replace("\r", "");

    String[] distances = d.split(",");

   

    int centerX=150;

    int centerY=150;

    if(distances.length>0){

    for(int i = 0; i<distances.length;i++ ) {

    double angle=i*3+180;

    angle=Math.toRadians(angle);

   

    int distance=Integer.parseInt(distances[i])*2;

    int dis=distance;

    if(distance<=maxDistance&&distance>=midDistance){

    dis=midDistance;

    }

    int tX=(int) Math.round(Math.cos(angle)*dis)+centerX;

int tY=(int) Math.round(Math.sin(angle)*dis)+centerY;

if(distance<=dangerDistance){

dangerCircles.add(new Ellipse2D.Double(tX-5, tY-5, 10, 10));

}

else if(distance<=minDistance){

innerCircles.add(new Ellipse2D.Double(tX-5, tY-5, 10, 10));

    }

else if(distance<=maxDistance){

midCircles.add(new Ellipse2D.Double(tX-5, tY-5, 10, 10));

}

    System.out.println(angle+":"+distance);

    }

    }

    }

 

    public Dimension getPreferredSize()

    {

         //Rectangle bounds = circle.getBounds();

        return new Dimension(300, 300);

    }

 

    public void paintComponent(Graphics g)

    {

        super.paintComponent(g);

        Graphics2D g2 = (Graphics2D) g;

 

        circle.setFrame(0, 0, 300, 300);

        g2.setPaint(Color.WHITE);

        g2.setStroke(new BasicStroke(1));

        g2.draw(circle);

        Line2D.Double line = new Line2D.Double(0,150,300,150);

        g2.draw(line);

 

        //Draw outer points first

        g2.setColor(Color.WHITE);

        for (Ellipse2D circleX: midCircles) {

            g2.setPaint(Color.WHITE);

            g2.setStroke(new BasicStroke(1));

            g2.draw(circleX);

        }

 

        //Draw mid-range points

        g2.setColor(Color.WHITE);

        for (Ellipse2D circleX: innerCircles) {

            g2.draw(circleX);

            g2.fill(circleX);

        }

 

        //Draw ultra-close points

        g2.setColor(Color.RED);

        for (Ellipse2D circleX: dangerCircles) {

            g2.draw(circleX);

            g2.fill(circleX);

        }

    }

}

I have another thread to listen for the serial data to feed to this class, and a timer on my main class to build and update the jFrame/Panels.
I'll post full source code to download once i finish my android app.  Let me know if you have any questions about the code or if you have any issues implementing it. 

TitiMoby's picture

looks like I have to bring my Gary to fresh air :)

TitiMoby's picture

I have the same 4WD and I'm looking for a solution to either remove rear motors with simple axis or implement some differential with a second motor driver to have real control on the 4 motors.

by the way, I'm looking for a cheap arm to test those kind of setup, I'll have a look at this model.

bluesthue's picture

I just got bluetooth control set up and running on my little friend tonight and decided to take him outside for a minute to see how he'd do on gravel, grass and concrete.  Those wheels worked amazingly outdoors compared to the over-traction on the carpet.

 

Maxhirez's picture
It's actually a 3v robot arm, not 6v. If you examine the switch control and battery set up you'll notice that it uses 2 D cells to drive the motors one way and two the other. I doubt you'll do too much damage driving them at 6v, but it is something you should be aware of.
bluesthue's picture

I had seen it before i hacked it.  And i couldn't find any specs for the motors but i've been running them at 6v and they do seem to be working properly.  I also saw several other projects where people ran them at 6v with no problems so i figured i'd give it a whirl like this and see if i catch my motors on fire. :p

They also have no writing on them like most low-end cheapo toy motors.

6677's picture

If its the L298 based motor shield you are using, there is approximately a 2v drop across the driver so really your motors will be running closer to 4v.

 

3 volts vs 4, close enough, motors are usually pretty tolerant of overvolting. Even if they were getting the full 6, they will probably survive.