owned this note
owned this note
Published
Linked with GitHub
# Vintage V1 - A3941 Brushed DC motor develope log
###### tags: `motor`
[TOC]
## Prior Knowledge
### Current Recirculation and Decay Modes
[Application report from TI](https://www.ti.com/lit/an/slva321a/slva321a.pdf?ts=1667199277299&ref_url=https%253A%252F%252Fwww.google.com%252F)
#### Introduction

Because of the inductive loads, it'll maintain a voltage as soon as the H-bridge is disabled. It will cause a damage to switch circuit if the voltage decays to zero or switches to other direction. A proper way to avoid this problem is using the freewheeling diode(飛輪二極體), which is parallel with the FET.

These alternatives to control current flow is called current recirulation methods.
#### Asychronus decay
## BOM
| ID | Name | Designator | Footprint | Quantity |
| ------ | -------------------- | ------------------- | ---------------------------------------------------- | -------- |
| ~~1~~ | 1uF | C1,C2,C5,C8 | C0603 | 4 |
| ~~2~~ | 4.7uF | C3,C9 | C0603 | 2 |
| ~~3~~ | 0.47uF | C4 | C0603 | 1 |
| ~~4~~ | 50pF | C6,C17 | C0603 | 2 |
| ~~5~~ | 220uF | C7 | CAP-TH\_BD8.0-P3.50-D0.6-FD | 1 |
| ~~6~~ | 0.1uF | C10,C11,C16,C18,C19 | C0603 | 5 |
| ~~7~~ | 10nF | C12 | C0603 | 1 |
| ~~8~~ | 1nF | C13,C14,C15 | C0603 | 3 |
| ~~9~~ | L1206 | L1 | L1206 | 1 |
| ~~10~~ | LED-0603\_R | LED1,LED2 | LED0603\_RED | 2 |
| *11* | DC Motor | M1 | KF350-2P-3.5MM | 1 |
| ~~12~~ | KF350-3.5-4P | P1 | CONN-TH\_3P-P3.50\_KF350-3.5-4P | 1 |
| *13* | IPD036N04LG | Q1,Q2,Q3,Q4 | TO-252-2\_L6.6-W6.1-P4.58-LS9.9-BR | 4 |
| **14** | S8050M-D | Q5,Q6 | SOT-523\_L1.6-W0.8-P1.00-LS1.6-BR | 2 |
| ~~15~~ | 47Ω | R1,R2,R3,R4 | R0603 | 4 |
| ~~16~~ | 47kΩ | R5,R7,R9,R12 | R0603 | 4 |
| ~~17~~ | 20kΩ | R6 | R0603 | 1 |
| ~~18~~ | 4.7kΩ | R8 | R0603 | 1 |
| ~~19~~ | 250Ω | R10,R11 | R0603 | 2 |
| ~~20~~ | 2kΩ | R13,R14,R19,R20,R23 | R0603 | 5 |
| ~~21~~ | 150Ω | R16,R17 | R0603 | 2 |
| ~~22~~ | 100Ω | R21,R22 | R0603 | 2 |
| ~~23~~ | 3kΩ | R24 | R0603 | 1 |
| ~~24~~ | 15.9kΩ(16kΩ) | R25,R26 | R0603 | 2 |
| ~~25~~ | 0Ω | R27,R28 | R0603 | 2 |
| *26* | A3941KLPTR-T | U1 | TSSOP-28\_L9.7-W4.4-P0.65-LS6.4-BL-EP | 1 |
| *27* | HCPL0534\_fault | U2 | SOIC-8\_L5.0-W4.0-P1.27-LS6.0-BL | 1 |
| *28* | HCPL0534\_crtl | U3 | SOIC-8\_L5.0-W4.0-P1.27-LS6.0-BL | 1 |
| **29** | LMV822MM/NOPB | U4 | VSSOP-8\_L3.0-W3.0-P0.65-LS5.0-BL | 1 |
| *30* | ACS70331EESATR-005B3 | U5 | POWERWFQFN-12\_L3.0-W3.0-P0.50-TL\_ALLEGRO\_ACS70331 | 1 |
| *31* | ACS70331EOLCTR-005U3 | U6 | SOIC-8\_L5.0-W4.0-P1.27-LS6.0-BL | 1 |
| *32* | S-1142B50I-E6T1U | U7 | HSOP-6\_L5.0-W3.9-P1.91-LS6.0-BL | 1 |
| ~~33~~ | HEADER8 | U8 | CONN-TH\_8P-P2.54\_XH2.54-8P | 1 |
## Schematics
{%pdf https://docdro.id/EpNs7ZL %}
### Optocoupler
- $I_F = 16mA$ , and the typical $V_F = 1.45V$, therefore $R_m = 115.625\Omega$, I use $150\Omega$ for redundency.

## Log
### 2022/10/15
- Board production finished
- [debug[001]](https://hackmd.io/H5PwSWw6ShyB9tXiwNff5Q?both#20221015-002)
### 2022/10/16
- 1st debug test
- [debug[002]](https://hackmd.io/H5PwSWw6ShyB9tXiwNff5Q?both#20221015-002)
### 2022/10/23
- 2nd debug test
- [debug[003]](https://hackmd.io/H5PwSWw6ShyB9tXiwNff5Q?both#20221015-003)
### 2022/10/24
- 3rd debug test
- [debug[004]](https://hackmd.io/H5PwSWw6ShyB9tXiwNff5Q?both#20221015-004)
### 2022/10/31
- 4th debug test
- [debug[005]](https://hackmd.io/H5PwSWw6ShyB9tXiwNff5Q?both#20221015-005)
- 1st control test
- [development[001]](https://hackmd.io/H5PwSWw6ShyB9tXiwNff5Q?both#20221031-001)
### 2022/11/01
- 2nd control test
- [development[002]](https://hackmd.io/H5PwSWw6ShyB9tXiwNff5Q?both#20221101-002)
## Debug
### 2022/10/15 [001]
1. Failed to solder LMV822 chip onto the board due to the mismatch of the ic package. The onboard package is using VSSOP-8 but the exsiting one is SOP-8.
- I jumped wiring the SOP-8 to VSSOP-8 for now.
### 2022/10/16 [002]
1. Failed to turn on the gate driver A3941. Because of the wrong connection of PWM, DIR input to the optocoupler.
- The PWM and DIR connection should be opposite.

2. MOSFET keeps heating up with no reason while the PWM duty cycle isn't 100%. The higher the input voltage the higher the heat.
- My first guest was the wiring width, so I removed the top silk screen and put more solder onto the wire. It didn't help much.
- Then I jumped wiring the MOSFET gate input wire, still the same.
- I removed the original 220uF capacitor and changed it to two 100uF capacitors, and joined their anode and cathode to the input voltage pin directly. The problem remained.

### 2022/10/23 [003]
1. Continue to the [002-1] problem.
- Since the layout problem seemed not to be the cause of this phenomenon, my second guess was the inconsistency of PWM input signal.
- I used 30v input voltage and 90% PWM input, the old driver worked perfectly without any heat up issue.
- I tested the PWM signal from optocoupler, and it seemed OK for the output wave form.
 
### 2022/10/24 [004]
1. Continue to the [003-1] problem.
- Since there was no odd sign of PWM signal, I had no choice but to directly test the MOSFET gate voltage.
- I noticed that the heat was generated by one of the low side MOSFET, so my third guess was the MOSFET is shorted. And here is the result.
 
- It seems that the switch was nominal, there was no short sign. However, if we zoom in the cross over area, we can see the interesection of two voltage, so called the dead zone.
 
- We can see that the dead zone time was 400ns and the noise cannot to be ignored. During this time, the MOSFET was shorted to ground, and directly causing a huge current flow through it. This is the source of heat.
- The pictures below is the nominal dead zone width should be.
 
- We can see the left picture, the dead zone is almost shrinking to a point. Although after zooming in the wave, the width is 720ns larger than the subnormal one, the A->Y is only 1.6V, compare to the subnormal one which is 10v. No wander there is no heat in this circuit.
2. The dead zone is too wide.
- From datasheet we can see the dead time adjust resistor called $R_{DEAD}$.

- I use $47k\Omega$ for $R_{DEAD}$, so the $t_{DEAD}$ should rest between 815ns to 2us. However, there was no different between the nominal one and subnormal one. It makes no sence why there were the huge difference in dead time.
- My fourth guess is the layout problem, due to the high frequency interference. But it is too hard for me to fix the problem, so I decided to change the gate driver to give it a try. I changed a used A3941 to a new one. Here's the result.
 
- The dead time was reduced to 312ns, the peak of A-Y was 5.76v. Although A-Y is still a little bit high, due to the shorter dead time, the overall heat waste was negligible.
### 2022/10/31 [005]
1. Heat produced by LDO
- Because of the current drawed by fault optocoupler, the two channels of LED inside optocoupler will consume 32mA. And the power dissipation is the source of the heat, therefore, I lower the current goes through the optocoupler by increasing the resistors from $220\Omega$ to $2k\Omega$.
 $\rightarrow$ 
- However, the decrease of current causing the lack triggering voltage of transistor for the fault LED. So, I changed the $2k\Omega$ pull up resistor to $20k\Omega$. The problem was solved.
 $\rightarrow$ 
2. Reverse polarity of output causing FF2 being low
- FF2 being low means three possible issue.

- The reason why FF2 was detected to be HIGH is because the damage of GHA R3 resistor. It works fine after the replacement.
## Development
### 2022/10/31 [001]
1. Calibration of current sensor
| location | Current | Voltage |
| ------------ | ------- | ------- |
| mid-point | 0A | 1.33v |
| top-point | 2A | 1.55v |
| bottom-point | -2A | 1.13v |
### 2022/11/01 [002]
#### PID current control
1. gain value
```
Kp: 1000
Ki: 50000
output: -3600~3600
sampling freq.: 20kHz
Vin: 18v
```
2. step response
1. **0~0.1A step response**

2. **0~0.2A step response**

3. **-0.2~0.2A step response**

4. **0~ 1.0~-1.0A step response**

3. footage
### 2023/06/27 [003]
1. Shortage of some parts
- resistor
- [x] 470Ω R0603 x50
- [ ] 10mΩ R1206 x50
- [x] 47Ω R0603 x100
- [x] 47kΩ R0603 x100
- [x] 20kΩ R0603 x0
- [x] 4.7kΩ R0603 x0
- [x] 2kΩ R0603 x150
- [x] 150Ω R0603 x50
- [x] 100Ω R0603 x50
- [x] 3kΩ R0603 x0
- [x] 16kΩ R0603 x50
- [x] 0Ω R0603 x0
- capacitor
- [x] 220uF BD8.0xP3.5 x30
- [x] 100F C0603 x0
- [x] 1uF C0603 x50
- [x] 4.7uF C0603 x50
- [x] 50pF C0603 x50
- [x] 470nF C0603 x0
- [x] 10nF C0603 x0
- [x] 1nF C0603 x50
- [x] 磁珠 L1206 x0
- IC
- [x] INA240A TSSOP-8 x30
- [x] A3941 TSSOP-28 x0
- [x] HCPL0534 SOIC-8 x60
- [x] LMV822 SOIC-8 x30
- [x] S1142B HSOP-6 x30
- active
- [x] IPD036N04N TO-252 x120
- [x] S8050 SOT-523 x60(掏寶)
- [x] 1N4001 SOD-323 x120
- [x] ZM4728A LL-41 x30
- [x] LED-R C0603 x50
- [x] LED-G C0603 x50
- connector
- [x] KF350-3.5-2P x60
- [x] XH2.54-8P x20
## Handover
### 2023/06/27
- Teach 庭嘉、紅瑋、柏安 how to build one.