angular speed and gyrometer


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fefenin View Post
    i know there is no math yet i just post the soft working for sending ppm trame with my radio,there is still the angle soft and stuff like you said.
    i found you a bit hard with me i told you i m very new in programing and very bad in math
    i m actually working on the math part (trying some things like test adc value one time and just straight after an other test so i have to values)
    i m probably in the right way to make that works
    thank s again all
    Yep, but then again, sometimes, that's what it takes...a bit of drilling before it finally sinks in...
    But I do have to reiterate...once you get something you think is good, I'm positive a bunch of us will be more than happy to look it over to obvious (and not so obvious) mistakes or logic problems, as long as we've got a good explanation of what the end result is supposed to be...
    Now, going with that...
    You said you're using a radio setup to move a servo remotely. You also said you're a beginner. I don't know how much of a beginner you are, but I can see a problem coming up....that is...trying to do too much at once.
    Build it up in steps...and I think most importantly, keep the radio link as the very last step. Get the A/D working, make the servo move, make the servo move with the A/D, etc.etc.etc. I think you get the picture...

  2. #2
    Join Date
    Mar 2007
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    ok so if i anderstood:

    my value a first is , lets say 2.267volts it s is my first value
    if i take two mesurement separeted by 1 i know that, if the second one is differente than the first one,i moved isnt it?
    so if i moved i probably want to know the angle (how many degrees i traveled)

    lets say the second mesurement is 2.320volts that probably means i moved one way (actually left)

    i know that the sensor sensibility is 0.66mv/deg/sec

    my mesurement is spaced by 1s so i probably moved 2.320-2.267=0.053v so 53mv that would say i moved around 80,3 deg is that right?


    if i m right then i could do mesurement spaced by 10 us it will be better for me

    and how can i do something proper with only a 16f88 without proper math (integer) calcualtion?

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fefenin View Post
    my value a first is , lets say 2.267volts it s is my first value
    if i take two mesurement separeted by 1 i know that, if the second one is differente than the first one,i moved isnt it?
    so if i moved i probably want to know the angle (how many degrees i traveled)

    lets say the second mesurement is 2.320volts that probably means i moved one way (actually left)

    i know that the sensor sensibility is 0.66mv/deg/sec

    my mesurement is spaced by 1s so i probably moved 2.320-2.267=0.053v so 53mv that would say i moved around 80,3 deg is that right?

    if i m right then i could do mesurement spaced by 10 us it will be better for me

    and how can i do something proper with only a 16f88 without proper math (integer) calcualtion?
    You can't do it proper with integer math. But what you can do is multiply all of the numbers by 10 or 100 or whatever (whatever WON'T cause an overflow in the middle somewhere), then divide the end result by whatever you multiplied it all UP by.

    As far as you're math goes...you've ALMOST got it, ooo sooo close..Example..
    You start at time 0 - moving at 0 degrees/second
    You measure at time 1 - and see the sensor is at a rate of (in your example) 80.3 degrees/second.
    That doesn't mean you moved 80.3 degrees, actually it should mean (assuming the angular acceleration was absolutely constant) that you moved 40.15 degrees/second.
    Look at it this way...if I accelerate from a stop at a rate of 10 feet per second during every second, at the end of 1 second, I'll be MOVING at 10 feet per second, but I'll only haved MOVED 5 feet, like an average between start and stop. (I'm looking for a word or a phrase to throw out, but I can't think of it at the moment).
    And yes, the less the time between successive measurements, the tighter you end result will be.

  4. #4
    Join Date
    Mar 2007
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    ok i get the idea for the average of my rate,
    but now how can i do if i don t have a clue how fast i move (not a constant acceleration)

    there is tyle an unknow parameter


    for the moment i m trying that:

    main:

    ReadAD:

    ADCON0.2 = 1 ' Start conversion

    AD0H = ADRESH
    AD0L = ADRESL
    AD0=(AD0H*4)+(AD0L/64)

    pause 1000

    ADCON0.2 = 1 ' Start conversion

    AD1H = ADRESH
    AD1L = ADRESL
    AD1=(AD1H*4)+(AD1L/64)

    SEROUT2 PORTA.2,32,[$A3,$01] 'clear alcd and locate in 0,0
    SEROUT2 PORTA.2,32,["ado:",dec ad0]
    SEROUT2 PORTA.2,32,[$A1,0,1]
    sEROUT2 PORTA.2,32,["ad1:",dec ad1]

    if ad0 > ad1 then
    pan= ad0-ad1
    SEROUT2 PORTA.2,32,[$A1,0,3]
    sEROUT2 PORTA.2,32,["pan: +",dec pan ]
    endif

    if ad1 > ad0 then
    pan= ad1-ad0
    SEROUT2 PORTA.2,32,[$A1,0,3]
    sEROUT2 PORTA.2,32,["pan: -",dec pan ]
    endif


    goto main


    i can get a result but the variation of pan is very low from -60 to 60 if i move the sensor very fast

    if think i should use +vref and - vref cause it ll be more accurate

    i don 't know

    i just HATE math

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    That's where getting an accurate sample as fast as you can comes into play.
    But, with the A/D on a PIC, you can sample too fast and kill your accuracy.
    So, you've got to play with it and find a balance between sampling fast and keeping a decent amount of accuracy. Also, whether or not the acceleration is constant isn't really an issue. The speed of sampling takes care of that for you. The less time between the samples, the less chance there is of the rate of acceleration actually changing enough to matter between those samples.
    That program you posted, are you saying that it's working, it's just that you can't get a decent output from it? Not large enough or what? Not 'sensitive' enough?

    I just did a bit of math. Apparently, at .66mv/deg/sec, with a 10bit A/D on the PIC (5v Vref = 4.8828125mv/bit), the lowest rate you'll be able to detect would be 7.4deg/sec.
    Maybe you should change your +Vref and -Vref.
    How about a resistive divider running off the 5v/Ground rail. Get 3 resistors that are almost EXACTLY the same. That should be able to get you down to 2.46deg/sec.
    And you could do that all day, but then you run into the problem of range. You can have one but not the other.
    I think a better fix for this might be to go with an A/D with more BITS! Maybe an external 16 bit A/D (if not more!).
    Last edited by skimask; - 26th March 2007 at 17:43.

  6. #6
    Join Date
    Mar 2007
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    yes as i said my changing value is not large enough it is like only 2 volts variation a low angular speed (like my head moving) so i m losing 3volts

    i ll try with the resistive divider but i heard it is very bad for the temperature drifting....??

    and i have a reference voltage with my sensor (pin 3) it is like 2.4v very accurate do you think i can use that in a way as a vref+ and - (with diodes or something)


    thank s anyways

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fefenin View Post
    yes as i said my changing value is not large enough it is like only 2 volts variation a low angular speed (like my head moving) so i m losing 3volts

    i ll try with the resistive divider but i heard it is very bad for the temperature drifting....??

    and i have a reference voltage with my sensor (pin 3) it is like 2.4v very accurate do you think i can use that in a way as a vref+ and - (with diodes or something)

    thank s anyways
    resistive divider - I would think that as long as you have 3 resistors, same manufacturer, same age, same values, etc.etc., I would think that they'd drift fairly equally.

    You may have a 2.4v Vref on your sensor, but you still have to be able to get a 'spread' at the PIC.

    What's the fastest you think this sensor will ever turn (I guess the real question is how fast can you spin head?)?

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