question for math wizards


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    Give this a try...
    MiscEL
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Apr 2011
    Location
    NSW, Australia
    Posts
    39


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    Got It!

    Thought it was a ! and not an l - old eyes no glasses. Often get told I need them - maybe I do


    Thanks
    aajgss

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    Quote Originally Posted by aajgss View Post
    Got It!

    Thought it was a ! and not an l - old eyes no glasses. Often get told I need them - maybe I do


    Thanks
    aajgss
    I know what you mean... without mine I walk into walls .. try stairs with a new pair of bifocals
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    I'm sure in the same boat... without mine I can't even say if it's an elephant ... or a supermarket
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    Quote Originally Posted by aajgss View Post
    Got It!

    Thought it was a ! and not an l - old eyes no glasses. Often get told I need them - maybe I do


    Thanks
    aajgss
    You mean you tried to read that text and type it ? !!!

    Thank Jobs / Gates / Linus for copy/paste !
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Apr 2011
    Location
    NSW, Australia
    Posts
    39


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    Ok,

    Lets forget I said the first bits easy!!!

    Instead of converting to mmH2O and then converting that to Knots, I decided to go straight from ADC counts to Knots.

    So the equation comes out to be (SQR(ADC Counts))* ( 484/79).

    Excel comes up with the correct answer. for 1 ADC count the result comes out at 6.1266 knots. Doing the same calculation in a PIC the result is 6 knots. It appears that the result is the integer part only.

    The numbers I am trying to get is in the table

    mmH2O ________Knots
    15_____________ 30
    26.5 ___________40
    41.5 ___________50
    60 _____________60
    81.5 ___________70
    106.5 __________80
    134.5 __________90
    166.5 _________100
    201 ___________110
    239.5 _________120


    How do I calculate the correct value and still heed Steves advice to be careful of Math Overflow?


    Thanks
    aajgss
    Last edited by aajgss; - 3rd June 2011 at 15:55.

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    Hello aajgss,
    What level of resolution are wanting to display, I mean how many decimal places ?
    You could multiply up by 10, 100, 1000 and display using DEC modifier and "." .
    I didn't notice which PIC you are using but 18Fs can use long variables which if I am not mistaken are 32 bit vars.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  8. #8
    Join Date
    Apr 2011
    Location
    NSW, Australia
    Posts
    39


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    Hi Archangel

    Resolution I would like is to 1 decimal place. The project I am working on is an electronic manometer to check calibration of the Air Speed Indicator for gliders.
    The limits are critical at 30 knots. The ASI must be within +/- 1.5 knots at 30 knots.

    I am using an 18F14K50. I did try a LONG variable and multiplied the counts by 10000, but still got the same results. I looked like I was getting a 16 bit math overflow. Most likely cause was me not knowing what I am doing. Is it just a case of using a LONG identifier or is there something else I need to do. There is an option in MCS to use PBPL. Is PBPL another part of PBP, a different program all together or some type of addin? I find the documentation for this kind of simple info a bit difficult to locate.


    Thanks
    aajgss

  9. #9
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    Hi,

    Your answer is here :
    Excel comes up with the correct answer. for 1 ADC count the result comes out at 6.1266 knots
    you have to use a signal amplifier to get more ADC counts for the same outputted voltage ...

    A logarithmic amplifier could be a nice idea to get a linear ADC input voltage Vs Speed.

    I remember some really good work had been done here for Vu-meters ... ( a greek project ... )

    CA3089 or NE 604 could be some interesting keywords to try ...

    have fun

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: question for math wizards

    Quote Originally Posted by aajgss View Post
    ...I am using an 18F14K50. I did try a LONG variable and multiplied the counts by 10000, but still got the same results. I looked like I was getting a 16 bit math overflow. Most likely cause was me not knowing what I am doing. Is it just a case of using a LONG identifier or is there something else I need to do. There is an option in MCS to use PBPL. Is PBPL another part of PBP, a different program all together or some type of addin? I find the documentation for this kind of simple info a bit difficult to locate.
    ...

    I see it at least in section 3 (pages 17 and on), and in section 4 on Variables (page 23) and Division (page 37). It could be in other places; no fast way to use SEARCH in a book besides the table of contents (no index that I can see).

    (I really need to reread the manual, they've added important information in there)
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts