Archives: Motor

Improving motor constant calibration in moteus

moteus is able to for many motors automatically determine all the relevant parameters that are necessary for control. That includes phase resistance, phase inductance, torque constant and pole count. The calibration routines have worked pretty well for a wide variety of motors and all the currently available moteus controllers, but when working to expand the supported envelope recently I undertook an effort to make that support even broader, specifically to improve accuracy when measuring resistance and torque constant, and to reduce outliers when measuring inductance.

Representing torque constant as Kv in moteus

One of the characteristic metrics of brushless DC motors is the Kv value, which describes the relationship between the angular velocity of the motor and its back EMF. Somewhat unexpectedly, this constant also completely determines the torque constant of the motor, i.e. the relationship between phase current and mechanical torque output (see this Things In Motion post).

Since the very first release of moteus, this Kv constant has been stored in moteus using somewhat non-intuitive units as motor.v_per_hz. That makes a lot of sense internally, as nearly all math the controller has to do can be natively done with those dimensions. However, as a user visible motor constant, it is completely opaque. Further, as a result of my incremental discovery of the math behind BLDC motors, the constant used by moteus had some additional “fudge” factors baked in that were then backed out through other “fudge” factors in the firmware.

moteus configurable motor thermistors

When operating a moteus controller with a brushless motor there are two main things that can get hot: the FETs (field effect transistors) on moteus and the motor itself. By default, moteus has built in thermal throttling and fault detection if the FET temperature exceeds rated limits. In many configurations, the motor can be thermally connected to the moteus controller, so that the same FET temperature sensing can be used to prevent damage to the motor, but that isn’t always the case.

Auto-tuning current control loops

Since the moteus controller was first released, it has implemented a two-stage controller. The outer loop is a combined position/velocity/torque PID controller, which takes as an input a position trajectory, and outputs a desired torque. The inner loops accepts this torque, and uses a PI controller to generate the Q phase voltage necessary to achieve that torque.

Until now, the constants for that PI controller were left as an exercise for the reader. i.e. there were some semi-sensible defaults, but the end-user ultimately had to manually select those constants to achieve a given torque bandwidth. That isn’t too much of a problem for a sophisticated user, but for the rest of us, it is hard to know how to go from a desired torque bandwidth to reasonable PI gains.

new product day: mj5208 brushless motor

Welcome to the newest mjbots.com product, the mj5208:

This is a high quality 5208 sized 330Kv wound brushless motor with short pigtails intended to connect to moteus controllers. All the moteus devkits as of last week are shipping using this motor instead of the previous “semi-random” motor.

Specifications:

  • Peak torque: 1.7 Nm
  • Mass (with wires): 193g
  • Peak power: 600W
  • Kv: 330
  • Dimensions: 63x25mm

There are two bolt patterns on the output, a 3x M3 17mm diameter one, and a 2x M3 pattern spaced at 12mm. The stator side has a 4x M3 pattern spaced at 25mm radially and a 3x M2.5 spaced at 32mm. The axle protrudes a few mm from the stator, making it easy to adhere the diametric magnets needed for moteus.