Let's Make Robots!

SprintBot

Navigates via ultrasound

Hi all, new to the group. Here's my first robot project ever - "SprintBot"

 I do laser engraving and cutting as a business, so the chassis of the bot was fairly straight forward for me. I found the original idea and drawings here http://www.instructables.com/id/How-to-Make-an-OAWR-Obstacle-Avoiding-Walking-Rob/?newComment=true#comments and redid them to suit my needs.

 As of tonight it walks and the servo points and the Parallax Ping triggers, but I get no readings from it :-( so... more work to be done.

 Here's the code I used to debug the sensor (gleamed from this site) -

main:    
 LOW PORTC 0
 HIGH PORTC 0
 PAUSE 1
 LOW PORTC 0
 LET DIRSC = %00000000
 PULSIN 0, 1, W0
 
 sertxd ("The value is ",#W0,cr,lf)
 pause 500   ‘ short delay
 goto main   ‘ jump back to the start

just added the sertxd stuff from the manual.

Any ideas on the ping??

 

front.jpg

rear.jpg


 

Comment viewing options

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

Well.... I don't have the whole thing working :-)

 I have the ping working independantly. Using code I can slew the servo, take a reaning and it's quite accurate. The difficulity is when the main motors are running there's a nasty timing issue that I haven't traced down yet.

Secondly, I may have to implement an encoder for each motor - the legs get out of sync and the bot vectors instead of walking in a straight line until they sync up again. If I leave it "as is", I'll have to rename it DrunkBot.

 Anyone have some working ping code they could post (nav code, with motors running)?

Here's some quick sloppy code for test of servo slew and ping function (remember to press F8 to get a terminal window).

+++

main:

servo 0,150

pause 500 
 LOW PORTC 0
 HIGH PORTC 0
 PAUSE 1
 LET DIRSC = %00000000
 PULSIN 0, 1, W0
 sertxd ("The center value is ",#W0,cr,lf)
 pause 500   ‘ short delay
 

servo 0,100  

pause 500  
 LOW PORTC 0
 HIGH PORTC 0
 PAUSE 1
 LOW PORTC 0
 LET DIRSC = %00000000
 PULSIN 0, 1, W0
 
 sertxd ("The right value is ",#W0,cr,lf)
 pause 500   ‘ short delay
 

servo 0,200

pause 500    
 LOW PORTC 0
 HIGH PORTC 0
 PAUSE 1
 LOW PORTC 0
 LET DIRSC = %00000000
 PULSIN 0, 1, W0
 
 sertxd ("The left value is ",#W0,cr,lf)
 pause 500   ‘ short delay
 goto main   

+++

Not sure if this will help, but somebody recently wrote a guide on here for getting the Ping to work with the Picaxe.

http://letsmakerobots.com/node/1276

Do you have it all on the same batteries? If so try putting the motors on a secondary power source. The motors may be getting different voltages when the sensor is working.
I'll give that a try - very well might be the issue.

disconnect your servo and see if readings change, also try move your "sertxd ("The value is ",#W0,cr,lf)" i found that dit actually makes a difference where i place the debug output command. hmm what else...you could try lengthen the 500 delay.

also give this a try, omit the last low:

 LOW PORTC 0
 HIGH PORTC 0
 PAUSE 1
 LOW PORTC 0
 LET DIRSC = %00000000
 PULSIN 0, 1, W0

OK, that worked - now I'm getting readings. you were right, gotta remove the last "low portc 0" and put the "sertxd" after everything happens.

 

Slick looking bot! I had the zero read problem with mine too. Check the voltage being fed to the ping, it should hover around 5v. see if your led is flashing on the right intervals too (every low-hi-low sent)
V+ is right at 5.4dc and the light on the ping flashes every .5 seconds, so it's triggering. I'm just unable to get a reading. Not sure what's up -
Very cool looking robot. Add some fur and you have a puppybot. Someone has ping code here somewhere. Unfortunately I haven't used a ping only srf05.
I took a look at the ping code, but couldn't make it work for me. I'll did a little deeper.