Archives: Development

Updated moteus test fixture

I documented the first test fixture I built for moteus some time ago. As the shipment volumes have gone up, the fixture became something of a limitation, and also was a little problematic in a few ways.

The old “state of the art”

First, it relied on attaching 3 connectors by hand for each test, which was a decent fraction of the cycle time. Second, the pogo pins it used were non-replaceable, and also connected only to the debug phase wire test vias, which were tiny. They wore out relatively quickly, and replacing them required building a whole new board. Finally, since the pogo pins were PCB mounted, a PCB needed to be printed for any change in the pin locations or which pins to probe.

Flexible I/O: Sink configuration

This will be the final post describing the fundamentals of configuring the new flexible I/O system. There have been a number of previous posts (part 1, part 2, part 3). In this iteration, we’ll cover how to configure the sinks that consume the “source” encoder data. As a reminder, the block diagram of the I/O system looks like:

Commutation

To perform commutation with field oriented control, moteus needs to know the relationship between the rotor and stator in the magnetic domain. With the addition of the new flexible I/O system, some of the configurable values associated with this remain as they were, where there are some new ones.

Flexible I/O: Source configuration

In the last two posts (part 1, part 2), I started talking about the new, more flexible I/O subsystem for the open source moteus brushless motor controller. In this post, I’ll continue by describing what a “source” is, and how it is configured.

For reference, the block diagram showing how auxiliary ports, sources, and sinks are related is below:

Each “source” in the above diagram represents a single encoder. To the sinks it provides a position and velocity, along with various validity indications for that data. Each has three basic configuration components: where to get the raw data, how to transform that raw data, and the low-pass filter configuration. We’ll cover each in turn.

Flexible I/O: Auxiliary port configuration

In the last post, I covered the goals behind more flexible I/O support in the moteus brushless controller. This time, I’ll start to cover the configuration model that I implemented to make that support work. It is broken up into 3 distinct phases, auxiliary ports, sources, and sinks.

Slightly simplified I/O structure flow diagram

Slightly simplified I/O structure flow diagram

Auxiliary port pin configuration

To begin with, the available connectors and external pins on moteus are organized into “auxiliary ports”. For the moteus r4.3/4.5/4.8/4.11, the correspondence is that the external primary encoder connector, if present (r4.8 and newer), is “auxiliary port 1”. The ABS port and some on-board debug pads are “auxiliary port 2”. For each port, there are two levels of configuration, at the pin level and the function level.

Beginnings of more flexible encoder and I/O support

The moteus controller, being a brushless servo drive, needs to use encoders to measure things like how the rotor is positioned relative the stator, and possibly output shafts that have passed through a reducing stage. The support for this has gradually expanded over time, but is still relatively limited as far as those things go. The available options are:

  • Primary encoder (used for commutation)
    • The onboard AS5047P
    • An external AS5047P
  • Auxiliary encoder (optional, for measuring the output shaft)

However, the moteus hardware has always been capable of more, both because the processor is a very capable one, and the exposed IO pins are relatively flexible. While looking at some future designs that incorporate even more IO options, I decided it was time to update the firmware to finally start taking advantage of that flexibility.

Solid model of wcubed Pocket NC vise

Some time ago I wrote about using the wcubed vise for the Pocket NC. While I don’t end up using it very often any more, mostly because I rarely work with rectangular stock, it can be useful from time to time. Unfortunately, it is no longer manufactured. In case anyone is interested in replicating it, I’ve taken at least a minimal stab at modeling it up based on measurements of my unit along with necessary hardware as picked from McMaster. I suspect the model should be good enough to get something that works.

New machine day: A manual lathe

With the Artisan’s Asylum closed for a relocation, I’ve been without access to a manual lathe for a while. Fortunately, import mini-lathes aren’t that hard to come by!

What’s inside?

What’s inside?

Well, look at that!

Well, look at that!

This is a Sieg C4 derivative from Little Machine Shop, which was about the largest machine I could reasonably move into my basement.

All set up

All set up

It isn’t as rigid as the Colchester at AA was, but it does have power feed and power cross feed which both work just fine. I’ve run into a few minor quality issues, and the spindle runout isn’t great, but it should do for my needs.

Improved moteus_tool calibration

To use the moteus brushless controller with a motor, you first have to calibrate it with moteus_tool (for history, see “Encoder autocalibration” and “Auto-tuning current control loops”). This calibration process is primarily used to measure the mapping between electrical phases and the encoder, but as a secondary parameters also measures the winding resistance and Kv of the motor and determines the parameters necessary to set the current control bandwidth.

Motivation

To date, this process can be used with any motor, but making it work can involve fiddling with a number of inscrutably named command line parameters to moteus_tool. --cal-power, --cal-voltage, and --cal-speed are all there, however they don’t really do what you think based on their name, but it is necessary to adjust them to make many motors work.

Pocket NC Touch Probe - Software (Part 4/4)

This is a series, check out the previous posts at part 1, part 2, or part 3. This time, I’m going to make this probe hopefully do something.

I started out just verifying that the Pocket NC would treat the vers.by probe the same as the built in tool setter probe. So I ran a tool measure cycle, and then just tweaked the probe by hand. Woohoo! It stopped the cycle just like normal. Actually measuring a tool worked too if the probe wasn’t activated, or if it wasn’t plugged in. Success.