Nasty PBP math help ?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Talking

    Hi Ingvar, long time since we last conversed....
    Time flies when you're having fun
    Your genius has not deminished and I'm humbled by your math skills.
    *LOL* You just made my day. Now i don't need to feel bad when i take a few extra beers tonight. It seems obvious that I kill off the weaker braincells first ....
    I ran a couple of RAW values on my calculator, YES you are spot on V = 12e6/RAW comes out right. If you knew how much time I spent trying to work that out myself you'd laugh your head off at me :-)
    Nop, i wouldn't laugh at people who're struggling. People tend to get pissed off by that .... atleast i do.
    The 12000000 figure is the system clock frequency BTW, but I suspect you guessed that one.
    The thought crossed my mind ...... and again ....... and stuck.
    I'd better go digest your code for larger than 15 bits.
    Don't forget to chew, it's difficult to perform a Heimlich maneuver from half across the globe.
    Thanks again. Look me up if you ever come visiting Australia
    No worries, mate.

  2. #2
    Martin's Avatar
    Martin Guest


    Did you find this post helpful? Yes | No

    Default Up and running

    Hi Ingvar, hope you enjoyed the beers.

    The project is running fine on the bench now, got most of the full unit is assembled too, should be finished tonight. Then wait for a fine day to go to field testing.

    I do have a quick question, as I'm running the 15bit or less code currently so my accuracy is to +- 1 FPS (last digit).

    Can DIV32 give a remainder so rounding can be used ? Like //.

    Martin

  3. #3
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    Hi Ingvar, hope you enjoyed the beers.
    I sure did, again and again and again and ..... i just hated myself the day after.
    I do have a quick question, as I'm running the 15bit or less code currently so my accuracy is to +- 1 FPS (last digit).

    Can DIV32 give a remainder so rounding can be used ? Like //.
    You can increase the resolution by 10 quite easy. Just preload the registers with 120000000dec(=07270E00hex) instead. You could then do rounding on that.
    Code:
        R0.HIGHBYTE = $07
        R0.LOWBYTE = $27
        R2.HIGHBYTE = $0E
        R2.LOWBYTE = $00 
        Velocity = DIV32 Raw
        Velocity = (velocity + 5 )/10
    Just remember that the accuracy decreases with higher speeds. Not much use for tenths of ft/s when the raw data can't be more accurate than 3 ft/s.
    Raw = 2000 gives 6000 ft/s
    Raw = 2001 gives 5997 ft/s

    /Ingvar

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 13:55
  2. Math Operations on pbp
    By Jannia04 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th May 2007, 16:33
  3. pbp math help please!!!
    By houa in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th October 2005, 00:34
  4. Another math problem for PBP
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd April 2005, 21:59
  5. PBP 16-bit ADC result math
    By sonic in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th March 2005, 15:21

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