Shop OBEX P1 Docs P2 Docs Learn Events
WaterBee ROV (remotely operated vehicle) And a thank you. — Parallax Forums

WaterBee ROV (remotely operated vehicle) And a thank you.

Jimbo30Jimbo30 Posts: 129
edited 2010-04-22 23:18 in Robotics
I started this thread in completed projects unknowingly so I moved it to a more appropriate forum.· Although, I cannot wait to finally post it in the completed project forum……..

This·will be my first major project using the BSII!· Although, I have familiarity·using the BSII, I still may have some questions and hopefully the nice folks in the Parallax forum will provide some insight. The orange dome in on the ROV is the compass housing and just to the left are the temp sensor and pressure sensor.· For control of the ROV I decided to go with three thrusters for up/down, forward/reverse and turning, of course. I have already float tested and found out I had to cut down on buoyancy so instead of using 6" PVC tube, I will be using 3".· I just started the VB6 and BSII interface by just turning the lights on and I will provide the code below.·

‘waterbee lights ON/OFF experiment BSII
‘($Stamp BS2)
‘( $Stamp 2.5)
‘($Port Com2)
·
PinNumber VAR Byte
PinState VAR Byte
Main:
SERIN 16,16468, [noparse][[/noparse]WAIT(255), PinNumber, PinState]
·
IF PinState = 0 THEN
GOTO LightOFF
ELSE
··············· GOTO LightON
ENDIF
·
LightOFF:
LOW PinNumber
GOTO Main
·
LightON
··············· HIGH PinNumber
GOTO Main

VB6 Code:

Option Explicit
Dim PinState As Long
Dim PinNumber As Long
-········· - -
----··············

Private Sub CmdLightsOFF_Click()
PinState = 0
PinNumber = 0
MSComm1.output = Chr$(255) & Chr$(PinNumber)· &· Chr$(PinState)
End Sub
·
--- ----·

Private Sub CmdLightsON_Click()
PinState = 1
PinNumber = 0
MSComm1.output = Chr$(255) & Chr$(PinNumber)· &· Chr$(PinState)
End Sub
·----


Private Sub Form_LoadClick()
·
MSComm1.CommPort·· =2
MSComm1.Settings = “9600,n,8,1”
MSComm1.DTREnable = False
MSComm1.PortOpen = True
End Sub
·
-·········


Private Sub Form_Unload (Cancel As Integer)
MSComm1.PortOpen = False
End Sub

Post Edited (Jimbo30) : 4/22/2010 11:12:41 PM GMT
1632 x 1232 - 1M
1632 x 1232 - 1M
1632 x 1232 - 1M
1632 x 1232 - 1M
1632 x 1232 - 1M

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-12 23:37
    So, what will be in the ROV in terms of sensors and actuators? Assuming that you plan to have a Stamp be the local controller, what will it have to control?
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-02-13 00:15
    Mike, the sensors that I have presently are as follows:

    1.)Temp sensor: AquaSense water temperature sensor. Resistive type
    2.) Car Oil Pressure Sender 0-80 PSI with ground. Resistive type
    3.) Dinsmore Digital Compass.

    Acuators I plan on adding at a later date, such as a manipulator arm and I will be planning on adding a pump to displace silt and muck.

    For motor control I want to control three 12V thrusters (For/Rev/UP/Down/Right/Left). I am also shooting for PWM control. I will be using H-bridge circuits for control. The motor control commands will be imbedded in the VB6.0 program.

    And, of course, lighting.

    Video will be fed to·a "Smart TV card" on· laptop and displayed on the VB6 program using an ActiveX control called X360 Video Capture.

    Post Edited (Jimbo30) : 2/13/2010 12:40:15 AM GMT
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-02-13 01:23
    Furthermore, I will be using an ADC0831 chip for the digital signal into the BSII for both the pressure and temperature readings.
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-02-13 05:12
    MIKE WROTE: In your particular case, it would help for the Stamp to be master. It could send motor commands to the PC or it could send a request for information from the PC and the PC would respond with the temp, depth, and/or compass readings.
    ·
    ·
    ·
    Mike, I was thinking about what you said above in another one of my threads about sending a request for information from the PC and the PC would respond with the temp, depth and compass readings in a label.caption.· However, I can't send·the motor commands to the PC.· I can, though, send·"letters and numbers" to the BSII to for interpretation (IE Speed and direction) just as with temp, depth and compass. ·· This is·probably the only way I will get it to work.· I just found out DTR/DSR and CTS/RTS are essentially the same and what confused me was why some RS-232 to RS-485 converters used RTS and other's·used DSR for flow control.· Knowing the Stamp programming port echoes everything sent to it, so I would have to use some type of flow control and filter the output buffer from Visual Basic’s side like this:
    ·
    Private Sub FlushTXBuf()
    Do
    ········· DoEvents
    Loop Until (MSComm1.outputBufferCount = 0)
    End Sub
    ·
    I just hope I will have enough I/O pins on the Stamp. ·
    I will be using two ADC0831 chips though I can use the same Basic Stamp pins for CLK and DO.· That accounts for 4 pins.
    I have the dinsmore digital compass accounting for 4pins
    I have 3 H-bridge circuits with FWD, REV and ENABLE or PWM so that accounts for 7 because I should be able to tie all three ENABLE pins to the same BSII input.
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-02-16 23:40
    I believe I have figured it out and if anyone can see a problem please correct me. On the MAX485 IC all it comes down is switching the BSII to send/receive mode is toggling the /RE & DE lines so that part I was able to wrap my mind around in the early stages. For the RS232 to RS485 converter from the PC to the Stamp one can control the send/receive mode by enabling the RTS pin (RTS pin will be connected to /RE and DE of the 485 chip). I have also learned there are two ways to receive data by the PC, "Polling the port" and "responding to communications' Events. The ladder of the methods is what I will be doing when talking with the Stamp from visual basic.

    So the Stamp will be my "Local Controller" and will respond to commands sent by Visual Basic. Does anyone see a problem with this?
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-04-22 23:18
    First off I would like to thank Beau Schwabe, Mike Green, Franklin, unsoundCode and sam_sam_sam for answering questions I had pertaining Stamp functions and other things.

    I have everything communicating and working properly above water. I will be moving the vertical motor to the middle of the ROV this evening and I will be testing the ROV tomorrow in the pool. Again, thanks for all your help!
Sign In or Register to comment.