Skip to content
Snippets Groups Projects
Select Git revision
  • 9579bcc9ccbb1c643c36704bbd62556805253bb3
  • master default
2 results

README.md

Blame
  • README.md 9.73 KiB

    MachineKit Encoder

    Motivation

    w/ AS5304 / AS5306

    Pins for Quadrature Input on ATSAMS70?

    A key limitation in my previous work here was encoder positioning. I wanted to use a ring magnet and off-axis linear sensor to decode rotary position - the trouble was I could only find one supplier of ring magnets with the right pole spacing, and it was ~38mm ID. The whole gist of the mechanical design here is to bring the diameter way up, so this was not satisfactory, or, at least, it was a constraint.

    Here I am going to try to use discrete magnets in an assembly of my own... I am basically just building a big ring magnet, and trying to read that.

    Problems

    I am using an AS5304 (4mm poles) or an AS5406 (2.4mm poles). Each has 160 positions per magnetic period. This translates to a resolution of 25um and 15um steps, respectively. If I wrap this around some diameter D I have that

    angular resolution = 360 / (((PI x D)/pole_length) x 160)

    Of course, I have to set the circumference equal to an integer value of magnets. I wrote a quick spreadsheet for this, and get that w/ a Diameter ~ 100mm (where the gearbox currently stands) I can get 0.017 deg/step with a 2.4mm pole pair, and ~ 0.03 deg/step with a 4mm pole spacing. Nice.

    rough spreadsheet

    Now, this is not so straightforward. The important thing to remember is that Resolution != Accuracy - while I have ~ 0.03 deg / step, those steps are not exactly mapped perfectly in a circle. I will actually be referencing magnets that are glued in place - so my glueing and magnet placement would have to be perfect for Resolution to = Accuracy. In addition, not all magnetic fields will be identical, etc. Everything is crooked.

    In addition to these mappings between poles, I will have some deviation, I'm sure, within the poles. As in, the magnets will likely have small gaps (finding a magnet which is perfectly 4mm across... not likely) and so I expect readings to kind of sine-wave around linear.

    This can be overcome in implementation by mapping in memory a lookup table, with respect to some 'home' position, of how measured ticks of the encoder match up with reference positions. For example, I would rotate the encoder to known positions (with some other, higher precision system) and map readings -> known values.

    This is not ideal! And it requires a deal of labor, some good routines and memory-storage games, and a reference point.

    In this exercise (which I am trying to keep bounded)1 I will try only to measure this deviation-from-perfection. Or, at least, deviation from some other, better positioning system.

    At best, I hope to cancel periodic deviation (i.e. map the sine-wave between individual poles into a more linear interpolation. my encoders have an Index pulse (on every top-of-pole) that I can use as a reference point for this.

    Design

    Without further ado, here's a sketch of how I plan to build the encoder:

    layout test