
MCU Powertrain
mark-belbin/motor-controller
Custom FOC motor controller designed for underwater robotics.

Custom FOC motor controller designed for underwater robotics.
Thruster Controller is an open-source printed circuit board by mark-belbin, from the mark-belbin/motor-controller repository on GitHub, published under the GPL-3.0 licence. It is a 4-layer board of 35.9 × 10.9 mm with 110 parts on 106 nets, routed with 1,513 tracks and 359 vias.
It is built around the TMS320F28027FPTT, MCP2562-H/P and MCP2515-I, with the RTQ2569-50GQW-QA and SIZF906DT among its other parts. Its parts include 41 capacitors, 32 resistors, 8 connectors, 6 ICs and 5 diodes. It belongs with the robots and motor control boards of this library.
This project was a multi-year effort to develop a ground-up, brushless motor (BLDC) controller for use in underwater robotics.
The final controller is designed for T200 or T100 thrusters from BlueRobotics, boasting sensorless FOC and a miniature form-factor that is built right into the thruster.

FOC Thruster Controller V2 Top View

FOC Thruster Controller V2 Bottom View
Brushless motors, such as BLDC or PMSM motors, have no physical link between the stator and rotor like in a standard DC motor. Therefore, these motors must be commutated (spun properly) using an external controller. The key is knowing where the motor's rotor is relative to the stator, such that the magnetic field of the stator can be generated with accuracy in order to successfully push along the rotor and get the motor to spin.
For most hobby BLDC controllers, commonly referred to as electronic speed controllers (ESCs), motor commutation is accomplished through sensorless trapezoidal 6-step control. This commutation method steps through 6 distinct stator magnetic field positions in order to keep the motor spinning, based only on the feedback of the back-EMF voltage of the three motor phases. With only 6 available control positions, this method of commutation lacks maximum possible efficiency, but it remains a simple, reliable, and cheap control method.
This motor controller design implements Field-oriented control (FOC), also known as sinusoidal control or sine wave control. The FOC algorithm used is provided by Texas Instrument's InstaSPIN product line. This enables FOC using sensorless feedback, meaning no extra encoders or sensors are attached to the motor. The TI sensorless system measures only the 3 phase voltages and 3 phase currents of the motor in order to estimate the current rotor position with high accuracy. Also important is the intrinsic properties of the motor, such as the phase resistance, inductance, and the motor flux linkage. InstaSPIN requires a motor calibration procedure be run on each unique motor to automatically determine these intrinsic values, if not the FOC algorithm will not run.
This custom FOC controller design was evaluated by comparing against the BlueRobotics Basic ESC R3, a standard hobby-style ESC. Both will run the same BlueRobotics T200 thruster, which is the intended use-case of the custom developed controller.
BlueRobotics T200 Thruster and Basic ESC R3.
FOC has numerous potential benefits compared to traditional trapezoidal control. The most striking are the increase in efficiency and reduction in motor noise. This is possible since FOC control applies the most optimal stator magnetic field to push the rotor forward, and as a result generates clean and noise-free sine-wave current wave forms.
A comparison of current waveforms is shown below. Both the custom FOC controller and the Blue Robotics Basic ESC R3 are controlling a submerged T200 thruster at 2000 RPM. The FOC phase currents are much cleaner and closer to sinewaves, while the Basic ESC waveforms are more choppy and trapezoidal.
FOC phase currents vs the BR Basic ESC R3 at 2000 RPM.
A significant difference in operating noise is observed because of the current waveform difference. This is very noticeable underwater too, as the louder electrical sounds generated by the Basic ESC travel far. By comparison the custom FOC controller runs quiet, especially for low to mid-range speeds of 0-2000 RPM.
An efficiency test was completed for both the custom and off-the-shelf controllers. A T200 was secured and submerged in a relatively large tub full of water. A separate waterproof, magnetic RPM sensor was attached to the shaft of the T200 to independently measure the RPM of the thruster. Measurements were taken of the input power of the motor controller under test for RPM settings in steps of 100 RPM.
FOC Controller Testing
The FOC controller is more efficient across nearly the entire RPM range. The graph below is shows superiority up until about 2500 RPM, beyond which the FOC controller has the same or slightly worse performance. This is a limitation of FOC, where at a certain voltage the controller will switch to overmodulation control, where the controller will gradually transition to trapezoidal control as the RPM increases. To remain efficient at upper RPMs, a higher input voltage would need to be supplied.
FOC Controller vs the BR Basic ESC R3.
Here's how the efficiency difference changes over the course of the RPM range:
The outperformance at lower RPMs is significant, since many underwater robotics applications operate in this range, such as Autonomous Underwater Vehicles (AUVs) or Autonomous Surface Vessels (ASVs). Battery life is critical for these types of vehicles, and the reduction in motor power from FOC control could have a big impact.
A few other minor benefits were observed with the custom controller and FOC:
The motor controller PCB design was created using KiCAD. It's a 4 layer board, approximately in the shape of a xx diameter circle. The notches in the design allow it to be dropped in a mount for the T200 thruster. The PCB project is located in "hardware/Thruster_Controller_V2". An older version of the controller is found in "hardware/Thruster_Controller_V1", with the main difference being a different TI microcontroller.

