Searching \ for 'Pressure to MPH [OT]' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=
Search entire site for: 'Pressure to MPH [OT]'.

Truncated match.
PICList Thread
'Pressure to MPH [OT]'
2000\05\10@162632 by l.allen

picon face
Andy wrote...
> Not for airspeed, for waterspeed.
>
> Bary pressure not a problem, as I can handle the zero-offset at startup.  These
> things are running on the surface of the water, I need to know how fast it's
> going (within reason).
>
> At this point I just need to figure out which sensor to use - they range from 1
> to 1000 kPa for full-scale.  Next will come the equations.
>
> Andy

This sounds like an inspired case for empirical data
capture.
Load up a full sized boat (with food and fishing rods) and
measure that sucker.
That should take...oohh.. a day.
Or Two if the weather is good!
_____________________________

Lance Allen
Technical Officer
Uni of Auckland
Psych Dept
New Zealand

http://www.psych.auckland.ac.nz

_____________________________

2000\05\10@213610 by Jim Ham

flavicon
face
At 02:53 PM 5/10/2000 -0400, you wrote:
>I need to convert kPa to MPH or km/h for a quickie project.
>
>Anybody have the info I need?
>
>Andy
>
>

The routine below works mostly OK - it seems to have about a 20% error. If
anyone sees the problem please drop me a note.

Regards,

Jim Ham


/***********************************************************************\
*
* return indicated airspeed (kts)(assume std density at sea level
* also assume 80mv FS in A2D
* returns airspeed in 10ths of knots
*
\***********************************************************************/
int SpdLookup( ulong raw )
{
/*
     return (int)sqrt( raw * 200 )/10 ;
*/

  byte iteration ;
  unsigned long guess ;
  unsigned long last_guess ;

  // 1 psi = 2.13e6 counts from A/D
  // rho 2.378e-3 slugs/cu.ft - density of air at sea level
  // p(psf) = 1/2 rho(slugs/cu.ft) V^2(ft/sec)
  // p(psf) = raw / 14789 ;
  // V(ft/sec) = sqrt( 2 * p /rho )
  // 1 kt = 0.5925 ft/sec
  // V(kts) = 0.5925*sqrt( 2 * p /rho )
  // V(kts*100) = 59.25*sqrt( 2 * p /rho )
  // V(kts*100) = sqrt( (59.25^2*2*raw) /(2.378e-3*14.789e3) )
  raw *= 200ul ;
 //***********************************************************************
 //*
 //* Take a square root - Newton's method
 //*
 //***********************************************************************
  iteration = 20 ;
  last_guess = guess = raw / 128  ;
  do {
     if (guess == 0l ) guess = 1l ;
     guess += (raw / guess) ;
     guess /= 2 ;
     if (last_guess == guess) break ;
     last_guess = guess ;
  } while ( --iteration ) ;
  return MakeInt(guess/10l) ;
}

Jim Ham, Porcine Associates
(650)326-2669 fax(650)326-1071
"http://www.porcine.com"

2000\05\10@221228 by Scott Dattalo

face
flavicon
face
On Wed, 10 May 2000, Jim Ham wrote:

> The routine below works mostly OK - it seems to have about a 20% error. If
> anyone sees the problem please drop me a note.

Yeah the problem is that the PIC is getting bored taking such a long time
calculating the square root and is forgetting the answer before the algorithm
completes :). But seriously, if you need a square root routine I'd suggest
looking at James' pic pages  (what's the latest URL James?) or

http://www.dattalo.com/technical/software/pic/picsqrt.html

I've haven't been paying attention to the thread so I'm not sure what your
equation looks like.

Scott

{Quote hidden}

2000\05\11@095557 by jamesnewton

face picon face
Latest URL? I don't remember
http://www.piclist.com/FAQ
ever changing.

The techref site has been all over the place and is now
http://techref.massmind.org
Which should not ever change.

---
James Newton (PICList Admin #3)
spam_OUTjamesnewtonTakeThisOuTspampiclist.com 1-619-652-0593
PIC/PICList FAQ: http://www.piclist.com or .org

{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...