Let's Make Robots!

MEEP! WhoMe? In Progress

Report distance in mm every 5° in a 180° sweep by graph in Processing

Well, here is step 1. 

Been working on getting what to me is a major step. Right now, Arduino is sweeping the a servo with a Ping ))) mounted on it. Got that working and feeding back readings in in millimeters. Those are currently being fed into a simple graphing setup in Processing. It's right nice.  

 Major thanks to Myc for help.  

Named inspired because someone said it resembled Beaker (muppet)

Current Results: Those curves are scan and rescan of a cup that was in the way. 

31May2009 Ultrasonic Ping Graph

Comment viewing options

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

.

  • Under the ping is a laser diode (extracted from a laser pointer or laser gunsite, can't remember which one that is). It fit almost perfectly in the grommet supplied for the ping wires to go through.
  • Ping upside down because the wire/header/connectors were so long that they obscured the laser
  • I agree, the way i took the picture kinda made the wires look like hair, and the laser like a mouth....I kinda like it.

Anyone know how to do the polar type display? I have seen a few, but they're for programs I either don't have or am exceptionally clueless how to use.  I have MS visual studio pro available, but thats the clueless part. I have processing too. With processing and the arduino IDE I'm at about a 3/100 proficiency, really at the tweeking existing code very slightly.

one example similar to what I'd like to see: from the parallax forums http://forums.parallax.com/forums/default.aspx?f=6&m=129099

attach.aspx?a=28873

 

 

I think applying some trigonometry to your scan angle + scan distance would get you an X/Y that you could plot. 

Part of the problem on it is that I don't know enough about coding to start from scratch. I've been able to learn what i have so far by adapting code that i've found, having to figure out what it's doing where to be able to change it.  Backwards approach, I know.

 

I've gotta check that instructable linked earlier. Right now my biggest problem is why the movement of the servo is inconsistent when doing sweep and ping. 

Do I understand correctly that your problem is showing your readings from VStudio?

If that is the case, maybe this can help:

http://www.instructables.com/answers/Can_you_control_an_Arduino_with_Visual_Basic/

In your Arduino program you have to send the readings using Serial functions. For example serial.println(angle) and then serial.printl(sensor_reading).

And on the PC side you need to program a loop reading serial messages and painting the dots, as explained in the previous link.

I hope it helps.

I'm actually using a simple serial input graph, linear graph(bar graph actually) to display the values. I'm doing it in processing. It's ok, but it's a linear scan and not very realistic in terms of the shape of the room and the line of sight as scanned.
Funny robot face. Looks like Beaker from the Muppet labs :-)
Does it hurt anything or change results to be upside down? Logic would tell me know but my logic is regularly anti-logical
not everyone mines right way up on blocky but im gonna solder a 3 pin header coming out the back of the board soon
Because the socket is upside down :P