Commit 6677e048 authored by Jake Read's avatar Jake Read

new hardware is new

parent 788e2ee5
......@@ -4,9 +4,9 @@
The MMKBLDC Project is my attempt at building a decent controller for Brushless Motors. BLDCs are excellent sources of mechatronic actuation: they're [power dense](https://jakeread.pages.cba.mit.edu/actuators/) and serve the motion control justice present in most state of the art robotics. However, controlling them is non-trivial, and requires the combination of some EE expertise, some control expertise, and some hardware know-how.
![board](/images/fab-front.jpg)
![board](/images/routed.png)
![schematic](/images/fab-back.jpg)
![schematic](/images/schematic.png)
## Why
......
......@@ -18,18 +18,42 @@ This perhaps means I need to run that SPI cable with a differential driver, to b
## Notes
- label lights
- wants one lo-side debug pin!
- for resets etc, pull en to gnd on other side of switch!
- wants spi debug pins
- wants more gnd pins, for scope, gnd pins to be not beside 3v3
- might have to go to DRV8320 - newer, available
- CSD88548 is CSD88599 but more amps less volts, use these
- use RDT RTD for temp - 223-1563-1-ND
- phy RS422 and bring back buck
- do 24v fan 40mm on M3 Terminals! silk lands for heatsink 1.1" square
- body diode? https://www.youtube.com/watch?v=uqzOQGiwGnE or pwm sigs to freewheel? check deadtime?
Fan
- 1053-1210-ND
- 1053-1375-ND
\ No newline at end of file
- 1053-1375-ND
# BOM
1nF
22nF
0.1uF
1uF
2.2uF
10uF
2R2
100R
470R
5K6
10k
39K
Resonator
10uH 0805
LED Y,G,B
DIODE 0805
RTD
SHNT 2520
PWRPAD
2x3 6PIN
RJ45
SLIDE SWITCH
RST BUTTON
XMEGA
DRV8302
FET
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -8,6 +8,8 @@ Desktop="Desktop"
AutoSaveProject=1
UsedLibraryUrn="urn:adsk.eagle:library:217"
UsedLibraryUrn="urn:adsk.eagle:library:325"
UsedLibraryUrn="urn:adsk.eagle:library:371"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/comm.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/connector.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/fab.lbr"
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/lights.lbr"
......@@ -23,17 +25,17 @@ UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries_jake/eagle/marekr/borkedlab
UsedLibrary="D:/Dropbox (Personal)/CBA/doc/libraries_jake/eagle/sparkfun/SparkFun-DiscreteSemi.lbr"
[Win_1]
Type="Schematic Editor"
Number=3
File="atkbldcdriver.sch"
View="-191.424 46.8832 11.2038 138.852"
WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.2032 0.254 0.3048 0.4064 0.508 0.6096 0.8128 1.016 1.27 2.54 0.1524"
Type="Library Editor"
Number=2
File="D:/Dropbox (Personal)/CBA/doc/libraries/eagle/power.lbr"
View="-4.8143 -9.77493 4.96211 9.82573"
WireWidths=" 0.0762 0.1016 0.15 0.2 0.2032 0.3048 0.4064 0.508 0.6096 0.8128 1.016 1.27 2.54 0.1524 0.254 0.127"
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
PadDrills=" 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6"
ViaDiameters=" 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2 1.3 0"
ViaDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
HoleDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778 1.27"
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
......@@ -43,9 +45,9 @@ DimensionExtLengths=" 1.27 2.54 1 2 3 0"
DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
WireBend=0
WireBendSet=31
WireBendSet=0
WireCap=1
MiterStyle=0
MiterStyle=1
PadShape=0
ViaShape=1
PolygonPour=0
......@@ -64,20 +66,19 @@ SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=91
Views=" 1: -191.424 46.8832 11.2038 138.852"
Sheet="1"
Layer=21
Package="HTSSOP-56"
[Win_2]
Type="Board Editor"
Number=1
File="atkbldcdriver.brd"
View="45.5333 30.9446 77.9146 57.9135"
WireWidths=" 0.0762 0.127 0.15 0.508 0.6096 0.8128 2.54 1.016 1.27 0.3048 0.254 0.2 0.4064 0.1016 0.2032 0.1524"
View="-15.1007 14.1863 109.925 37.5249"
WireWidths=" 0.127 0.15 0.6096 2.54 1.27 0.3048 0.254 0.2 0.1016 1.016 0.508 0.4064 0.2032 0.8128 0.0762 0.1524"
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
PadDrills=" 0.2 0.25 0.35 0.4 0.45 0.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6 0.3"
ViaDiameters=" 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2 1.3 0"
ViaDrills=" 0.2 0.4 0.45 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.5 0.25 0.35 0.3"
ViaDrills=" 0.2 0.4 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.5 0.25 0.35 0.45 0.3"
HoleDrills=" 0.2 0.25 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35 0.3"
TextSizes=" 0.254 0.3048 0.4064 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778 0.6096"
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
......@@ -113,6 +114,52 @@ PadsSameType=0
Layer=1
[Win_3]
Type="Schematic Editor"
Number=3
File="atkbldcdriver.sch"
View="-343.782 -295.52 910.832 273.925"
WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.2032 0.254 0.3048 0.4064 0.508 0.6096 0.8128 1.016 1.27 2.54 0.1524"
PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
PadDrills=" 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6"
ViaDiameters=" 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2 1.3 0"
ViaDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
HoleDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
DimensionWidths=" 0 0.127 0.254 0.1 0.26 0.13"
DimensionExtWidths=" 0.127 0.254 0.1 0.13 0.26 0"
DimensionExtLengths=" 1.27 2.54 1 2 3 0"
DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
WireBend=0
WireBendSet=31
WireCap=1
MiterStyle=0
PadShape=0
ViaShape=1
PolygonPour=0
PolygonRank=0
PolygonThermals=1
PolygonOrphans=0
TextRatio=8
DimensionUnit=1
DimensionPrecision=2
DimensionShowUnit=0
PinDirection=3
PinFunction=0
PinLength=2
PinVisible=3
SwapLevel=0
ArcDirection=0
AddLevel=2
PadsSameType=0
Layer=97
Views=" 1: -343.782 -295.52 910.832 273.925"
Sheet="1"
[Win_4]
Type="Control Panel"
Number=0
......@@ -121,3 +168,4 @@ Screen="3840 1080"
Window="Win_1"
Window="Win_2"
Window="Win_3"
Window="Win_4"
......@@ -108,6 +108,13 @@ And the board,
In each of these boards, we find a microcontroller, a gate driver, three half-bridges (6 MOSFETS), and current and voltage sensing circuitry. And a few BFCs never hurt.
#### Traps!
- gate drivers
- inductance, pwm, body diodes / freewheeling
- current measurement
- pwm frequency
#### Typically Available:
For motors, I am deeply in love with [Hobbyking](https://hobbyking.com/en_us/power-systems-1/electric-motors/size.html).
......@@ -128,7 +135,7 @@ To control these, look [here](https://hobbyking.com/en_us/power-systems-1/speed-
The design of BLDCs is not changing radically - it's a good idea, and it works.
**There is one exception to this** - [Thingap Motors](http://www.thingap.com/) use an ironless winding [(patent here)](https://www.google.com/patents/US20130300241) and have relatively high torque densities. The [performance is impressive](http://www.thingap.com/standard-products/) but they cost ~1k at the low end.
**There is one exception to this** - [Thingap Motors](http://www.thingap.com/) use an ironless winding [(patent here)](https://www.google.com/patents/US20130300241) and have relatively high torque densities. The [performance is impressive](http://www.thingap.com/standard-products/) but they cost ~ 1k at the low end.
What is interesting is where BLDCs are being used, controlled, and how they are being designed (shape, new densities). Take a look at [The Biomimetics Lab at MIT's](http://biomimetics.mit.edu/research/optimal-actuator-design) discussion on optimizing gap radius, etc.
......
......@@ -34,4 +34,8 @@ I know I can do this if I can manage to read my encoder successfully. I could al
So, we use a logic analyzer to try reading this AMS5047
Got this running, feels pretty mediocre. I need to understand commutation a bit better, and do this with a fan setup etc. I perhaps just have not counted my poles properly, but I wamt to do this with an oscilloscope, and understand how we might search for those offsets etc.
\ No newline at end of file
Got this running, feels pretty mediocre. I need to understand commutation a bit better, and do this with a fan setup etc. I perhaps just have not counted my poles properly, but I want to do this with an oscilloscope, and understand how we might search for those offsets etc.
# Notes
- read shane colton's pdf on sensorless field oriented control, and his park-transform free FOC solution: sounds cool. finish phase search algorithm.
\ No newline at end of file
......@@ -110,6 +110,23 @@ void pwm_by_sin_duty(uint16_t phase, float duty){
pwm_periods(peru, perv, perw);
}
uint16_t readings[20];
uint8_t readIndex = 0;
void putReading(uint16_t reading){
readings[readIndex] = reading;
readIndex ++;
}
void getReadAverage(uint16_t &avg){
uint8_t numReads = readIndex; // sloppy, but makes this interrupt safe
uint32_t readSum = 0;
for(uint8_t i = 0; i < numReads; i ++){
readSum += readings[i];
}
*avg = readSum / numReads;
}
void pwm_init(void){
// setup awex etc
......@@ -183,10 +200,8 @@ void tickers_init(void){
// set cca interrupt on
TCD0.INTCTRLA = TC_OVFINTLVL_HI_gc;
/*
// and a reasonable speed for acceleration ticking
uint16_t perAccelRate = 800;
// this ticker for search
uint16_t perAccelRate = 2048;
uint8_t perAl = (uint8_t) perAccelRate;
uint8_t perAh = (uint8_t) (perAccelRate >> 8);
......@@ -196,7 +211,6 @@ void tickers_init(void){
TCD1.PERBUFH = perAh;
TCD1.INTCTRLA = TC_OVFINTLVL_HI_gc;
*/
}
int main(void)
......@@ -260,7 +274,18 @@ ISR(TCD0_OVF_vect){
phase_target = (enc_resolution + enc_reading + enc_offset + pi_enc) % twoPi_enc;
// we need to compute the respective pwm positions given the phase target
pwm_by_sin_duty(phase_target, 0.04);
pwm_by_sin_duty(phase_target, 0.05);
}
static uint16_t lastRead = 0;
static uint16_t thisRead;
ISR(TCD1_OVF_vect){
// search timer
// get new pos: whoop, average speeds, derive from sequence!
getReadAverage(&thisRead);
}
ISR(USARTE1_RXC_vect){
......
images/routed.png

617 KB | W: | H:

images/routed.png

860 KB | W: | H:

images/routed.png
images/routed.png
images/routed.png
images/routed.png
  • 2-up
  • Swipe
  • Onion skin
images/schematic.png

280 KB | W: | H:

images/schematic.png

338 KB | W: | H:

images/schematic.png
images/schematic.png
images/schematic.png
images/schematic.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment