Shop OBEX P1 Docs P2 Docs Learn Events
Ahh Help! IR+Ping+Servo — Parallax Forums

Ahh Help! IR+Ping+Servo

danielcho88danielcho88 Posts: 2
edited 2009-11-20 14:38 in BASIC Stamp
I'm trying to get a PING mounted on a standard parallax servo to look left, front, and right (in a loop) and see if there are objects ahead. There are IR sensors also mounted, and the loop goes as such using subroutines:

Look Forward
Ping with Ultrasonic sensor to see objects (if yes, vibrate buzzer)
Check IR sensor for objects (if yes, vibrate beeper)
Look Left
Ping with Ultrasonic sensor to see objects (if yes, vibrate buzzer)
Check IR sensor for objects (if yes, vibrate beeper)
Look Forward
Ping with Ultrasonic sensor to see objects (if yes, vibrate buzzer)
Check IR sensor for objects (if yes, vibrate beeper)
Look Right
Ping with Ultrasonic sensor to see objects (if yes, vibrate buzzer)
Check IR sensor for objects (if yes, vibrate beeper)

and so on and so forth:

SOMETIMES I would turn on the system and everything will work, but then by surprise I find that my servo twitches and stays "stuck" but the ultrasonic sensor picks up things and the IR sensor picks up things. And then I will return to the circuit a couple hours later after giving up, and everything will work again. Then the next morning, things are back to twitching servo and stuck servo [noparse]:([/noparse]

any ideas as to what is happening? This is urgent!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-20 06:29
    It's a power supply problem. Your Stamp is resetting because the power supply voltage is dropping too low for the Stamp to work properly. Typically this happens as the servo motor is trying to move and its current drain goes way up briefly. If you're using batteries, replace them or (if rechargable) recharge them. If you're running off a power supply, get a bigger one or put a big electrolytic capacitor across it (like a couple of 1000uFs at a suitable voltage).
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-20 14:38
    It is against forum rules to cross-post (post the same or similar message in more than one forum). Please delete your duplicate message in the Sensors forum. Use the "X" icon in the upper right corner of the message to delete it.
Sign In or Register to comment.