Shop OBEX P1 Docs P2 Docs Learn Events
Absolute Magnetic Encoder - Page 2 — Parallax Forums

Absolute Magnetic Encoder

2»

Comments

  • mminasianmminasian Posts: 26
    edited 2009-07-08 09:19
    For startup we need position for sectors every 17 degrees. There are only 5 possible starting positions. After that it is soley incremental/timing based for angular velocity. Sensors = way overkill.
  • Nick MuellerNick Mueller Posts: 815
    edited 2009-07-08 09:35
    > There are only 5 possible starting positions.

    So one sensor and a slotted disk (with 5 slots) is enough.

    > Sensors = way overkill.

    So I wish you luck with the position-sensor you have now. wink.gif


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • LawsonLawson Posts: 870
    edited 2009-07-08 16:08
    I'd suggest getting back to the most basic basics. Get something working in a rational manner and then build up from there. The data sheet shows that the minimum time the PWM pulse train is low is about 0.86uS spin is *just* fast enough to reliably measure pulses this short at 80Mhz. (in any case, using CNT the resolution will be one clock cycle even in spin) A good start would be to go look at the code for PULSIN in the "BS2 compatability library" in OBEX. That's about the simplest example of pulse length measuring I know of. It's not without issues though, specifically the overhead of interpreting spin code is not well hidden in this function and changing the Prop's clock will alter the result a bit. Next look at PhiPi's code in the second post. It is clock speed independent, though still has some restrictions on minimum pulse lengths. At this point don't worry about rotation counting. (it's likely better to do that in a separate variable anyway) The code I posted later in the first page uses a cog counter to relax the minimum pulse length requirements while in spin. In any case, printing out and READING the Propeller manual will be well worth the time. I regularly refer to the spin/assembly language reference in the manual when I program.

    Lawson

    P.S. I'm a Mechanical Engineer by education, so there's hope for anyone to learn programming. yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?

    Post Edited (Lawson) : 7/8/2009 4:14:20 PM GMT
  • mminasianmminasian Posts: 26
    edited 2009-07-08 19:16
    Hey guys, so I've decided to look into using hall effect sensors on my shaft. If I place 5 of them strategically around my motor I can get all the position data that I need, and then use the average of their timings for my angular velocity calculation. Any recommendations? Also, I'm assuming I can use the magnets that are on the rotors already to "activate" them? The magnets are 1Tesla (really strong), so hopefully that isn't an issue. Let me know. Also, at 10k+ RPM I'm guessing I could potentially have some of the same timing issues that I have been having...
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2009-07-08 19:26
    I agree with Nick and Lawson - if there are only 5 possible starting points, get rid of the rotary encoder.· You can do it two easy ways in hardware, 1) photo-interrupter, and 2) hall effect sensor.· A little addition to what Nick said, is to ensure that your slots overlap a little (see attached picture for *rough* example of such).· You want to be absolutely sure that you are detecting at least one slot - the overlap (two true, three false), indicates that you are at a transition between starting phases - based on the direction of rotation, there will be one of two choices·on how to start the motor.

    Depending on the environment that the sensor will be used, you can pick the correct one.· If it is a clean environment (i.e. inside a closed case, or like on an indoors-only robot that gets a lot of cleaning) a photo-interrupter will work fine.· If it is on the exterior of a vehicle and is expected to get hit with dirt and road grime, it's probably better to get a ferric (iron/steel)·disc with either holes cut, or 5 rows of fins ground into it, and align a few hall sensors to it (believe me it's plenty fast enough - it's used on engines that run up to 12K-RPM...).


    If you are in a time pinch I might have a spare AS5145 and magnet I could throw your way... you just glue the magnet on an end of the motor shaft (axially centered - right at a shaft·bearing is the best place...).· The sensor just needs decoupling and power with some boot-strapping.· After that, it's basically automatic and you can build it into the motor package (just need wires for A-B-Index, SCLK, SDO, CSn, Power, GND - I did this with one sheilded 8-cond cable).

    Let me know via PM if you are desparate... shocked.gif

    -Tim
    132 x 133 - 4K
  • mminasianmminasian Posts: 26
    edited 2009-07-08 21:27
  • Nick MuellerNick Mueller Posts: 815
    edited 2009-07-08 21:45
    Only thing I'd like to add:
    My suggestion to use a hall-sensor might have been without enough thinking. Condsider the high currents and the rotating magnets, it seems the worse choice between optical and magnetic.
    I think, you'll take less risks with an optical pick up. In the hope that the environment isn't too dirty.


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
Sign In or Register to comment.