Archives: Moteus

Hot swap controllers (next get power_dist part 3)

This is one of a series covering the new mjbots power_dist board. See part 1 and part 2 for more context.

As mentioned previously, hot swap controllers are primarily used to allow a card to be inserted live into a server backplane, while minimizing disruption to the primary power bus while doing so. Additionally, they often implement protection features like over-current and short-circuit protection, and some support energy monitoring.

Typical topology

A typical hot-swap topology looks like:

Next-gen power_dist (part 2)

Last time I covered the limitations of the power_dist r3.1, here I’ll cover some iterations of the design process.

My initial design goals for this version are based largely around improving the major limitations identified before:

  • Positive side switching: By switching the positive rail, a whole class of use failures is removed, as most people expect ground to be common throughout a system.
  • Increased voltage range: moteus r4.5 and the pi3hat both support 44V, so any new power_dist board should support at least that.
  • Lower quiescent current: Ideally, the quiescent current would be measured in microamps, or at least at a level that it does not confuse BMS systems.
  • Energy monitoring: Often in the development of the quad A1, I wanted to have a system level power and energy monitoring solution so as to identify the energy cost of various maneuvers and gaits. Tracking that at the power_dist level seems like a logical place.
  • Wider load envelope: The 3.1 version had a relatively limited maximum downstream capacitance and turn-on current draw. It was enough to power on 12 moteus controllers and a small computer, but not much else.

To achieve these goals, I decided to try using what is known as a “hot swap controller”. These are integrated circuits that are intended for use in cards that plug into server backplanes. Given that any given card could potentially have a large decoupling capacitance, inserting it live into a backplane could cause arcing, and high currents that cause the overall bus voltage to drop outside of tolerable limits.

Development of next-gen power_dist (part 1)

The current iteration of the mjbots power_dist board released back in the summer of 2020 is pretty useful. It pre-charges the input, provides a soft switch, and gives you a bunch of output connectors to make wiring easier.

r3.1 Limitations

However, this version did have some limitations and potential problems. The first is that the pre-charge method it uses, a simple on/off pre-charge resistor, is unable to support a wide range of supply voltages. Either the resistor has a low value, in which case large input voltages will cause thermal failure, or for larger values, it isn’t able to actually pre-charge the bus sufficiently before engaging the primary MOSFET.

moteus position anti-windup

The moteus controller uses a somewhat unique integrated position / velocity / torque controller with per-command configurable proportional and derivative gains. Through various combinations of these settings, it can emulate many different types of controllers, but one that it has struggled with until now was a pure velocity controller.

It has been minimally possible to use moteus as a purely velocity controlled since wraparound support was implemented, but that came with a caveat. Either the proportional term needed to be set to 0, in which case velocity tracking performance was poor, or if the proportional term was non-zero, an external torque would cause the position to drift arbitrarily far from the target position. Then if the external torque were released, the controller would “catch up” for all the lost ground, moving very rapidly.

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.

New cross-platform moteus tools!

After receiving many requests via youtube, discord, and email, I’ve finally gone ahead, bitten the bullet, and updated all of the moteus tools to be pure python and work in a cross platform manner. Now, the only thing you need to do to install pre-compiled versions of tview and moteus tool on most* platforms is:

pip3 install moteus_gui
python3 -m moteus_gui.tview    # (or maybe just tview)
python3 -m moteus.moteus_tool  # (or maybe just moteus_tool)

I’ve personally tested these on Linux, Windows, and Raspberry Pi, and others have at least verified basic operation on Macs. Python 3.7 or greater is required.

New product day: moteus heat spreader

The moteus controller is capable of a lot of instantaneous power. However, to fully make use of that power, you’ll need to keep the mosfets cool on the board. moteus has two mechanisms for that:

  1. A heatsink can be mounted to the bottom side of the PCB between the board and the motor. This is most useful when integrated into a servo motor, and the servo housing can be used as a heatsink.
  2. Mounted to the top of the board, attaching to the MOSFETS directly.

In addition to the MOSFETs, the gate driver chip, the DRV8323 can produce large amounts of heat, especially when the controller is run at a higher voltage, like the 44V that the moteus r4.5 supports.

moteus and socketcan

Various users have been trying to use lower-cost Raspberry Pi CAN-FD adapters for the moteus controller for some time (like this one from Seeed), but have had problems getting communication to work. I buckled down and went to debug the problem, discovering that the root of the issue was that the linux kernel socketcan subsystem calculates very sub-optimal CAN timings for the 5Mbps bitrate that moteus uses. This results in the adapters being unable to receive frames sent at the actual 5Mbps rate, but instead only slightly slower.