Results 1 to 5 of 5

Thread: Ultrasonic Sensor VIs

  1. #1
    Join Date
    Oct 2008
    Location
    Redwood City, CA
    Posts
    6

    Default Ultrasonic Sensor VIs

    We are trying, so far unsuccessfully, to get the VEX Ultrasonic sensor to work with the WPI robotics library supplied VIs. Within the Basic FRC framework, we open the sensor using Ultrasonic.Open. In our teleop loop, we call Ultrasonic.Ping followed by Ultrasonic.GetRange. This locks up our loop.

    We successfully got this sensor to operate using WindRiver/C++ by putting the sensor in automatic mode (SetAutomaticMode(1) and then periodically reading the result (using GetRangeInches(). There appears to be no equivalent to automatic mode in the LabVIEW VIs.

    Team 100 would appreciate some guidance on the proper use of the LabVIEW ultrasonic VIs.

    Thanks.

  2. #2
    tvrobotics Guest

    Default Re: Ultrasonic Sensor VIs

    It would be interesting to know what kind of ultrasonic sensor the VI's are designed to work with. We have an ultrasonic sensor from parallax and it functions differently from the vex ultrasonic sensors. There are many other brands as well.

  3. #3
    TDohse Guest

    Default Re: Ultrasonic Sensor VIs

    The Ultrasonic VIs should work with the vex sensor, devantech srf04 and others that function in the same way, where a counter can be started on the Ping and then count until the echo is heard on a second digital channel.

    The problem team 100 is seeing is likely a combination of user error, and a flaw in the GetRange vi. As currently written, GetRange will never return if the sensor doesn't hear the echo. This will be fixed in the next update so that it will eventually time out. One thing to check is that the sensor is connected to the channels that the Open vi expects them to be, otherwise it sounds like you are using the VIs correctly.

  4. #4
    Join Date
    Jan 2009
    Posts
    16

    Default Re: Ultrasonic Sensor VIs

    If there is an error in the GetRange vi and we are developing our software using LabVIEW, does that mean that we can't safely use a ultrasonic sensor?
    I'm sure that there will be times when there won't be a response back.
    Is there a way of detecting a time out and restarting the device?

    Thanks

  5. #5
    Join Date
    Sep 2008
    Posts
    586

    Default Re: Ultrasonic Sensor VIs

    One way to temporarily fix the Get Range bug would be to change the stop condition of the while loop in Get Range to stop when the counter increments OR a certain amount of time has elapsed. (Or just make sure you always get an echo back).

    You should also watch out for this bug: http://forums.usfirst.org/showthread.php?t=11343
    Team 330 beta tester

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •