NameNet IDSection
Aaron de los Santoshtd2ECE 120

Introduction

Statement of Purpose

This project aims to create a small, low cost high-speed high-precision actuator. The objective is to demonstrate the ability to control position on a regular brushless motor. The problem this project aims to tackle is the lack of cheap robotic actuators available. The goal is to create an alternative to expensive robotic actuators to be used in projects such as a robotic dog. 

Background Research

I wanted to work on this project since I have been trying to build a robotic dog since last year, but I could not find stepper motors to drive the joints that fit my requirements. Regular stepper motors are slow and bulky. Brushless motors, on the other hand, lack both speed and positional control. Robotic actuators would be perfect, but they are expensive. For example, those used on MIT's robotic dog Mini Cheetah cost over $300.


This project would utilize the open-source ODrive motor controller, which includes a discrete microcontroller to run its own open source software. The ODrive controller software supports directly interfacing with an absolute encoder, and also provides the tools to adjust the PID control loop gain values depending on the behavior as observed from the encoder data.


Design Details





System Overview


The brushless motor is controlled and powered by the ODrive motor controller through PWM. The pulse is varied depending on the difference between the current position and the desired position, and this is calculated by the cascading PID control loop managed by the ODrive motor controller. 

An absolute position magnetic encoder (AMS AS5047P) is used to sense the magnetic field changes induced by a magnet attached to the back shaft of the motor. This encoder communicates directly with the motor controller through ABI, since interfacing with multiple encoders through the ODrive hardware is not possible through SPI. Using ABI keeps the future option of interfacing with two encoders with a single board open. The ODrive motor controller then reads this data and determines the motor’s current absolute (rather than relative) position.

The wiring scheme of the encoder to the ODrive motor controller through ABI can be seen in this diagram in the AS5047 encoder datasheet:

The ABI quadrature interface uses three wires: A, B, and I. Connecting with the ODrive thus uses five wires, with the addition of power and ground.

To manage the position of the motor, the motor controller relies on a cascading PID control loop. 

Cascaded pos vel I loops


Fine tuning the PID parameters based on the behavior of the motor as read from the encoder data is essential for accurate positional control of the brushless motor. The ODrive motor controller provides a live plotter tool to chart the data from the encoder when connected via USB to a computer, which is useful to tune the ideal PID gain values. For example, a large overshoot in position beyond the desired set point would indicate that the D gain values are off, while a slow ramp-up to the desired position indicates lacking P gain values. Fine turning of this control loop would be expected to be quite difficult to get right such that positional control of the brushless motor is a balance of responsiveness, precision, and stability.

The ODrive is directly interfaced with a computer through USB, which provides a two-way communication. From the command line, the ODrive can be configured and controlled. The ODrive also reports the current position as read by the encoder, which is then plotted on a graph through the help of the liveplotter tool.  

A 4S LiPo battery with a rating of 30C can be used to power the Odrive motor controller, and by extension, the motor. The battery is chosen such that the maximum current it could provide exceeds the peak current draw of the motor used. 

The overall circuit would be therefore be arranged like so: The computer would interface with the ODrive motor controller through USB. The LiPo battery would be connected to the power terminals of the Odrive motor controller. The three wires of the motor would be connected to its respective terminals on the motor controller. Finally, the encoder is wired to the motor controller through a five-wire ribbon cable connected on the corresponding pins (ie A->A, 5V->5V etc.) and would interface using ABI.

Parts

  • SunnySky V3508 motor

  • ODrive motor controller
  • AS5047P encoder
  • LiPo battery (4S 1000mah 30C)

Possible Challenges

  • Accurate and precise positional control might be difficult to achieve with the brushless motor
  • Challenges with understanding the output from the encoder and knowing how to adjust the control loop from there
  • Difficulties in soldering small parts (I only have 1 solder tip)

References

[1]"madcowswe/ODrive", GitHub, 2020. [Online]. Available: https://github.com/madcowswe/ODrive. [Accessed: 19- Sep- 2020]

[2]P. Wensing, A. Wang, S. Seok, D. Otten, J. Lang and S. Kim, "Proprioceptive Actuator Design in the MIT Cheetah: Impact Mitigation and High-Bandwidth Physical Interaction for Dynamic Legged Robots", IEEE Transactions on Robotics, vol. 33, no. 3, pp. 509-522, 2017. [Accessed: 19- Sep- 2020]

[3]T. Wilkinson, "3D Printed Robot Joint with Active Compliance", Hackaday.io, 2020. [Online]. Available: https://hackaday.io/project/165653-3d-printed-robot-joint-with-active-compliance. [Accessed: 19- Sep- 2020]

[4]G. Levine, “OpenTorque Actuator,” Hackaday.io. [Online]. Available: https://hackaday.io/project/159404-opentorque-actuator. [Accessed: 27-Sep-2020].



Attachments:

Comments:

I don't believe this project has enough complexity as-is to qualify for Honors credit. If I understand correctly, this is just attaching an encoder to a motor with a motor controller?

Is there maybe another logic element (for ECE 120) that you can add to this project?

Posted by jamesw10 at Sep 22, 2020 20:10

Hello! Sorry about that; I wasn't clear in my original proposal.

I've now modified it to describe the whole project. The actuator would require CAD work for the gearbox and housing design, and would involve working with PID control loops and tuning the parameters to the system. The design itself would be complicated as it would require designing the right gear system that fits in the small actuator housing, and would also require knowledge of how PID control loops work in order to fine-tune the system. I could also add force sensing and reaction to the project if it isn't complex enough.

Posted by htd2 at Sep 27, 2020 00:11

This honestly seems like more of a mechanical design project. The vast majority of the complexity of this project will be in the mechanical design and fabrication; I'd say that the electronics and programming portion of this project is trivial, at best. A single PID loop is not really sufficient for Honors Lab, yet the mechanical design would put this far outside the reasonable complexity in terms of fabrication.

If you do not have access to a CNC machine or router (or similar machining tools) I don't think you will be able to manufacture this to the quality that you are expecting. I would recommend finding a way to decrease the manufacturing/design complexity (This is NOT a mechanical engineering course) and find a way to explore electronics + programming in a more meaningful way for your project.

Posted by fns2 at Sep 30, 2020 23:44

Details on the PID loop look great. Thanks for updating this. Approved.

Posted by fns2 at Oct 17, 2020 19:01