Skip to the content
2 layers24.7 × 31.7 mmAsac esc rev a, the printed circuit board in 3D

Asac esc rev a

victorhook/asac-esc8

asac esc is an open source ESC written in pure C.

Size
24.7 × 31.7 mm
Copper layers
2
Thickness
1.6 mm
Parts
54
Nets
43
Pads
266
Tracks, vias
378, 52
Pours
1
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
8 Jun 2023
Updated
25 Jul 2023

Overview

Asac esc rev a is an open-source printed circuit board by victorhook, from the victorhook/asac-esc repository on GitHub. It is a 2-layer board of 24.7 × 31.7 mm with 54 parts on 43 nets, routed with 378 tracks and 52 vias.

It is built around the XJNG2103, AMS1117-3.3 and 1N5819WS. Its parts include 19 capacitors, 16 resistors, 9 ICs, 5 diodes and 5 connectors. It belongs with the robots and motor control boards and the STM32 boards of this library.

Main components

3

README

README.md

asac esc

A Simple And Cool Electronic Speed Controller (asac esc) is an open source ESC, including both hardware and software. The firmware is written in pure C.

PCB Rev. A

First iteration of PCB is done. All cad files can be found in kicad/asac-esc-rev-a and the schematic as PDF can be found there, or in docs/asac-esc-rev-a.pdf.

PCB Rev.A front PCB Rev.A back

Workings of asac esc

Driving a brushless DC (bldc) motor is done by energizing one of the coils at the time which creates a magnetic field that makes the rotor move due to the magnets on it. Making the rotor move "1 step" is referred to as one commutation and making a bldc motor spin is not more complicated than energizing the different coils of the stator repeatedly. How fast a commutation takes will dictate how fast the motor will spin, thus controlling the speed of a bldc motor is done by controlling the speed of the commutations. This is accomplished by driving higher or lower amounts of current through the coils, which creates stronger or weaker magnetic fields, which in turn means that the commutation will be faster or slower.

Stator and rotor

Stator and rotor

Stator and rotor

Stator and rotor

Stator and rotor

6-step commutation

Most (perhaps all?) bldc motors has more than 3 coils, but some of the coils are wired together, so that we get only three wires out of the motor. We can call each of these wires a phase, A, B and C. The commutation sequence consists of 6 unique steps, which then repeats. During each of the 6 steps, one specific phase will get current running into it, and one phase will have current running out of it. Letting current into and out of a phase can be accomplished with the help of mosfets in half-bridge configurations, whereas it's needed with one half-bridge per phase, which means 6 mosfets in total. This way of driving a bldc is motor is referred to as 6-step commutation.

There are penty of good resources online that describes this process in much detail, such as here.

This image describes the 6 different states. It's slightly simplified, since a "1" doesn't really mean a logic high, nor 1 volt, but simply means that the phase allows current into it, whereas a "0" means that current runs out of the phase. The mosfets are not actually driven by 1s and 0s, but controlled using PWM, which is described in more detail below. The "Z" means that the phase is floating.

Phase values with bemf

Below is an example os the first 2 steps, whereas current runs into phase A and out of phase B, and then out of phase C in step 2.

Commutation state 1 - Current flows into phase A and out of B. State 1

Commutation state 2 - Current flows into phase A and out of C. State 2

And so forth for the steps 4-6...

BEMF closed-loop control

While it's possible to run a bldc motor without any feedback, it's only going to work at a constrained speed, since we have no indication of where the rotor is. If the position of the rotor is unknown, it's impossible to know exactly when to turn on a specific phase, and knowing when to do the next commutation can be accomplished by inspecting the back electromotive (bemf) force that is induced in the third ("unused") floating phase. In the schematic above you can see that each phase has a "VSENSE_X" connected to it through a voltage divider. This will be connected to an ADC on the microcontroller.

The bemf will follow (roughly) the pattern as described in the image below:

Phase values with bemf

Let's say that we're in step 3, where phase A have just been turned off and left floating. The voltage of the phase is still high, but will after some time go back to zero. The trick here is that we want to detect the middle point of this slope in order to schedule the next commutation. This "middle point" is referred to as zero cross. Note that the zero cross is not actually at 0, but the middle point between the highest voltage and zero, thus zero_cross = vmax / 2. For this to work we must know which commutation state we're in, since the slope of the bemf-values changes for each state (up/down). The bemf adc value is sampled on each update loop in order to detect when the bemf value crosses the zero cross.

Zero cross

Using bemf as input to know when to switch commutation step is referred to as running in closed-loop.

So how do we accomplish this in code? The mosfets that are connected to the high side of the half-bridges are turned on to allow current through, and the mosfets on the low side are driven low to allow current flow through them to ground. Note that the high-side mosfets are driven with a PWM signal which makes it possible to control how much current should flow through the coils. What frequency the PWM signal should have depends on the motor, but asac esc runs PWM on a frequency of 24 kHz (23437.5 Hz) with a duty resolution of 2048. Higher PWM will mean more current -> stronger magnetic field -> faster commutation.

Once a zero cross has been detected, the next commutation is scheduled to be performed in about half a commutation period from the detection. This commutation period time duration is taken from the last commutation period. Note that some delays such as update loop and filtering is subtracted, so in reality the next commutation is scheduled to be something like:

text
if (zero_cross_detected)
{
    next_commutation = now + half_commutation_period - filter_delay - update_delay
}
Start-up phase

An issue with using back-emf to know when to switch to the next commutation state is that before the motor is spinning we have no knowledge of where the rotor is. A solution to this problem is to start spinning the motor in open-loop mode, which means that the commutation states are traversed with a fixed period. During this time, the back-emf is still being looked at, to detect when we can switch to closed-loop. This is done if a zero-cross is detected, that seems to come in a "reasonable" time. By "reasonable" time, I mean that its detected roughly in the middle of a commutation period.

Input signal

asac esc supports standard input signals such as:

  • 50 Hz (1000-2000 us)

These are all in the form of a pulse, whereas the pulse length is directly proportional to the throttle value.

The pulses are detected by an interrupt on the pin.

Parts

54
QtyValueFootprintReferences
6100RResistor_SMD:R_0603_1608MetricR3, R4, R9, R10, R13, R14
61uCapacitor_SMD:C_0402_1005MetricC2, C5, C12, C13, C16, C17
41kResistor_SMD:R_0402_1005MetricR2, R6, R12, R16
3100nCapacitor_SMD:C_0402_1005MetricC7, C9, C10
310nCapacitor_SMD:C_0402_1005MetricC4, C15, C19
31N5819WSDiode_SMD:D_SOD-323D3, D4, D5
347uCapacitor_SMD:C_1206_3216MetricC8, C14, C18
34k7Resistor_SMD:R_0402_1005MetricR1, R11, R15
3ASDM30DN40E-R, DUAL MOSFETCustom:PDFN3333-8_L3.2-W3.1-P0.65-LS3.4-BLU4, U7, U9
3XJNG2103Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU2, U6, U8
210uCapacitor_SMD:C_0805_2012MetricC1, C3
2330RResistor_SMD:R_0402_1005MetricR7, R8
2Conn_01x02_RESETCustom:PinHeader_1x02_P2.54mm_Vertical_No_silkJ1, J4
2LEDCustom:LED_0603_no_outlineD1, D2
11nCapacitor_SMD:C_0402_1005MetricC11
12mResistor_SMD:R_2512_6332MetricR5
14.7uCapacitor_SMD:C_0603_1608MetricC6
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U1
1Conn_01x03Custom:PinSocket_1x03_P2.54mm_Vertical_No_silkJ14
1Conn_01x03Custom:Conn_01x03_BLDCJ2
1INA180A3Package_TO_SOT_SMD:SOT-23-5U5
1MotorCustom:Conn_01x03_BLDCJ3
1STM32C011F6PxPackage_SO:TSSOP-20_4.4x6.5mm_P0.65mmU3

Similar boards

  • 2 layers100 × 100 mmDc brushed motor driver, the printed circuit board in 3D

    Dc brushed motor driver

    DsThakurRawat/PCB-AND-CHIP-DESIGN-WITH-AIML

    All production files have been generated in manufacturing/: - Gerber Layers (RS-274X): Copper, solder masks, silkscreen, and board edge cuts (manufacturing/gerbers/) - Excellon Drill Files: Plated and non-plated drill…

    122 parts
  • 4 layersMagneticLevitation, the printed circuit board in 3D

    MagneticLevitation

    dweggg/MagneticLevitation

    My take on one of those active magnetic levitation projects.

    149 parts
  • 2 layers45 × 45 mmAeroq Hardware v3, the printed circuit board in 3D

    Aeroq Hardware v3

    EnriqueNeyra/Aeroq

    An Indoor Air Quality Monitor Powered by ESP32, SCD40, and SEN54

    56 parts130
  • 4 layers101.6 × 53.3 mmZ80ctrlng, the printed circuit board in 3D

    Z80ctrlng

    jblang/z80ctrl

    AVR-based bootloader, I/O, and debugging for Z80-based computers

    65 parts73
  • 4 layers100 × 68 mmDevKit, the printed circuit board in 3D

    DevKit

    kaminaris/GigaESC

    209 parts47
  • 2 layers54.2 × 75.2 mmKiCAD Design, the printed circuit board in 3D

    KiCAD Design

    Brobiwann/ESP-spider

    The ESP-Spider is a quadruped robot inspired by the miniKame (https://github.com/JavierIH/miniKame) . Like the miniKame, it uses sinusoidal functions to control servo positions, but the design and code were developed…

    70 parts44
  • 4 layers170.2 × 170.2 mmNvme Carrier all M2, the printed circuit board in 3D

    Nvme Carrier all M2

    El-Luhb/nvme-Carrier-for-LattePanda-Mu

    nvme Carrier PCB for the LattePanda Mu compute module

    400 parts12MIT
  • 4 layers57 × 56 mmIot led strip pcb, the printed circuit board in 3D

    Iot led strip pcb

    0xjmux/iot_leddriver_hw

    ESP32-based WS2812B LED Strip Driver PCB, designed for music visualization

    85 parts9

Questions

How big is the Asac esc rev a PCB?

It measures 24.7 × 31.7 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Asac esc rev a use?

54 parts, built around the XJNG2103, AMS1117-3.3 and 1N5819WS. 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.

Where can I download the Asac esc rev a KiCad files?

From the victorhook/asac-esc repository on GitHub, at the commit this page was made from: the board is kicad/asac-esc-rev-a/asac-esc-rev-a.kicad_pcb and its schematic kicad/asac-esc-rev-a/asac-esc-rev-a.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Asac esc rev a design in my own project?

Its repository states no licence, so its author keeps all rights: ask victorhook before reusing the design.