Memsic 2125 code?


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: Memsic 2125 code?

    Thanks Walter! You are the best! Ed

  2. #2
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: Memsic 2125 code?

    Hi Walter and everyone!
    Okay so I corrected the code in the Read_X_Force as the "return" caused the program to stop and the formula said to divide by 8 not multiply. With the digital scope I was able to know the exact timing of the pulses. The catch is that the devide puts out a pulse reading from 1810 to 3132 so the formula does not work. I attached word files to show the code, what the pulse measurement is at level, what the code does with level and what the code does with the device at +90 degrees (up) and -90 degrees (down). The original code uses 10 ms and the scope says it is 9.9 ms so rather than x2 I made it x20 to divide by 99. The problem with the code seems to be with the 50% duty cycle value? Please let me know what you think. Thanks, Ed


    Pulse Widths.doc
    Tilt Code.doc
    UP.doc
    Level.doc
    Down.doc

  3. #3
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Memsic 2125 code?

    Quote Originally Posted by Ramius View Post
    Okay so I corrected the code in the Read_X_Force as the "return" caused the program to stop and the formula said to divide by 8 not multiply.
    Ed, are you refering to the place in the formula where there was a /12.5% ? If so, this is simplified by *8.

    See this part of the previously attached document:
    "Since our T1 time is in microseconds and there are 1000 microseconds in a millisecond, we need
    to multiply the T2 value and 0.5 by 1000 to adjust the equation. This makes the math easy for the
    Stamp and gives us an output with a resolution of 0.001g. Finally, the divide by 12.5% part of the
    equation is converted to multiplying by eight ( 1 / 0.125 = 8 ) – we couldn't ask for a value much
    more convenient than that."
    http://www.scalerobotics.com

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