My Robot in form 2!

Still stays there.

The servo keeps twitching.

The srf05 is supposed to take readings but it doesnt do it in the right time.

Currently the sensor is off the servo(The body of the robot).

(UPDATE 4.12.11)

The sensor is attached back on.

and here is the code that needs work on.

dunno how to attach bas file to posts

symbol range = w0

symbol rangecm = w1

symbol leftr = w2

symbol rightr = w3

servo B.0, 150

 

main:

  pause 10

  pulsout C.0, 2

  pulsin C.0, 1, range

  rangecm = range*5/58

   do while rangecm > 10

    forward A : forward B

    pause 10

    pulsout C.0, 2

    pulsin C.0, 1, range

    rangecm = range*5/58

   loop

  gosub scanandstop

   if leftr > rightr then

    sertxd ("Left is bigger")

   else

    sertxd ("Right is bigger")

   end if

  goto main

 

{  

scanandstop:

  halt A : halt B

  servo B.0, 75

  pause 10

  pulsout C.0, 2

  pulsin C.0, 1, range

  rightr = range*5/58

  wait 1

  servo B.0, 150

  wait 1

  servo B.0, 225

  pause 10

  pulsout C.0, 2

  pulsin C.0, 1, range

  leftr = range*5/58

  wait 1

  return

}

Same as start here, obstacle avoidance

  • Actuators / output devices: 2 dc motors with worm gear and 1 mini servo
  • Control method: auto
  • CPU: Picaxe 20x2
  • Operating system: Linux, Windows, and Mac
  • Power source: 3 aaa duracell!
  • Programming language: Basic
  • Sensors / input devices: SRF05
  • Target environment: indoor

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/my-robot-in-form-2

cheers!
cleanly made, fantastic!

Lets have a look at that code

Post your code, micro --I’ll see what I can see.

In the meantime… If you break your code down to just the servo stuff, can you get it to move? --and if you strip your sonar code down to just the sonar routine, does it work?

i did that and when i did

i did that and when i did the sensor part, the sensor wont take readings, when the servo is disconnected then the sensor works. :]

yes the servo works so i

yes the servo works so i would put the .1uf cap on the red and black wires right? is it a ceramic one? and what is a polarise cap?

Yup.

A ceramic cap will do just fine and yes, one leg to red, one leg to black.

The other cap would be one of those round ones with the “-” stripe down one side showing you which pin is gnd. This one can go probably near the robot brain or battery --I suppose it doesn’t matter, your bot is pretty small and thus the wires and traces are pretty short --Just install both caps, noting the polarity on the polarized one. Oh, and bigger the better on that big round cap --100uf, 220uf, 470uf or bigger --whatever, just use whatever you have in your parts box.

I would suggest trying

higher capacity batteries. I know AAA rechareables are typically in the 800mAh range vs AA rechareables being able to get to the 2600mAh range. While it is not necessarily the case, it is something you should look at.

Nice one
Nice one

umm, these are not

umm, these are not rechargables

thanks :slight_smile:

thanks :slight_smile:

Well, what I was trying to point out was …

that AAA batteries typically have lower current capacities than AA batteries. According to wikipedia, AAA alkaline batteries offer between 250 and 1200 mAh capacities, whereas, AA batteries supply between 1800 and 2600 mAh worth of capacity.

ok, but my robot was a kit

ok, but my robot was a kit so, it has a battery holder for 3 aaa but thank you for the info

Have you fixed this yet?

I don’t know if you have sorted the problems you are having but this may be of some interest. Regarding servos and srf05 by Frits the man himself. Also maybe your range calculation is wrong? have a look at the numbers at that link.

umm, i have already

umm, i have already connected it and when the servo is disconnected from the robot, the sensor works fine. But thank you.

Hello All! I haven’t been on

Hello All! I haven’t been on lmr for a looooooooooong time, and I have fixed this problem, but the robot’s server is currently now used in my new robot, Curiosity. Thankjs for your comments on this project :slight_smile: I appreciate it.