WaterBee ROV (remotely operated vehicle) And a thank you.
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
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
Comments
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
·
·
·
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.
So the Stamp will be my "Local Controller" and will respond to commands sent by Visual Basic. Does anyone see a problem with this?
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!