PDA

View Full Version : Speed Sensor Anyone???



Ramius
- 1st May 2012, 13:38
Hi All!
Just thought I would check and see if anyone has built or knows of a Radio Controlled Model Boat speed sensor? I know a company named Eagle Tree makes one using a pitot tube. Thanks, Ed

ScaleRobotics
- 1st May 2012, 15:34
This one is from http://www.steveonweb.com/node/378 using the MPX5050 differential sensor. (This is air speed. Not sure if you are looking for air or water speed :)



'************************************************* ***************
'* Name : airspeed.BAS *
'* Author : Steve Turner *
'* : www.steveonweb.com [email protected] *
'* Notice : Use as you like *
'* Date : 6/06/02 *
'* Version : 1.4 *
'* Notes : An airspeed Project Created for an unmanned *
'* : Aerial Vehicle. Uses a Motorola MPX5050 *
'* : differential pressure sensor connected to RA1 *
'* : good to 270 Mph using an op-amp for a sensor *
'* : gain of 5 *
'* : PIC16F877
'************************************************* ***************
' PicBasic Pro program
'
' Connect analog input to channel-1 (RA1)

'Setup LCD
'This setup will tell PBP a 2-line LCD is connected in 4-bit mode
'with the data bus on the top 4
'bits of PORTB, Register Select on PORTB.1, and Enable on PORTB.0.
DEFINE LCD_DREG PORTB 'Set LCD Data port
DEFINE LCD_DBIT 4 'Set starting Data bit
DEFINE LCD_RSREG PORTB 'Set LCD Register Select port
DEFINE LCD_RSBIT 1 'Set LCD Register Select bit
DEFINE LCD_EREG PORTB 'Set LCD Enable port
DEFINE LCD_EBIT 0 'Set LCD Enable bit

symbol cr = 13 ' Carrige Return
symbol lf = 10 ' Line Feed
sout var portd.7

temp1 var word
Pressure var word ' in pascals
Airspeedmet var word ' Airspeed meters / sec
Airspeed var word ' Airspeed in MPH
OutVolt var word ' Output voltage of sensor in .1 mv
ADvalue var word
counter var byte
NewADvalue var word

' Sets up the port for AD conversion
TRISA = 111111 ' Set PORTA to all input
ADCON1 = 000100 ' Set PORTA analog and RIGHT justify result
' RA1 is AD in, Vdd is V+ ref, Vss is V- ref (GND)
ADCON0 = 001011 ' Configure and turn on A/D Module 'Fosc RC
Pause 500 ' Wait .5 second for it to warm up

loop1:
'Resets temp variables for a fresh start
counter = 1
NewADvalue = 0

'This loop adds 64 AD conversion values together, and then divides
'by 16 to get a 12 bit value from a 10 bit input

for counter = 1 to 50 'no more than 64, then it can overflow

ADCON0.2 = 1 ' Start Conversion

notdone: Pause 5
If ADCON0.2 = 1 Then notdone ' Wait for low on bit-2 of ADCON0, conversion finished

'Load Value into word variable ADvalue
ADvalue.highbyte = ADRESH ' Move HIGH byte of result to ADvalue
ADvalue.lowbyte = ADRESL ' Move LOW byte of result to ADvalue

NewADvalue = NewADvalue + ADvalue 'just keep adding them
next

ADvalue = NewADvalue / 50 'will produce 12bit from a 10bit AD converter

'calculate the values

gosub calcVoltage
gosub calcPressure
gosub calcairspeed

'display the results on an LCD
LCDOUT $FE,1,"AD ",dec4 ADvalue," Volt ",dec5 OutVolt
LCDOUT $FE,$C0,"Pres ",dec5 pressure," Asp ", dec3 airspeed
pause 5
SEROUT2 sout,396,["ADvalue = ",dec4 ADvalue," OutVolt = ",dec5 OutVolt," Pressure = ",dec5 pressure, " Airspeed = ", dec3 airspeed,10,13]

goto loop1
end

'Subroutines

'gives millivolt*10
calcVoltage:
'OutVolt = ADvalue * resolution
OutVolt = ADvalue */ 2500 ' = ADvalue * 2500 / 256
OutVolt = OutVolt + 260 'Correcting for Sensor Being a little off
return

calcPressure:
if outvolt < 2000 then goto zero
'Vout = VS x (0.018 x P +0.04) gives with VS = 5volt
'P=(Vout - 0.2)/0.09
'p = ((Vout0.1mv - 2000) * 10) / 9
pressure = (OutVolt - 2000) * 10
pressure = div32 9 'In pascals
return

zero:
Pressure = 0
gosub calcairspeed

calcairspeed:
'airspeed = square root of {(2*pressure) / 1.225} ' pressure in Pascals
'/ 1.225 = *.8163 '53499/65536 = .8163
temp1 = (2*pressure) ** 53499
airspeedmet = sqr temp1 'takes the square root of temp1
'meters per second * 2.237 = miles per hour
airspeed = airspeedmet * 224
airspeed = airspeed/100
return

Ramius
- 2nd May 2012, 01:16
Thanks Walter!
It is actually for my submarines.

Best, Ed

pedja089
- 2nd May 2012, 01:26
You still can use differential sensor. Only math is different...

Ramius
- 2nd May 2012, 12:29
Thanks Pedja089!
Aside from the program part, it would be nice to see what the actual differential sensor looks like. It is going into a model submarine and I would like to avoid such devices such as the "pitot" tube used by Eagletree as this would make the sub look very strange with a rod sticking out the front!

Best, Ed

pedja089
- 2nd May 2012, 13:15
You can make just small hole in front, and back of sub... Or on front and back side of "fins" or what ever it's named...
So when submarine go forward pressure on front sensor is larger than on back sensor, and faster it goes, difference is larger...
My suggestion is that you buy some analog sensor, and try it on peace board that you push through water and see what is happening...
Also you can use small propeller and count impulses...

ScaleRobotics
- 2nd May 2012, 15:24
Maybe since you already have a depth (pressure sensor) you don't really need a differential unit, just a single pressure sensor on the front to sense speed. It's speed calculation could be based on the depth reading. This pitot tube could probably be mounted on the above the hull as well. What do they call the thingy that has the periscope in it? :)

For stealthy sensing, you could try to find a smaller one of these http://www.blueheronmarine.com/Airmar-CS4500-Ultrasonic-Water-Speed-Sensor-for-BG-Network-Plastic-7241

or design one yourself, but this takes it up more than a few levels on the difficulty scale.

Demon
- 2nd May 2012, 20:54
What about hiding the pitot in the torpedo tubes?

Robert

Ramius
- 2nd May 2012, 23:55
Great idea! Thank you! Just not sure how well it will work as I know very little about using a pitot tube.

Best, Ed

Demon
- 3rd May 2012, 00:40
I would put it right up at the opening, maybe on the outer edge of the tube. Maybe put 2 and take an average reading? I'd be concerned about clean water-flow though. It is probably best to have it on a leading surface like extreme front tip, front of the turret or the front opening of the periscope?

One thing with the scope, you can easily get weeds stuck on that, same with the turret.

Robert

Ramius
- 3rd May 2012, 03:03
Yes! lol You are 1000% correct! It is one of my biggest fears considering all that it has taken to build a 3mm in diameter working video periscope. The working torpedo tubes are 3/8" and the Eagletree pitot tube is smaller than a pencil. There are only 4 torpedoes and provisions for 6 so two "dummy" holes would be just fine. To be perfectly honest I have no idea what pressures to expect, what pressure sensor to use, etc. My knowledge and "expertise" is in television and helicopters. Do you think using a depth sensor for pressure would work? If you look under the schmatics section I posted a depth sensor project. I do not know if you can imagine my son and his friends thinking I was some kind of "mad scientist" pouring water into a 3' high acrylic tube with wires sticking out the bottom! Both the missiles and torpedoes operate with compressed air after one fellow model submariner who was using Este rocket motors had a mishap. He fired a missile underwater and once it broke the surface tension, made a quick left turn, over the back yard fence, went through a screened in patio and set fire to his neighbors couch with his neighbor taking a nap on this couch! Just as an FYI, my sub is the Typhoon, 6' long and 8" in diameter, similar to the one in the movie "The Hunt for Red October" thus the screen name "Ramius". Yes I do speak some Russian and been to Russia several times. Anyway, I have a video text inserter to show all the information possible. Speed is the one "sensor" I have not been able to solve and I strongly doubt Eagletree would wish to part with any information. Thank you for your ideas and please continue giving them. They really do stimulate the creative process! Best, Ed

