![]() |
SONAR Sensor Software Driver
For anyone interested in using a SONAR sensor I have completed a software driver for it. If anyone has any questions feel free to post in this thread.
Once I develop a personal website I will post the software there. Until that time it can be found by using the link in this thread. SONAR_0.1.zip The introduction from the readme: Code:
Introduction: |
Re: SONAR Sensor Software Driver
Thanks for posting the driver code. I had to finnagle the timer interrupt routine a tad to get it to work on the full-size FRC, but otherwise it has made my job much easier!
Thanks! :) |
Re: SONAR Sensor Software Driver
Yeah, thanks alot Mike. It works perfectly.
This saved me hours of coding, and I'm sure it will do the same for many others. |
Re: SONAR Sensor Software Driver
Why is this code so complicated? I really don't see why you need all of this. I don't know anything about programming the range finder, but it seems to me that you should just be able to send the range finder a 0 or a 1 to trigger it and then measure with a timer the time it takes for the pulse to come back. Why is there all this complicated stuff? Is it really needed? I'm not criticizing, I just want to know for my own sake.
|
Re: SONAR Sensor Software Driver
Quote:
|
Re: SONAR Sensor Software Driver
Quote:
|
Re: SONAR Sensor Software Driver
I have an updated version of the SONAR software driver that supports the 2006 Robot Controller. Get it here: SONAR_0.3.zip
|
Re: SONAR Sensor Software Driver
Quote:
I've been scanning the code to understand it a little. And I found something strange: at one point sonar_status is set to SONAR_REST, but there is no case statement looking for SONAR_REST. In fact, SONAR_REST appears nowhere else in the code except in the .h file where it is created. Is SONAR_REST a remnant from a previous version? Won't the code get lost if sonar_status is set to SONAR_REST? -Norm |
Re: SONAR Sensor Software Driver
Quote:
I'm glad you like the software. Please let us know how your testing turns out. |
Re: SONAR Sensor Software Driver
Quote:
In your README it says Quote:
But step 3 puzzles me. Quote:
Here is my modified InterruptHandlerLow (). The mods are in color. Code:
#pragma code |
Re: SONAR Sensor Software Driver
Instead of a new thread I'll post here. There is a new sonar ranging sensor on the market. New sonar The interesting points as I see it are - Nice price, narrower cone of detection, and 3 ways to interface. RS232, analog voltage and the normal pulse timing. Too late for this year but may be a worthy addition to next years sensor selection.
|
Re: SONAR Sensor Software Driver
Quote:
|
Re: SONAR Sensor Software Driver
How do I connect the PING))) sensor made for Parallex robots to the VEX Micro Controller and program the sensor in EasyC 2.0?
|
Re: SONAR Sensor Software Driver
Quote:
NOTE: ERROR IN VEX SONAR DATA SHEET! The data sheet that comes with the VEX sonar kit has an error. It says, Quote:
Quote:
One way to tell that it's hooked up right and the software is pinging it is to hold the device up to your ear and listen to it. When I got it working I could hear a faint "tictictictic..." coming from the device. I did not hear that before I switched the wires. Thanks again. Now I have to write new autonomous code that I can't test on the robot until we get to the next regional. |
Re: SONAR Sensor Software Driver
Just a further update on the sonar system. We were successful in using the sonar to control our distance to the corner goal (our doors won't open if we're too close, and the balls won't go in if we're too far away). We used sonar both in autonomous and as a driver control (driver initiates "autonomous" using a button. Control is returned when the balls have been dumped or the driver hits the "abort" button.) We even got a Xerox Creativity Award for the system. :D
But here's why I'm writing this note... We had a strange problem. The sonar system would give steady values until we enabled autonomous, and then the values would start to drop: 150, 150, 150, [start auto] 150, 150, 130, 115, 90, 75, ... All this while the robot was on blocks and unable to move! I figured it was some bizzare resource interrupt limitation timing thing. Until I discovered that it would do this just by me running the motors. It took a mechanical engineer to put his hand on the frame and say, "I bet it's picking up vibration from the motors!" We removed the sonar unit and held it -- the problem went away. We ended up mounting the unit on a block of foam (a block we made by cutting up one of those balls from the game). Oddly, the autonomous code seemed to work anyway. It only did this for long distances -- at short distances ( < 30" ) we didn't see this problem. So, everyone --- be careful how you mount the sonar unit -- it can pick up vibrations and give bad readings! Thanks again for the driver code -- we never would have been able to complete this in time without it! -Norm |
| All times are GMT -5. The time now is 11:25. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi