Archives: Encoder

Configuring an off-axis MA600 encoder with moteus

This is the final post (hah! for now at least) in my series about implementing support for off-axis encoders in moteus (see previous iterations here: 1, 2, 3, 4, 5). In this one, I’ll share the recipe for how to set up an off-axis MA600 encoder using a ring magnet as the only encoder source.

Hardware

Parts list:

Magnet mounting: The ring magnet needs to be rigidly affixed to the rotor of the motor being driven. It may be necessary to construct a bracket to mount the magnet, or a fixture to position the magnet before using an adhesive.

Mounting the RLS 32mm ring magnet to a GL80 motor

I’ve been exploring how to add low cost off-axis encoder support into moteus, see part 1, and part 2. In this part, I’ll look at a magnet and how to get it installed on the test motor.

To start, this method of operation will require a diametrically magnetized ring magnet, i.e. one where the axis of magnetization is through the diameter rather than through its depth.

That is not a terribly common magnet configuration, but there are some vendors. For this experiment, I used a 32mm OD ring magnet from RLS that is intended for use with their Orbis line of encoders, part number BM220C320A1ABA00. The motor I am using for this test is a T-Motor GL80, which has a hollow shaft. To mate the magnet to the motor, I 3d printed a fixture (purple) which slipped over the bearing surfaces of the GL80 (pink), and captured the magnet (red).

MA600 / MA732 breakout board

In the previous post, I outlined a possible path to low cost off-axis encoders to be used with the moteus line of brushless controllers. The first step I took was to try and build a minimally sized breakout board that could be used with the MA732/MA702/MA600 line of hall effect angle sensors. You can get these off the shelf, for instance from tinymovr, but I wanted to see if I could make something a bit more compact, and that had the chip close to a board edge so that it could be used for off axis applications.

Low cost off axis encoders for moteus - a beginning

The moteus line of brushless controllers all have an integrated “on-axis” magnetic encoder. These encoders are designed to allow moteus to sense the position of a motor’s shaft directly, assuming that an appropriate diametrically magnetized sense magnet is attached to the rotating shaft and the moteus is mounted so that its sensor is positioned over the magnet.

This works great for many applications, but what about hollow shaft motors? moteus supports a few encoder types that will work for off axis encoders, most notably is the AksIM-2. This is a high performance off-axis encoder that gives great performance and is manufactured in configurations for a variety of hollow shaft diameters. However, it does have downsides. First, it comes with a commensurate price tag. In single quantities, the AksIM-2 and magnetic code disc are more expensive than an entire moteus brushless motor controller. Second, only the moteus-n1 has the necessary RS422 transceiver integrated into it. All other moteus boards need an external RS422 transceiver.

MA600 encoder support in moteus

It’s time to announce support for yet another encoder type in moteus, this time the MA600 precision tunnel magnetoresistance (TMR) sensor. Compared to hall effect magnet angular sensors the MA600 has lower noise and less non-linearity. It has a SPI interface and operates from 3.3V. When used with moteus, it can be connected to AUX2 on moteus-c1 and moteus-n1, and to AUX1/ENC on moteus-c1, moteus-n1, and moteus-r4. Support is available in firmware version 2024-10-29 and newer.

On axis performance

To show what it is capable of, I mounted a small breakout board above an on-axis magnet attached to a mj5208.

Debugging moteus calibration failures

When setting up a moteus controller with a new motor, you typically first run the automatic calibration sequence as documented in the reference manual. When your system is working well, that should be all that is necessary to enable moteus to perform accurate FOC based torque control of the motor. Then you can set up basic parameters and tune the position PID control loop. What happens though when the automatic calibration doesn’t work? This post shares the most common failure modes during calibration.

CUI AMT21 series RS485 encoder support for moteus

As of release 2023-09-26, moteus controllers can now use CUI AMT21 series encoders for any encoder source. CUI’s AMT21 series encoders are rugged, with resolution up to 14 bits, and since they use RS485 for communication can be located a significant distance from the motor driver if necessary. Setting one up is easy with the moteus-n1, which is what I’ll cover here.

Hardware

The moteus N1 has JST GH-6 connector labeled “RS422” with all the pins necessary to power and communicate with an AMT21. Since the AMT21 is RS485, not RS422, it is required to tie the A and Y pins together and the B and Z pins together. An easy option is to do so in the harness, either by crimping multiple wires into the Molex terminal for the AMT21, or by splicing wires. The desired schematic looks like:

MA732 encoder support for moteus

As of release 2023-09-26, moteus r4 and moteus-n1 now both support the MA732 as an external SPI encoder. The magnetic sensing performance of the MA732 is normally a bit worse than the AS5047P that is used as the onboard encoder with moteus, but it has two possible advantages.

The first, is that it is much smaller, using a 3mm x 3mm QFN package. The second is that it supports off-axis applications. You will need to read the datasheet, and set the 'aux?.spi.bct' configuration parameter correctly, but this can enable operation in interesting geometries, like a ring magnet with a hollow shaft, or where the coaxial placement is otherwise not feasible.

moteus firmware release 2022-07-11

It has been on github for a few days now, but I’m excited to announce the newest moteus firmware release, 2022-07-11. This release includes some big features, and some quality of life improvements all around.

  • Flexible I/O subsystem: This release includes the new flexible I/O subsystem. This adds support for many new encoder types and lets you connect them up in a wide variety of ways.
  • Cogging torque compensation: Preliminary support for cogging torque compensation is present in this release. It works pretty well on a number of motor types already, future articles will describe it in more detail.
  • Encoder eccentricity compensation: This feature lets you linearize the output position and velocity in the face of non-linear encoder readings. A write-up for it is also forthcoming in the not-too-distant-future.
  • Transparent no-BRS CAN-FD communication: If your CAN-FD network is only capable of operating at 1Mbps, and you send queries frames with BRS turned off, moteus will now respond in kind. This eliminates most needs to change the CAN bus frequency due to marginal electrical properties.

This is an exciting time for moteus, and the new features will keep coming!