bldc_hall3 − 3-wire Bipolar trapezoidal commutation BLDC motor driver using Hall sensors
loadrt bldc_hall3 [count=N|names=name1[,name2...]] |
This component produces a 3-wire bipolar output. This suits upstream drivers that interpret a negative input as a low-side drive and positive as a high-side drive. This includes the Hostmot2 3pwmgen function, which is likely to be the most common application of this component.
bldc-hall3.N (requires a floating-point thread)
Interpret Hall sensor patterns and set 3-phase amplitudes
bldc-hall3.N.hall1 bit in
Hall sensor signal 1
bldc-hall3.N.hall2 bit in
Hall sensor signal 2
bldc-hall3.N.hall3 bit in
Hall sensor signal 3
bldc-hall3.N.value float in
PWM master amplitude input
bldc-hall3.N.dir bit in
Forwards / reverse selection. Negative PWM amplitudes will also reverse the motor and there will generally be a pattern that runs the motor in each direction too.
bldc-hall3.N.A-value float out
Output amplitude for phase A
bldc-hall3.N.B-value float out
Output amplitude for phase B
bldc-hall3.N.C-value float out
Output amplitude for phase C
bldc-hall3.N.pattern u32 rw (default: 25)
Commutation pattern to use, from 0 to 47. Default is type 25. Every plausible combination is included. The table shows the excitation pattern along the top, and the pattern code on the left hand side. The table entries are the hall patterns in H1, H2, H3 order. Common patterns are: 0 (30 degree commutation) and 26, its reverse. 17 (120 degree). 18 (alternate 60 degree). 21 (300 degree, Bodine). 22 (240 degree). 25 (60 degree commutation).
Note that a number of incorrect commutations will have non-zero net torque which might look as if they work, but don’t really.
If your motor lacks documentation it might be worth trying every pattern.
Phases, Source - Sink | ||||||
---|---|---|---|---|---|---|
pat | B-A | C-A | C-B | A-B | A-C | B-C |
0 | 000 | 001 | 011 | 111 | 110 | 100 |
1 | 001 | 000 | 010 | 110 | 111 | 101 |
2 | 000 | 010 | 011 | 111 | 101 | 100 |
3 | 001 | 011 | 010 | 110 | 100 | 101 |
4 | 010 | 011 | 001 | 101 | 100 | 110 |
5 | 011 | 010 | 000 | 100 | 101 | 111 |
6 | 010 | 000 | 001 | 101 | 111 | 110 |
7 | 011 | 001 | 000 | 100 | 110 | 111 |
8 | 000 | 001 | 101 | 111 | 110 | 010 |
9 | 001 | 000 | 100 | 110 | 111 | 011 |
10 | 000 | 010 | 110 | 111 | 101 | 001 |
11 | 001 | 011 | 111 | 110 | 100 | 000 |
12 | 010 | 011 | 111 | 101 | 100 | 000 |
13 | 011 | 010 | 110 | 100 | 101 | 001 |
14 | 010 | 000 | 100 | 101 | 111 | 011 |
15 | 011 | 001 | 101 | 100 | 110 | 010 |
16 | 000 | 100 | 101 | 111 | 011 | 010 |
17 | 001 | 101 | 100 | 110 | 010 | 011 |
18 | 000 | 100 | 110 | 111 | 011 | 001 |
19 | 001 | 101 | 111 | 110 | 010 | 000 |
20 | 010 | 110 | 111 | 101 | 001 | 000 |
21 | 011 | 111 | 110 | 100 | 000 | 001 |
22 | 010 | 110 | 100 | 101 | 001 | 011 |
23 | 011 | 111 | 101 | 100 | 000 | 010 |
24 | 100 | 101 | 111 | 011 | 010 | 000 |
25 | 101 | 100 | 110 | 010 | 011 | 001 |
26 | 100 | 110 | 111 | 011 | 001 | 000 |
27 | 101 | 111 | 110 | 010 | 000 | 001 |
28 | 110 | 111 | 101 | 001 | 000 | 010 |
29 | 111 | 110 | 100 | 000 | 001 | 011 |
30 | 110 | 100 | 101 | 001 | 011 | 010 |
31 | 111 | 101 | 100 | 000 | 010 | 011 |
32 | 100 | 101 | 001 | 011 | 010 | 110 |
33 | 101 | 100 | 000 | 010 | 011 | 111 |
34 | 100 | 110 | 010 | 011 | 001 | 101 |
35 | 101 | 111 | 011 | 010 | 000 | 100 |
36 | 110 | 111 | 011 | 001 | 000 | 100 |
37 | 111 | 110 | 010 | 000 | 001 | 101 |
38 | 110 | 100 | 000 | 001 | 011 | 111 |
39 | 111 | 101 | 001 | 000 | 010 | 110 |
40 | 100 | 000 | 001 | 011 | 111 | 110 |
41 | 101 | 001 | 000 | 010 | 110 | 111 |
42 | 100 | 000 | 010 | 011 | 111 | 101 |
43 | 101 | 001 | 011 | 010 | 110 | 100 |
44 | 110 | 010 | 011 | 001 | 101 | 100 |
45 | 111 | 011 | 010 | 000 | 100 | 101 |
46 | 110 | 010 | 000 | 001 | 101 | 111 |
47 | 111 | 011 | 001 | 000 | 100 | 110 |
bldc_hall6 6-wire unipolar driver for BLDC motors.
Andy Pugh
GPL