|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
Hi, we're building an autonomous LADAR guided vehicle for my Senior Design team, and we're using a H.O.B. laser radar unit for our guidance. It talks to the BS2p via the RS-232 port...the H.O.B. is programmed so that it will output data when 2 "R"'s is inputted from the keyboard (this was when we were testing it using HyperTerminal)... the data will be a single byte, and is the range value, in the form 1-9,A-Z... meaning 1=1foot, 9=9feet, A=10feet, Z=36feet... etc... the H.O.B. unit transmission rate is 9600kbps and is using standard RS-232... The input voltage of the HOB itself from 5V to 9V However, the BS2p is not reading anything from the HOB when we attached it to the board's RS-232 port... We are testing this by connecting the HOB to board1 and have board1 read the data from the HOB, and send it to another BS2p board (board2) using port1. Board2 is then connected to the PC using the RS-232 port, allowing us to debug the incoming data. here is the code that we used: ------------------------------------------------------------------------- '{$STAMP BS2p} 'BOARD1 OutData VAR BYTE Bmode CON 16604 'Baudemode for 9600kbps Rpin CON 16 'RS-232 pin# Tpin CON 1 'port1 Pace CON 500 'wait time BigR CON 82 'DEC value of "R" in ascii Loop SEROUT Rpin, Bmode, [BigR] 'Sends "R" to HOB SEROUT Rpin, Bmode, [BigR] 'Sends "R" to HOB 'I think the problem is here... when the board sends out the 'second R, is the "serin" in the next line able to recieve the 'incoming data from the HOB in time? Take note, it's using the 'same port, port 16 (RS-232) for this... SERIN Rpin, Bmode, [OutData] 'Gets RANGE value from HOB, store in "OutData" SEROUT Tpin, Bmode, [OutData] 'Send "OutData" out from Port1 to board2 WAIT Pace GOTO Loop -------------------------------------------------------------------------- Here is the code for Board2: -------------------------------------------------------------------------- '{$STAMP BS2p} 'BOARD2 InData VAR BYTE Bmode CON 16604 'Baudemode for 9600kbps Tpin CON 1 'port1 Pace CON 500 'wait time SERIN Tpin, Bmode, [InData] 'Gets value from board1, store in "InData" DEBUG InData, CR WAIT Pace ------------------------------------------------------------------------- I also ran another test, without having to use the 2 boards... this time, I also connected board1 to the RC car we're using as a base... board2 was not used. here is the code: -------------------------------------------------------------------------- '{$STAMP BS2p} SerData VAR BYTE Bmode CON 16604 Rpin CON 16 Tpin CON 1 Pace CON 500 BigR CON 82 LittleR CON 114 Loop SEROUT Rpin, Bmode, [BigR] 'Sends "R" to HOB SEROUT Rpin, Bmode, [BigR] 'Sends "R" to HOB SERIN Rpin, Bmode, [SerData] 'Stores HOB data to "SerData" IF SerData>0 THEN Steer GOTO Loop Steer: PULSOUT 0, 1100 PAUSE 1000 PULSOUT 0, 1900 PAUSE 1000 GOTO Loop ------------------------------------------------------------------------- The PWM values under the "Steer" label have been tested to move the servo motor... but once again, nothing is happening... and we made sure that the HOB was pointing to an object that was atleast 4feet away.... Please help... when we run the DEBUG menu from board2, we're not getting any value at all. We have discussed this with parallax tech support, and they suggested that we might need to get a line driver, because the problem might be the voltage difference between the HOB and the board... but the HOB is using standard RS-232...Thanks for taking the time to read this looong post... Any suggestion would be most appreciated!!! ![]() |
|
#2
|
|||||
|
|||||
|
Re: laser radar with BS2p using RS232 problems...
icks up jaw: YOUR USING LAST YEAR'S RC???? Dude, you didn't have to ship the RC. Or use the EDU. Anyways, This is my first year, so I don't even know the language. |
|
#3
|
|||
|
|||
|
Re: laser radar with BS2p using RS232 problems...
oh no no ^_^;; ... this is for Senior Design, it's a required course for undergraduate Engineering majors in UCF... and this is the project that our sponsor wanted us to build... we've been having problems getting the HOB and the BS2p to communicate and I've used up my resources, so I'm looking for websites, like this one, "FIRST", that deals with robotics and has people with pbasic experience that might be able to offer suggestions to fix our problem... It's interesting that a similar robot was built last year, as you have mentioned... I think the main difference with our car is the H.O.B. unit
![]() |
|
#4
|
|||||
|
|||||
|
Re: laser radar with BS2p using RS232 problems...
OK, this year was a big change. THEY UPGRADED THE CONTROL SYSTEM. Biggest differences: Faster, More Memory, and uses C. See IFI's site for more details
|
|
#5
|
|||||
|
|||||
|
Re: laser radar with BS2p using RS232 problems...
I think they understand that controller for the FIRST Robotics Competition is different this season than last, but many of us still have experience with the Basic Stamp chipset and its programming language. It is being used for a project that has nothing to do with FIRST so the hardware used is at their discretion.
If you let this thread sit for a bit, you'll likely find some help -- though keep in mind that you've caught us all at a very busy time. Also, if you're not yet aware, the University of Central Florida has a team that participates in FIRST -- and many of its members participate here as well. Maybe you can get in touch with them and seek their assistance. |
|
#6
|
|||
|
|||
|
Re: laser radar with BS2p using RS232 problems...
yeah, we have NOTHING to do with the FIRST robotics competition that goes on yearly... and M. Krass is absolutely correct.
As for the problem with the BS2p and the HOB, the missing key is the buffer, as I have discovered... I did some more research, and others have had the same problem that we're having... there has to be buffering between the two. Thanks for all of your time, and I wish you all the best of luck with your competitions! ![]() |
|
#7
|
|||
|
|||
|
Re: laser radar with BS2p using RS232 problems...
Hmm.. Looking at the pinout of the BS2p, the RS232 pins appear to be 1 and 2. If I'm mistaken let me know and I'll keep trying to help...
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|