Asked — Edited

3 Ultrasonic Sensors On The Ez-B Ver 3 And Ver 4 Boards?

I want to be able to use 3 of the Ultrasonic sensors at once on an EZB ver3. Is this possible? How would I do it in the ARC software? I only see the ability to use one now, or am I over looking something.

Instead of using a servo to scan, I want to be able to have one Ultrasonic sensor point forward, and the other 2 at 60 degree angles on the left and right of the one pointing forward.

Am I overlooking the ability to do this or is it not possible to use more than one Ping Sensor?

Thanks.

ZionPhil


ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

#9  

He would if he was using a EZB4, however he is using a V3 board...

#10  

ok, I saw where the title says V3 AND V4. That's why I asked.

#11  

Thanks guys. Much appreciated.

United Kingdom
#12  

I tried replying earlier but have been having a nightmare day today!..

With the center/centre thing, it may well be possible I made a typo since we spell it differently over here to over there, however I use both spellings on many occasions depending on what it's for so can get a bit mixed up.

As Richard pointed out, the $SweepCentre is the variable. This is calculated from the $SweepMax - $SweepMin / 2 at the start of the script. $SweepMax and $SweepMin are variables at the start which makes customising the script easier.

So basically, where a command uses $SweepCentre for a value it's really using the value. For instance, if SweepMin is 1 and SweepMax is 180, (180-1)/2 = 90 (rounded up).

I will admit, I haven't properly tested the latest ping roam script since I still don't have anything suitable to test with or a suitable environment to do the tests so it may have errors, but I have done some quick tests and it didn't flag anything up.

Changing the Get Ping script should allow you to get all 3 sensors at the same time, you can also remove any calls for the sweeping of the servo. In fact, running 3 sensors rather than 1 on a servo will greatly reduce the amount of script needed and give much more accurate results as there would be no delay in the robot knowing the distance on the left, the distance on the right and the distance straight ahead.

#13  

HI, @RIch

Can't thank you enough for this awesome scripting. I was at my local makerspace this evening, www.themakerhive.com, and I had our makerspace coding expert Dan Wakefield take a look at the ARC and the PingRoam code. I showed him how ARC worked and the powerful scripting and within 5 minutes of showing him ARC, Rich's PingRoam Code, and my Project Goal... he understood it and off we went to making the code work for a 3 Ping Sensor Array. After an hour of coding and testing we had success!


# Ping Object Avoidance
# Using 3 Ultra Sonic Ping Sensors for avoidance through a corridor or hallway
# ORIGINAL Version 1.2.0 by Rich Pyke
# THIS Version 1.3 (for 3 Ping Sensor Arrays and no servo sweeps)
# Updated: 2014.7.25 by Dan Wakefield and Phillip Briski

Ping Roam v1.3 for 3 Ping Sensor Array Code here -> PingRoamv1.3Alph3PingSensoryArray.ezb

3 Ping Sensor Array "Ping Drive" (Corridor Driving)

This is a 3 Ping Sensor Array mounted on the Multiplo 3 Wheeled Robot. The brain is an EZB ver 3 board and the code is running from the ARC PC Application.

The code base is from Rich Pyke's Ping Roam 1.2.0 Alpha ARC FIle.

The code was edited by Dan Wakefield and Phillip Briski to remove the servo code for sweep and replace the after sweep ping values with the Ping values form the left, right, and middle Ping Sensors.

The goal was to get the robot to move through a hall or corridor and keep itself as close to the middle of the corridor as possible.

This was essentially achieved by allowing the "MoveLeft" and "MoveRIght" scripts to play off each other in "less than" values for the Right or Left Ping Sensors.

The Avoidance Script was highly edited to achieve the goal. One main thing edited in the Avoidance script was setting the $maxdistance value and creation of a $dontmove variable which would not allow the robot to move forward if the set value (can be adjusted in Start Script) of less than 15 was that of the middle Ping Sensor. This then allows the MoveRight and MoveLeft commands to turn towards the greater ping value from the left and right sensors.

Minor adjustments to sleep times were added to smooth turning and forward movement.

Thanks again @Rich, @Richard R, and everyone in the EZ-Robot Community. This has to be the most helpful forum I have ever experienced. Glad to be a part of it.

Regards,

ZionPhil

#14  

Great news Phil.... Wait until you dig deeper into ARC and really see just how powerful ARC truly is....:)

United Kingdom
#15  

That's awesome dude, and I'm happy to help and guide anyone:)

As Richard R says, wait until you dig deeper. ARC is pretty darn remarkable and extremely powerful but also so easy to use as I am sure you have realised.