Close

Design

A project log for CAN Controlled Dual Closed-Loop Motor Controller

Dual micro-gearmotor controller with CAN bus interface and onboard motion primitives

jake-wachlinJake Wachlin 08/02/2020 at 20:030 Comments

This design must meet a few requirements:

There were a few use cases I was thinking about with this:

1) Walking Robot

One of these boards can be used for each leg to control 2 joints. A main controller can make decisions about how to move each leg, and this board will handle the realtime, low-level motor control to achieve the desired response.

2) SCARA Arm

One of these boards can be used to control the SCARA arm. Instead of stepper motor control, the system could move faster and have knowledge of when the arm is in the correct position.


With those requirements and use cases in mind, the design was started. An ATSAMD21G18 was chosen for the microcontroller. This is a 48 MHz ARM Cortex M0+ microcontroller with enough power to run FreeRTOS, perform the needed motor control, and interface with the CAN bus. It does not have a CAN controller built in, so an external controller will be used, the MCP2515. The A3906 motor controller can handle both motors, up to 9V and 1A per motor. It has built to support current monitoring. Finally, a high-speed nonvolatile memory in the form of FRAM was included so the system could continuously store the current motor positions. In some use cases, this could be loaded on boot so no homing process would be required to determine the motor positions.

The ATSAMD21 is used in many Arduino compatible boards. In this case, the firmware will be developed with Atmel Studio, but theoretically this board could be made Arduino compatible.


In the next logs I will look at the initial firmware development, design of an example walking robot leg, and initial motor control.

Discussions