Demon
- 3rd May 2012, 03:17
About the speed sensing, having NO experience in this field, I'd stick the pitot out the sub nose for optimum performance, maybe 1/8" out, just enough to get clean waterflow. I put the side pitot anywhere you feel like it along the side, maybe along the bottom to hide it, where the surface is perpendicular to the front tube.

Using a fake torpedo hole would not have clean waterflow, the nose would already have cut a wake and changed water pressure.

To calibrate the whole thing, I'd run the sub submerged at periscope level (so the front tube gets clean pressure) at full speed between 2 buoys at a given distance. Then I'd time how long it takes to cross the 2 buoys and calculate the speed, knots would be best. :)

It all sounds so easy sitting here in my basement. :D

Ed, this is your thread; feel free to post videos/pics of your project. I've been dreaming of making a submarine since I got into PICs, with fantasies of an aircraft carrier with working air cannons and aircraft that can be launched. The landing part would be a tad harder, maybe go for a Japanese design so I don't have to worry about that part. LOL

Robert

ScaleRobotics
- 3rd May 2012, 04:15
Here's a little bit about the equations: http://www.engineeringtoolbox.com/pitot-tubes-d_612.html

You could use the same sensor you used for your depth sensor. And use your depth sensor as the 2nd differential sensor. Connect one to the pitot tube, subtract the readings from the depth sensor, and use the equation. You would need to have the sensors at the same depth, since you can measure a half inch difference. And your depth sensor should probably sense pressure at the side of the hull, I would think.

Ramius
- 3rd May 2012, 13:24
Hi guys! Thank you! It all helps and it is wonderful to work with such great minds! Over the years there have been several "challenges". First was how to transmit video from underwater! Most people have use 2.4 Ghz which just happens to be the resonant frequency of water! So when their antenna becomes submerged all they end up doing is "heating" the water. Then there is focusing the transmit power up to the surface and not down to the fish. With a unique antenna design this problem became solved. One picture below shows the transmitter (gold looking box) and the chain is a chain drive to raise and lower the items to make things look real. The periscope goes up, down, and turns seperately. The camera used is called a "snake" camera, high resolution, color, and 1/2" square pointed up the periscope tube. There is drawing of the lenses in the periscope tube and the prism corrects the "mirror" image since on one mirror is being used. There is also a picture of the compass and you may notice the A/D is mounted directly below the compass sensor thus reducing any signal noise. The torpedo pictures give you an idea of their construction and size. The launch tube has an optical sensor so the launch air pressure is shut off once the torpedo leaves the tube. Another picture shows the launch method where the torpedo is pressurized and the top of the launch tube allows air pressure to release the torpedo. Just in case you are wondering, yes, you can have exploding war heads, or you can replace the nose with foam from a foam paint brush soaking in water color. So if you see ducks with small orange circles on their butts you will know it was me! Lol Best, Ed

6459646064616463

boroko
- 16th May 2012, 11:03
Hi All,

This may sound a bit ignorant, but it seems to me that the speed would be directly proportional to the shaft speed. There would definitely be some slip, but the "load" of the craft should be consistant and once you figured the correlation of revs to distance, you wouldn't need to directly measure speed.

Maybe I'm missing something, but it sure seems like the logic is there.

Good Luck
bo

