Shop OBEX P1 Docs P2 Docs Learn Events
Absolute angular sensor question — Parallax Forums

Absolute angular sensor question

max72max72 Posts: 1,155
edited 2011-05-18 08:12 in Accessories
I'm looking for a solution to detect absolute angular position (range less than 0-180°).
I was thinking to use a supermagnet and a magnetic sensor.
Is it a viable solution or are there better options? Has someone a chip to suggest?

Thanks in advance,
Massimo
«1

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-05-06 05:20
  • max72max72 Posts: 1,155
    edited 2011-05-06 09:32
    Sorry I never learn... not enough informations.. and missing the fundamental ones.. my bad.
    The sensor would be used in an automotive context (farm tractor), where to components can rotate one with respect to the other along one single axis.
    Moreover being on a moving machine the whole system would rotate.
    See this sketch to have a better idea.

    Example.jpg


    Massimo
    1024 x 691 - 31K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-05-06 10:58
    There are very fine-pitch encoder wheels, the lines are etched/printed on glass, and they require a high-end "reader". They're as absolute as your ability to calibrate/fix a reference.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-05-06 11:44
    max72 wrote: »
    Sorry I never learn... not enough informations.. ...
    Moreover being on a moving machine the whole system would rotate.
    ...

    Massimo,

    by absolute angles, are you talking about with respect to compass points of the earth? or referenced to what?

    There are compass modules you could mount on various sections of the vehicle. I suppose you could feed their output information to a single processor and have an algorithm calculate their positions. Is that the sort of thing you're trying to do?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-05-06 11:50
    But still, take a 2-axis accelerometer: if you look at the output of one axis, either the X or the Y, when you rock it then its output changes - just like a bubble level.
    So doesn't the Z-axis of a 3-axis accelerometer change when/as you spin it?
    In this application, I suppose it would be difficult to implement, but I haven't thought about it a lot.
  • kwinnkwinn Posts: 8,697
    edited 2011-05-06 13:22
    This is typically done with an optical encoder. There are also magnetic encoders available but IIRC they have lower resolutions than the optical encoders. It might be possible to make your own encoder but that would depend on the mechanics of the joint and the resolution required.
  • W9GFOW9GFO Posts: 4,010
    edited 2011-05-06 13:23
    What's wrong with using a plain old (but high quality) pot?

    Rich H
  • max72max72 Posts: 1,155
    edited 2011-05-06 14:19
    The angle I'm trying to get would be relative between the two parts of the machine.
    Few degrees in resolution and accuracy would be perfectly ok.
    I guess accelerometers are not the best option. Supposing to have the machine on a horizontal surface a relative angle between the two parts is not detectable.
    I was thinking to use something like that:
    http://www.sensorsmag.com/sensors/position-presence-proximity/understanding-integrated-hall-effect-rotary-encoders-1254
    The sensor would be on a part of the machine, and the magnet fixed on the other.
    Optical encoders worry me because of the dirty and harsh environment. I would have to find a IP65 or more type adaptable to a rather big flange.. seeking the web it is not too easy to find. Moreover I'm not sure if I switch the sensor on and off i get the correct position or if I have to reset the zero.
    A pot would work, even if the IP65+ requirement still apply.
    I started with the supermagnet approach because in my mind a similar solution would be more sturdy and forgiving, but having not experience in the area I don't know if it is viable.

    Massimo
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-05-06 15:46
    All the options have been mentioned, some twice.
    Are you making a small, model vehicle or some full-sized industrial?
    Sometimes people focus on weird stuff and overlook that all they really need is what they need to get the job done. Who needs needs a pyrometer and 12 bits of ADC resolution to control a bathroom fan, right? :)
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-05-06 16:37
    A 3-Axis accelerometer won't work on the Z-axis for this project because the acceleration measured is the Earth's gravity and doesn't detect rotation about the Z axis.

    At rest, the Z-axis of the accelerometer will read 1 g ... the other X and Y axis will read 0 g. As you tilt the accelerometer with respect to the X or the Y axis on edge to +90 or -90 deg, the accelerometer will report +1 g or -1 g relative to the axis being tilted. If you flip the accelerometer upside down, then the Z axis will read -1 g.

    To detect rotation about the Z-axis you would be better suited to use a gyro, but without a reference you will have drift error.

    I like the idea of using two compasses and taking the difference to determine angle. A similar approach could be accomplished with two gyro's.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-05-06 17:00
    Thanks, Beau.
    I've been messing around with a #28017 this week, I got it at RadioShack, and noted its "bubble level" properties. I don't have that 3-axis model to get its story, but wondered whether it might exhibit a similar Z-axis characteristic (provided X & Y were still). Just trying to have a little conversation.

    The vehicle aspect wasn't mentioned at the start, it's established now. When everything starts moving, life gets messy.

    I mentioned the fine-pitch optical in #4. Not to say that it couldn't be in a sealed enclosure. A pot is good deal, too, RCTIME can take a lot of time. Maybe someone will turn this into 30+ pages of MMWNIC. Like everything, it's just a matter of time and money and one's needs.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-05-06 18:46
    Wow.
    Maybe you can nudge them for a "sample", Max.
    The cagey Euros may not be as obliging (easily conned) as American companies.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-05-06 19:40
    How about Phil's Refrigerator Magnet Encoder?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-05-06 20:20
    The fridge magnet encoder is more for rate and incremental motion sensing. It could be used here with a separate center reference and quadrature sensing. But you'd have to re-find the center every time you powered up.

    The Melexis sensor seems ideal for this app. DigiKey carries them.

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-05-07 01:09
    Ok, so it's the weekend, and my little project for the past couple of weekends has been a wind turbine... See You-Tube link below if interested.

    VAWT - Version #1
    VAWT - Version #2

    ... So how does this apply to this thread?

    Well, tonight I wanted to take some rotation speed measurements, and I got to thinking about this thread. I ended up using a HM55B compass and a rare earth magnet mounted to the shaft of the turbine. The rare Earth magnet is strong enough that in close proximity the HM55B (about 6 inches), it doesn't even see the Earth's magnetic poles. ... the output is non-linear because the shaft that the magnet is stuck to is 1/4 inch metal all-thread and it affects how the HM55B 'sees' the magnetic field. If it (the compass) was calibrated to the metal shaft it would be smooth throughout the 360 deg, but for the purposes that I needed to use it it was fine the way it was. ... Ohh, and it's also a little jumpy, because I'm transmitting the data from outside to inside (about 50 feet) and there aren't any data checks to make sure there is any noise or corrupted data.

    Propeller Software Video screenshot of rpm test

    The idea as far as applying it to this thread would be to mount the compass on one piece of the equipment, and the magnet on the other in close proximity to one another.
  • max72max72 Posts: 1,155
    edited 2011-05-07 06:46
    Thanks,
    I have a lot of paths to follow now..
    Mainly some combinations of compass, the melexis, the good old pot...
    I'll let you know how it will evolve.
    Thanks again,
    Massimo
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-05-07 07:59
    max72 wrote: »
    Thanks,
    I have a lot of paths to follow now.....

    Beau's very cool VAWT example brings up an important point if you decide to use magnets - the steel structure of the tractor and other trailers, etc. will distort the magnetic field. The magnetic field will try to "flow" through the steel structure and form a magnetic circuit between the magnet's two poles rather than flow through air or non-ferrous materials. This can make things difficult for you if you just stick the magnet onto a solid piece of metal - in which case the magnet might be effectively "short circuited." I'm not saying that the idea isn't feasible - I'm just saying keep that effect in mind when you set up your design. It might also be possible to use more than one magnet so that the magnetic field wants to "flow" from the N pole of one magnet to the S pole of a second magnet that is placed on the opposing side of whatever axis you are measuring.
  • max72max72 Posts: 1,155
    edited 2011-05-07 12:13
    I agree magnetic measurement is not a trivial task.
    Earth's magnetic field will be for sure influenced by the ferrous environment.
    I hope to reduce the effect by using strong magnets, in order to have a signal so strong that the environment effect is negligible.
    Melexis sensors are sensitive to stronger fields with respect to earth's field so it could help.
    Massimo
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-05-08 13:54
    Here is another video, showing a visual of the setup ...

    http://www.youtube.com/watch?v=aKkM7RiKliA
  • max72max72 Posts: 1,155
    edited 2011-05-09 08:57
    Thanks Beau!
    You are enlighting as usual.
    On my side I tried a setup with a compass module I had in house and a magnet.
    Unfortunately the CMPS03 cannot handle strong fields, and after being exposed need recalibrations, so I need another sensor.
    I ordered a couple of Melexis from rs-components (small orders from digi-key or mouser are out of range).
    I'll keep you updated.
    Massimo
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-05-09 09:23
    max72,

    Hmm perhaps with the rotating field of the VAWT that I have setup there isn't a polarizing effect over time.

    So maybe start with the magnet at the axis of rotation, and then approach it with the compass starting at about 1 foot out and incrementally move the compass closer until the response from the compass is what you want.
  • max72max72 Posts: 1,155
    edited 2011-05-09 13:50
    Thanks for the suggestion.
    The problem with the compass module I have is if you exceed the maximum level the sensor loses any calibration and consistent reading until you re-zero it.
    Other sensors simply saturate, without permanent effects (according to datasheet). So I must be extremely careful when testing, moreover the space I have for the sensor is limited, so for a working prototype I cannot use the distance as a mitigating factor.
    I'll try it the way you suggested to have a proof of concept.
    Thanks,
    Massimo
  • RS_JimRS_Jim Posts: 1,764
    edited 2011-05-10 05:56
    Massimo,
    How about using a magnet with a lower strenght? Maybe a piece of refrigerator magnet?
    Jim
  • max72max72 Posts: 1,155
    edited 2011-05-10 10:10
    I tried to use the stuff I had around at the moment. I only have supermagnets on my fridge.. :-)
    Unfortunately the sensor used is not the best bet...
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-05-10 11:04
    max72 wrote: »
    I... I only have supermagnets on my fridge.....

    Not all fridge magnets are created equally. Some effectively have both North and South poles on the same side!

    You want magnets that have only a single pole on one face. Also, most fridge magnets are fairly weak compared to other types of magnets.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-05-10 11:59
    It shouldn't be that hard to measure the angle between two parts of a tractor that are connected by a single pivoting joint. Someone mentioned using a potentiometer (pot) and there was also the idea of using an optical encoder. It could be mounted over the center of the pivot with a rod that extends to the other part. It shouldn't be that hard to seal it to keep out dust and oil. Of course, that's easy for me to say -- it's another thing to actually build it.

    It just seems like a magnetic sensor is a more difficult approach, and a pot would be so much easier to do.
  • kwinnkwinn Posts: 8,697
    edited 2011-05-10 13:46
    A pot is the easiest way to do this, and the top part of an empty shaving cream (or similar) can along with the snap on plastic lid makes a good housing.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-05-10 14:12
    For less than $40, you can get one of these:

    You get your choice of PWM or analog outputs. 'Seems hard to beat.

    -Phil
  • max72max72 Posts: 1,155
    edited 2011-05-10 14:20
    Thanks for the suggestions. In fact I spent some time today looking around for a cream type can or an equivalent plastic solution.
    In fact I have some advantages here: There is a single pivot axis, so the connection is easy, adding a little bit of flexibility to the measuring rod is probably enough. Moreover the system is hand operated by an hydraulic circuit, so no speed requirements here.
    On the other hand the environment is extremely harsh, so special care is required, and the pivot point has not much room around.

    So I ruled out optical encoders and similar solution, while magnetic ones are still on the table, mainly because I'm intrigued by the idea.
    I'll have to shop for a decent pot, the ones I have are on boars trimmers, and not suitable for the job.

    Thanks,
    Massimo
Sign In or Register to comment.