FOC Thruster Controller V2 Angled View
The board itself is dense, and probably could have benefitted from a 6 layer design instead. However, limiting the design to 4 layers keeps the prototype costs very cheap. In total, for an order of 10 PCBAs, the total cost for the boards were about $2 each thanks to JLCPCB, and the total component cost is about $36.50 per board. So in total, less than $40 CAD per PCBA for only a 10 order quantity, not bad! At scale, this can shrink further, but probably not less than $25 per board.
Some major components are:
The controller firmware is based on MotorControl SDK 3.01 from TI. This SDK enables sensorless FOC with select TI microcontrollers. The microcontrollers have a proprietary InstaSPIN sensorless algorithm embedded in the ROM, which restricts this system to compatible TI MCUs only.
The code is modified from a MotorControl SDK example lab, with extra drivers written for CAN communication. There is also some modification to disable a built-in overcurrent feature using the CMPSS. For whatever reason the feature seems to be bugged. I haven't yet figured out a good solution to either fix it or replace the overcurrent protection. So take caution if using this project as a base for something else!
The IDE used is TIs Code Composer Studio, a customized version of Eclipse. The most up-to-date project is found in "firmware/TI_ESC_V2". The project is completely separated from TIs MotorControl SDK libraries, so it should be portable and importable in to Code Composer Studio from any computer with/without MotorControl SDK installed.
The motor controller PCBA was designed to be integrated into the back of the T200. The PCBA is first placed in an aluminum mount. Then, the thruster phase wires are soldered to the PCB. These wires are exposed by hacking away the jacket of the thruster very delicately. A new 10-conductor cable is then soldered to the PCB, replacing the original thruster cable. The final assembly is then potted, and mounted to the back of the thruster using the existing two screw holes originally for the back nose-cone. With this integration, the controller is water-cooled by the the thruster itself as water is forced passed it.
Fresh-cut aluminum PCBA mounts
Anodized mount + PCBA
An interesting aspect of the mount design is the inclusion of a sealing disk. This disk, plus an o-ring, seals a programming port on the controller. This allows for reprogramming of the TI microcontroller while still maintaining water resistance. In the future it might be nice to include a bootloader on the microcontroller, which would allow programming over CAN instead, eliminating the need for this extra sealing disk!
T200 + Controller Angled View
T200 + Controller Top View
An immediate application of the FOC thruster controller was in my final-year engineering senior design project; an autonomous underwater vehicle (AUV). The AUV includes six thrusters in the design, and I built an FOC controller in each one. In the end, the project was a resounding success, and a very good test scenario for the custom controllers. The controllers were smooth, operating well at low speeds, which is all the AUV needed. The thrusters also operated very quietly, even when pushing the AUV to higher speeds for fun.
Capstone AUV Top View
Capstone AUV Bottom View
Check out the AUV in action here -> https://www.youtube.com/watch?v=-c5bOXZom5M
The repository is organized into 3 categories; hardware, firmware, and docs. Included in the hardware folder is the latest FOC controller V2, as well as an older version V1, and many test boards built to test and evaluate the project along the way. The firmware folder includes the latest V2 firmware, as well as the V1 firmware and sample test projects that were provided by TI and were useful for debugging.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 9 | 1uF | Capacitors_SMD:C_0603 | C3, C5, C20, C27, C28, C29, C39, C40, C41 |
| 7 | 0.1uF | Capacitors_SMD:C_0402 | C6, C7, C8, C17, C23, C30, C42 |
| 6 | Net-Tie_2 | MCU_Powertrain:NetTie-2_SMD_5mil | NT1, NT2, NT3, NT4, NT5, NT6 |
| 5 | 2.2uF | Capacitors_SMD:C_0402 | C34, C35, C36, C37, C38 |
| 4 | 2.2k | Resistors_SMD:R_0402 | R27, R28, R29, R30 |
| 4 | 22.0k | Resistors_SMD:R_0402 | R3, R4, R5, R15 |
| 4 | 4.99k | Resistors_SMD:R_0402 | R12, R13, R14, R16 |
| 3 | 1000pF | Capacitors_SMD:C_0402 | C9, C16, C18 |
| 3 | 2200pF | Capacitors_SMD:C_0402 | C24, C25, C26 |
| 3 | 22uF | Capacitors_SMD:C_1206 | C12, C14, C31 |
| 3 | 22uF | Capacitors_SMD:CP_Elec_6.3x5.8 | C10, C13, C15 |
| 3 | 56 | Resistors_SMD:R_0402 | R20, R21, R22 |
| 3 | 5m | Resistors_SMD:R_2512 | R8, R9, R11 |
| 3 | SIZF906DT | Thruster_Controller:SIZF906DT | Q1, Q2, Q3 |
| 3 | TestPoint | Thruster_Controller:TestPoint_Pad_D1.0mm | TP1, TP2, TP3 |
| 2 | 0.047uF | Capacitors_SMD:C_0402 | C2, C4 |
| 2 | 10k | Resistors_SMD:R_0402 | R17, R18 |
| 2 | 10k | Resistors_SMD:R_0603 | R1, R6 |
| 2 | 15pF | Capacitors_SMD:C_0402 | C21, C22 |
| 2 | 330 | Resistors_SMD:R_0805 | R10, R19 |
| 2 | 680 | Resistors_SMD:R_0603 | R24, R31 |
| 2 | 820 | Resistors_SMD:R_0402 | R25, R26 |
| 2 | Conn_01x01 | Thruster_Controller:Bus_Pad | J7, J8 |
| 2 | Conn_01x01 | Thruster_Controller:CAN_Pad | J4, J6 |
| 2 | MountingHole | Thruster_Controller:MountingHole_M2 | H1, H2 |
| 2 | RED | LEDs:LED_0603 | D2, D4 |
| 1 | 100 | Resistors_SMD:R_0603 | R2 |
| 1 | 100k | Resistors_SMD:R_0402_NoSilk | R23 |
| 1 | 10uF | Capacitors_SMD:C_0805 | C49 |
| 1 | 120 | Resistors_SMD:R_0402 | R35 |
| 1 | 2.2uF | Capacitors_SMD:C_0603 | C19 |
| 1 | 2.2uH | Inductors_SMD:L_0805 | L1 |
| 1 | 2.7k | Resistors_SMD:R_0603 | R7 |
| 1 | 20MHz | Crystals:Crystal_SMD_SeikoEpson_TSX3225-4pin_3.2x2.5mm | Y1 |
| 1 | 22uF | Capacitors_SMD:C_0805 | C50 |
| 1 | 4.7uF | Capacitors_SMD:C_0603 | C1 |
| 1 | BLUE | LEDs:LED_0603 | D1 |
| 1 | DRV8305 | Thruster_Controller:DRV8305 | U1 |
| 1 | FB | Inductors_SMD:L_0402 | L3 |
| 1 | FB | Inductors_SMD:L_0805 | L2 |
| 1 | GREEN | LEDs:LED_0603 | D3 |
| 1 | MCP2515 | Housings_DFN_QFN:QFN-20-1EP_4x4mm_Pitch0.5mm | U3 |
| 1 | MCP2562 | Housings_DFN_QFN:DFN-8-1EP_3x3mm_Pitch0.65mm | U8 |
| 1 | Orange | LEDs:LED_0603 | D5 |
| 1 | PHASE_A | Thruster_Controller:Phase_Pad | J1 |
| 1 | PHASE_B | Thruster_Controller:Phase_Pad | J2 |
| 1 | PHASE_C | Thruster_Controller:Phase_Pad | J3 |
| 1 | Pogo Conn | Connectors:Tag-Connect_TC2050-IDC-NL | J5 |
| 1 | RTQ2569-50GQW | Housings_DFN_QFN:DFN-8-1EP_3x3mm_Pitch0.65mm | U2 |
| 1 | TMS320F28027F | Housings_QFP:LQFP-48_7x7mm_Pitch0.5mm | U5 |
| 1 | TPS62172DSGR | Thruster_Controller:8-Pin_WSON | U4 |
It measures 35.9 × 10.9 mm and has 4 copper layers, 1.6 mm thick.
110 parts, built around the TMS320F28027FPTT, MCP2562-H/P, MCP2515-I and RTQ2569-50GQW-QA. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the mark-belbin/motor-controller repository on GitHub, at the commit this page was made from: the board is hardware/Thruster_Controller/Thruster_Controller.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

mark-belbin/motor-controller
Custom FOC motor controller designed for underwater robotics.

mark-belbin/motor-controller
Custom FOC motor controller designed for underwater robotics.

mark-belbin/motor-controller
Custom FOC motor controller designed for underwater robotics.

mark-belbin/motor-controller
Custom FOC motor controller designed for underwater robotics.

mark-belbin/motor-controller
Custom FOC motor controller designed for underwater robotics.

mark-belbin/motor-controller
Custom FOC motor controller designed for underwater robotics.

buckles3636/EasyBLDC
Please ensure your designs meet common standards and include necessary documentation and comments.

Edgeberry/Edgeberry-HWCartridge-ConsoleCAN
An Edgeberry Hardware Cartridge with a CAN-bus interface and USB console access

austindriggs/urc-payload-pcb
All-purpose control and interface board designed to manage mission-critical sensors and electronics for University Rover Challenge at WVU.




team-mountaineers-urc-2023/electronics
Block diagrams, schematics, and PCB files related to the electronics subteam
