Problem with PING, multiple servos and PULSIN
Szarzynski
Posts: 16
Hello,
I have run into a problem that I cant figure out.· It's very simple.· I have a boe-bot with a ping sensor and servo mount.· I want to turn the·Ping and take measurements while moving, and I cant do it.
For example:
This works:
FOR pulseCount = 0 TO 20·············' Number Of Pulses To Spin PING)) 90 Left
··· LOW Ping································' Force PING))) Line Low
··· PULSOUT PingServo, 350············' Ping Servo·90 Left Pulse Value
··· PULSOUT Ping, 5······················ '·Activate PING)))
··· PULSIN· Ping, 1, distance··········· ' Receive Distance Value
··· PULSOUT Led, 850·····················' pulse LED
··· Pause 20
NEXT
Simple program·that turns the Ping left, the ping takes·a distance measurement,·and blinks an LED.
But this·doesnt work:
FOR pulseCount = 0 TO 20············· ' Number Of Pulses To Spin PING)) 90 Left
··· LOW Ping··························· ' Force PING))) Line Low
··· PULSOUT PingServo, 350············· ' Ping Servo·90 Left Pulse Value
··· PULSOUT Ping, 5···················· ' Activate PING)))
··· PULSIN· Ping, 1, distance·········· ' Receive Distance Value
··· PULSOUT Leftservo, 850············ ' activate left servo
··· PULSOUT RightServo, 650············ ' activate right servo
··· PAUSE 20
NEXT
LOW Led
The only thing I changed was Pulsing to servos instead of an LED.· The problem is that the PING sits at PULSIN for the max time.· (it works fine if I take out the PULSIN command)· So I guess that several servos cause ultrasonic·noise?· But that·should not be true - it works with one servo...· so I am asking this forum for advice.
Thanks.
·
I have run into a problem that I cant figure out.· It's very simple.· I have a boe-bot with a ping sensor and servo mount.· I want to turn the·Ping and take measurements while moving, and I cant do it.
For example:
This works:
FOR pulseCount = 0 TO 20·············' Number Of Pulses To Spin PING)) 90 Left
··· LOW Ping································' Force PING))) Line Low
··· PULSOUT PingServo, 350············' Ping Servo·90 Left Pulse Value
··· PULSOUT Ping, 5······················ '·Activate PING)))
··· PULSIN· Ping, 1, distance··········· ' Receive Distance Value
··· PULSOUT Led, 850·····················' pulse LED
··· Pause 20
NEXT
Simple program·that turns the Ping left, the ping takes·a distance measurement,·and blinks an LED.
But this·doesnt work:
FOR pulseCount = 0 TO 20············· ' Number Of Pulses To Spin PING)) 90 Left
··· LOW Ping··························· ' Force PING))) Line Low
··· PULSOUT PingServo, 350············· ' Ping Servo·90 Left Pulse Value
··· PULSOUT Ping, 5···················· ' Activate PING)))
··· PULSIN· Ping, 1, distance·········· ' Receive Distance Value
··· PULSOUT Leftservo, 850············ ' activate left servo
··· PULSOUT RightServo, 650············ ' activate right servo
··· PAUSE 20
NEXT
LOW Led
The only thing I changed was Pulsing to servos instead of an LED.· The problem is that the PING sits at PULSIN for the max time.· (it works fine if I take out the PULSIN command)· So I guess that several servos cause ultrasonic·noise?· But that·should not be true - it works with one servo...· so I am asking this forum for advice.
Thanks.
·
Comments
·· Try this thread...Someone has already done some code which moves the PING while moving.
http://forums.parallax.com/showthread.php?p=593286
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Here is a quote from the board's user manual:
"When using a six-volt battery pack (as on a Boe-Bot robot, for example), you may wish to move this jumper to the Vin position to provide extra power to the servos. When using Vin in the servo ports, always check to make sure the voltage supplied does not exceed the specifications of the particular brand of servos you are using."
I switched, it works now, problem solved.
I'm curious if the original 5V supply would work if you placed a series 4.7K resistor between the I/O and the signal line (white) going to each servo AND placed a 100uF cap across the power
leads to each servo. I'm wondering if this is truly a voltage surge from the servo's or a voltage spike that may be causing a problem.
Is there a way you could "test" this with parts you already have?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
http://www.parallax.com/detail.asp?product_id=28823
http://www.parallax.com/detail.asp?product_id=700-00060
Matt