Tinymovr: An Integrated Brushless Motor Controller

I must admit that I’ve neglected this blog for a while, as it has been almost six months since I wrote a new post. On the other hand, I have been very busy with the development of a brushless motor controller for robotics: Tinymovr, as well as an associated quadruped robot design. For the past six months, I’ve been posting on the development of Tinymovr over at Hackaday.io. But I feel it’s time to return to this blog with a new update in a more informal setting. In addition, I’m planning to change my publication schedule from now on: More frequent, shorter updates on Tinymovr and quadrupeds here, which will be mirrored over at Hackaday.io. Let’s get this started!

The Idea

I’m an avid ODrive user (having five devices at my workshop already), and as you can tell from past posts, have a keen interest in legged robotics. While ODrive is a powerful tool with many applications, it’s form factor, weight and the need for external encoders do not always make it easy to design robots, especially smaller scale ones. Sure, there are great examples out there, but I believe a highly integrated, compact board is a better fit to a mobile robot, even if it does not have the specs of larger boards such as ODrive.

There are a bunch of “hobby” grade brushless motor control boards out there. Moteus, μMotor, DizzyMotor and others are examples of very capable boards. In fact, I was considering to just try my luck with one of the existing designs, however I had concerns about the cost in large quantities. Cost of some of the available designs could exceed $1500 at the quantities required to build a quadruped robot. Even cheaper boards lacked some of the functionality that I deemed necessary for robotics application.

It was more or less at this point I found out about a neat little microcontroller by Qorvo that goes by the name of PAC5523 (PAC stands for Power Application Controller). This turns out to be a very capable Cortex M4F microcontroller with integrated gate driving circuitry. Best of all, even at low quantities, the PAC was very affordable, and thus had the potential to decrease the BOM cost!

Contrary to popular STM and TI MCUs, resources on the PAC5523, were (and still are!) very scarce. The only ones available were those offered by its designer, at the time Active Semi (later Qorvo). Nevertheless, at that point I was sold and ordered the (quite heftily priced) evaluation kit to experiment.

First Steps

My initial setup consisted of a PAC5523 evaluation board, an AS5047P magnetic angle sensor evaluation board and a noname 2212 brushless hobby motor. I used a JLink EDU probe to program and debug the board. It is noteworthy that as of this writing it seems that PAC controllers are only compatible with J-Link.

After a couple of weeks of spending evenings reading datasheets and writing controller code, I managed to get the controller working and gave the motor a spin! The above setup worked remarkably well, for a first try! It was the first time that I actually had a positive feedback in a long time.

At the same time the PCB design for my own integrated board was moving on at rapid pace. I had worked out the requirements and located the necessary components. I made a project page on Hackaday.io, whose description gives a good idea of what the project is aiming at:

Tinymovr is an affordable motor controller for precise control of 3-phase brushless motors. Tinymovr is highly integrated incorporating an advanced MCU (Qorvo PAC5523PAC5527). It also features a compact power stage, integrated absolute angle encoder (MPS MA730MA702) and CAN and UART connectivity. Due to high integration, Tinymovr is very affordable, with a BOM that is less than $40. Tinymovr can operate in Torque, Velocity or Position modes, using Field Oriented Control (FOC). It can be integrated at the back of the brushless motor for a compact setup. Tinymovr measures 40x40mm (1.57×1.57 inches). 

Motor Controller Revisions

Needless to say, there were a fair share of issues cropping up, both from hardware as well as software standpoint. Some of those were easily fixable and others critical and led to frying a number of boards. Once I had a function that assigned PWM values though an array that I declared inline. However, I forgot to initialize the array, and therefore it contained garbage values. This led to the power stage frying in two different boards. What’s more, it almost fried the motor itself, (which I would’ve preferred, as the motor is really cheap!).

Read also:  Building a better 3D printer

In addition, another driving force to revise the boards has been – and still is, price. Indicatively, the AMS AS5047P encoder used in the original design was by far the most expensive component at around $11. The second revision replaced it with the MPS MA730, which, came at around $3. Due to some issues of the MA730’s dynamic response, the current (third) iteration of the board features the MPS MA702, which has lower resolution but a much better dynamic response.

In the following video of Tinymovr R2, CAN bus at 500kHz is used for bidirectional communication. Initially, the Arduino issues a calibration command and checks if successful. Then, it sends a series of position commands at random intervals, and also requests position and velocity information at a rate of 500Hz, which is then retransmitted via Arduino serial and plotted using Serialplotter.

The board is currently in it’s third revision, R3, which has been a major upgrade from R2, replacing the MCU for the more advanced PAC5527 and the aforementioned replacement of the MA730 for the MA702. I expect the boards to arrive from China starting next month.

Steps Forward

As soon as Tinymovr R3 gets in my hands, it’s all about testing. I’ve already taken this time to revise the firmware for the new MCU. At this stage I’ll be testing functionality and performance of the board and firmware.

In parallel, work continues on client-side software and libraries to make interfacing Tinymovr as effortless as possible. I’m currently working on Tinymovr API, a Python library and REPL shell that can interface with Tinymovr via CAN and a cheap Arduino-based USB-to-CAN adapter.

Finally, work on a quadrupedal robot to demonstrate Tinymovr application continues. Design of the robot legs and a single-leg test stand is complete; a future post will cover robot design more extensively. Below a series of demos of the quad leg:

Conclusion

This post summarized development on a new brushless motor controller, Tinymovr, that is designed with light robotics applications and affordable cost in mind. Stay tuned as more posts will follow as the development of Tinymovr progresses!

For more exciting experiments and tutorials, subscribe to our email:

2 replies on “ Tinymovr: An Integrated Brushless Motor Controller ”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.