Logarithm in PBP


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Loveland CO USA
    Posts
    83


    Did you find this post helpful? Yes | No

    Thumbs up Power=power

    P=v*d, D=(v/10)*.2

    P=v*((v/10)*.2)

    P=v*v*.2/10

    P=v*v/50

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ronsimpson View Post
    P=v*d, D=(v/10)*.2

    P=v*((v/10)*.2)

    P=v*v*.2/10

    P=v*v/50
    I was looking at a way to change one set of numbers into another. Did not pay attention to your post or think in electrical terms. Just MATH. NUMBERS DO NOT LIE. NOT OFTEN
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2005
    Location
    Loveland CO USA
    Posts
    83


    Did you find this post helpful? Yes | No

    Question Numbers Do Not Lie.

    You must be an Engineer not a Lawyer or Statistician. On subject; I need to get back to taxes.
    Fuzzy logic (fuzzy math)

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ronsimpson View Post
    You must be an Engineer not a Lawyer or Statistician. On subject; I need to get back to taxes.
    Fuzzy logic (fuzzy math)
    Just an old farm boy having fun.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    I use this code to read the forwardpower
    Code:
        ADCIN 0, adval	                ' Read channel 0 to adval
        dummy = adval * 5 * 10          ' Multiply to load internal registers with 32-bit value
        value = Div32 1023              ' Divide 32-bit value by word and store in word    
        forwardpower = (value*value)/50
    and this for reflected power
    Code:
        ADCIN 1, adval1	                ' Read channel 0 to adval
        dummy1 = adval1 * 5 * 10        ' Multiply to load internal registers with 32-bit value
        value1 = Div32 1023             ' Divide 32-bit value by word and store in word    
        reflectedpower = (value1*value1)/50
    and the type for SWR is:

    ..........1 + square root(reflectedpower/forwardpower)
    SWR = --------------------------------------------
    ..........1 - square root(reflectedpower/forwardpower)

    Any help how to show the SWR on LCD;
    Last edited by savnik; - 30th March 2007 at 06:50.

  6. #6
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile Fuzzy Math Approach?

    The largest ADVAL1 can be is 1023
    The largest dummy can be is 1023 * 5 * 10 = 51150 (which is 16 bits or less)

    Why do you do the * 5 * 10, why not * 50? and why *50?
    You do not need DIV32 since you never exceed 16 bits with dummy

    The same goes for ADVAL calcs

    In final form, your
    RP = (ADVAL1*50/1023)^2/50
    FP = (ADVAL*50/1023)^2/50

    If you plug these into your SWR equation and reduce, you get

    SWR = (ADVAL1+ADVAL)/(ADVAL1-ADVAL), which should be easy to deal with

    However, with all this noted, I do not think you are going to get what you want ... or will you? I haven't yet tried to follow this thread in any depth.
    Last edited by paul borgmeier; - 30th March 2007 at 09:46. Reason: reduced equation further
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  7. #7
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier View Post
    The largest ADVAL1 can be is 1023
    The largest dummy can be is 1023 * 5 * 10 = 51150 (which is 16 bits or less)

    Why do you do the * 5 * 10, why not * 50? and why *50?
    You do not need DIV32 since you never exceed 16 bits with dummy

    The same goes for ADVAL calcs

    In final form, your
    RP = (ADVAL1*50/1023)^2/50
    FP = (ADVAL*50/1023)^2/50

    If you plug these into your SWR equation and reduce, you get

    SWR = (ADVAL1+ADVAL)/(ADVAL1-ADVAL), which should be easy to deal with

    However, with all this noted, I do not think you are going to get what you want ... or will you? I haven't yet tried to follow this thread in any depth.
    I use adval * 5 * 10 , because adval * 5 is to show on lcd
    the volts from 0 to 5v and 10 is multiplier to show on lcd 0 to 50v

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 13:55
  2. Extensions to PBP variables
    By John_Mac in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd October 2009, 06:21
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 20:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th December 2005, 00:30
  5. PBP / XP Crash
    By pondindustrial in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 27th November 2005, 04:16

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