Ramius
- 16th May 2012, 13:02
Hi Bo!
Thank you and there is no such thing as "ignorant" as we all see situations differently which makes for the stimulation of great ideas! Counting the revs is a great idea and this sub has two motors. I guess you could add the two motor RPM's together and then divide them by 2 for average RPM. In a turn you speed up one motor and slow down the other. While I do not have an answer as to why this is not used in aircraft (for example) it seems there must be a reason. Aircraft seem to use a pitot tube while boats seem to use either pressure or a "paddle wheel" system. Maybe it has more to do with "flow" such as a "head wind" in aircraft? Best, Ed

ardhuru
- 17th May 2012, 15:38
While I do not have an answer as to why this is not used in aircraft (for example) it seems there must be a reason.

Wouldnt you get a wrong reading after factoring in the tail/head wind? The RPM measuring technique would work only in the absence of the above. For the same RPM, your actual speed would be different depending on whether the wind is aiding or resisting you.

SteveB
- 17th May 2012, 16:59
Some clarifications regarding speed and airplanes (simplified). Aircraft measure speed in many different ways (mostly in knots, which is annotated by the K prefix).

KTAS = True Airspeed - This is the aircraft relative to the air mass.

KGS = Groundspeed - This is TAS corrected for the movement of the air mass (headwind/tailwind).

KIAS = Indicated Airspeed - Speed measured by the Pitot-Static System.

KCAS = Calibrated Airspeed - IAS corrected for installation/instrument/position errors.

If the air mass is stationary, GS = TAS = how fast you see the airplane fly by as you stand on the ground.
CAS ~ IAS. These numbers are normally pretty close (depending on aircraft), and often times used interchangeably in non-critical situations.
Typically, CAS, TAS, and GS need some form of 'advanced' instrumentation to read the cockpit, such as GPS for GS, or an Air Data Computer + GPS + Flight Management System for TAS and CAS.

CAS/IAS differ from TAS, often by significant amounts, due to variations in the air mass, such as decrease in air density with increase in altitude. However, it is because IAS is affected by density that it gives a better picture of the aerodynamics of the aircraft and speed/mass/volume of the air flowing over the wing. Whether the aircraft is at 1000' or 30,000' in altitude, at 175 KIAS, air flowing over the wing is aerodynamically equivalent, however the TAS at 30,000' will be much greater.

So, why not measure the rotation speed of the prop to get the speed of the aircraft? Because, the aerodynamic forces on the aircraft and propeller change with the speed, altitude, weight, etc. So a fixed pitch propeller spinning at 2000 rpm at sea level on a standard day, no wind, with the aircraft total gross weight (TGW) of 3000lbs and a new paint job may fly at 150 KIAS (and ~150 TAS = 150 GS). But, at 5000' on a hot summer day with TGW of 4000lbs and having not been washed in months may only fly at 130 KIAS. But, TAS would be more like 160 knots, and there is a 25 knot tailwind, so the GS would be 185 KTAS!


And that is the simple answer ;)


I should add that with a ship/submarine, you will encounter the same issue with counting prop revs, although to a lesser degree due to smaller variations in density and speed, but weight would make a much bigger difference because of the much larger range in weight capacities of a ship.

Ramius
- 18th May 2012, 01:05
Thanks Steve!
I have been flying airplanes since 1973 and helicopters since 1994 (the real ones not the models) so I agree with you completely. Typically in most lakes or even a swimming pool the water is pretty much stationary. I will probably take an extra depth sensor and spin it in a plastic trash can filled with water at different speeds and see what "head-on" pressure readings I get. Hopefully there will be major changes in the readings? My fear is that the pressure at slow speeds will be to small to see. There are just so many details to work out on this sub project. For example, no one seems to know if First Person View goggles display video in underscan or overscan. This makes a different with trying to use an On-Screen Display character generator as with overscan as with a CRT TV you do not have the first column available and thus you are limited as to how many columns are useable! So many questions, so little time! Lol Best, Ed

SteveB
- 18th May 2012, 04:37
From your posts, it sounds like an impressive project and quite an undertaking.


My fear is that the pressure at slow speeds will be to small to see.
I can understand the concern. I would expect it would take some rather sensitive pressure sensors to pick up the differences in pressure at slow speeds.

Keep us updated on how things progress!