DIY Brushed ESC - Assembly Thread

Lightweight / Folding / Portable EVs - seats optional

DIY Brushed ESC - Assembly Thread

Postby S.B.D » Tue Jan 10, 2012 5:13 pm

Hi,

Some 3-4 month ago my friend and I decided to boost our GoPeds to an 8S configuration. Knowing that the stock ESC will not work with this configuration we decided to take on the challenge and build our own ESC.
Took us a couple of weeks and several beers to understand where we wanted to go with this. We knew we wanted a fully programmable ESC that we can easily play with all its parameters.
We wanted control of the low voltage cutoff, throttle endpoints, throttle response, current limit and some form of safety mechanism in case one of the MOSFETs burn to a short circuit and the motor will start to run uncontrollably.

My friend took the job of writing the firmware and PC configuration utility - I took the electronic design and PCB editing.
After building an initial prototype we went on to layout this PCB. The PCB is a four layer design that gave us a lot of copper for the high current traces (2oz copper on external layers, 3oz copper on internal layers).
After finishing the long job of editing this board, I made a 10 piece panel before sending it to the manufacturer.

Luckily, today I received both the PCB from China and the components from Digikey.
I will start assembly tomorrow (can't solder SMT components at this late hour ...) and document my progress as I go.

S.B.D
Attachments
Order.jpg
PCB Panel & Components
(244.29 KiB) Downloaded 3 times
CS.jpg
PCB Component Side
PS.jpg
PCB Print Side
S.B.D
100 mW
100 mW
 
Posts: 48
Joined: Thu Dec 29, 2011 1:59 pm

Re: DIY Brushed ESC - Assembly Thread

Postby amberwolf » Wed Jan 11, 2012 3:40 am

Definitely interested in how this goes, and also in it's design, if you're willing to share that. (especially on how you arrived at the final design, including missteps and eureka moments. :) )
House Fire Updates Thread


Got a question that isn't personal or private? Post it in the forums, don't PM it. ;)

Wiki your techy info so it doesn't get old, lost and icky:
http://endless-sphere.com/w


Full-Suspension Semi Recumbent Cargo Bike - NuVinci MidDrive
Semi-Recumbent Recycled-Parts Cargo eBike: "CrazyBike2"
DayGlo Avenger, MkII
User avatar
amberwolf
100 GW
100 GW
 
Posts: 13729
Joined: Mon Aug 17, 2009 6:43 am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group

Re: DIY Brushed ESC - Assembly Thread

Postby S.B.D » Wed Jan 11, 2012 7:12 am

Hi Amberwolf,

I will give detailed explanations as I progress through the assembly on each part I place on the board. We did run into two problems that took us some time to solve.
The first was a very strange behavior of the current amplifier (turned out to be two different issues), and the second was that the ESC "Mode" switch did not work properly (switch to change from a more sporty mode to a calm mode). Both solved after hours of tests and voodo... :D
Other than that we had the regular iterations when designing something.
One such iteration was to come up with the best amount of MOSFETs for our use.
The trade off was between dividing the current through more MOSFETS (less DC losses) but increasing the total gate capacitance and increasing switching losses.
We had a problem that for some reason during the code development we ran out of RAM in the MCU, but we used only a small portion of it - Fixed by reading the compiler manual :D .

One more thing that took a lot of time was to find a different mounting method for the MOSFETs for easy installation in an aluminum enclosure.

I'll continue tonight...

S.B.D
S.B.D
100 mW
100 mW
 
Posts: 48
Joined: Thu Dec 29, 2011 1:59 pm

Re: DIY Brushed ESC - Assembly Thread

Postby grindz145 » Wed Jan 11, 2012 8:33 am

Cool, what do you expect the design current to be?
http://www.endless-sphere.com/forums/viewtopic.php?f=18&t=19548 - Ebike Nerd Podcast
Thanks to Justin @ ebikes.ca! Go there, buy stuff. Support the Revolution :D
User avatar
grindz145
100 MW
100 MW
 
Posts: 2673
Joined: Tue Apr 07, 2009 12:10 pm
Location: Rochester NY

Re: DIY Brushed ESC - Assembly Thread

Postby S.B.D » Wed Jan 11, 2012 9:28 am

Our first prototype was limited to 80A but we tested it up to 120A during acceleration. Cruise speed is 42km/h at about 30A.
Current setup is 11 teeth on the motor and 82 teeth on the wheel. With 13 teeth my friend reached dangerous speeds.
The ESC's aluminum case is connected to the GoPed's chassis, and even with no thermal grease or thermal pad in between it serves as an "infinite" heat sink
and everything stays pleasant to the touch.
S.B.D
100 mW
100 mW
 
Posts: 48
Joined: Thu Dec 29, 2011 1:59 pm

Re: DIY Brushed ESC - Assembly Thread

Postby S.B.D » Wed Jan 11, 2012 3:47 pm

Hi,
Started assembling the board tonight. I decided to build 2 boards so I 'll have some form of comparison when something doesn't work... :D
First I placed the three ICs and the micro USB connector.

First IC is the PIC18 microcontroller that manages the system. It is the hardest to solder as it comes in a TSSOP fine pitch package. My eyes and hands are still pretty steady and I still manage to solder these parts with little problem. This little Micro has built in USB that we use to upload new firmware and configuration. Other that that it has all the necessary functions to implement a DC brushed controller - hardware PWM, Analog to digital converter, internal EEPROM to save the ESC configuration after power down.
Second IC is the current amplifier. This amplifier serves two purposes, one is to amplify the motor current by 20 and the second is to filter the PWM switching noise before being sampled by the MCU's analog to digital converter. The filter is a second order sallen-key low pass filter that is fixed at about 2kHz (our PWM frequency is just above 11kHz). This gives very good compromise between switching noise and sampling bandwidth. "Too much" filtering will make current limiting very slow and lazy - "Too little" filtering will make the samples very noisy and the MCU will have to work harder in order to average them.
The third IC is the MOSFET driver. This driver can drive the MOSFET gates at up to 3 amps and does the level shifting needed (5V microcontroller IO to 12V MOSFET gate).
Total Soldering time around 10 minutes.

Next I assembled all the resistors. This took around 1 hour due to the fact I was missing one resistor value and had to go 5 times through the Digikey order to find it. Found it stuck to another plastic bag...

I hope I find some time tomorrow to continue. That's all for now.

S.B.D
Attachments
ICs.jpg
ICs Assembled
(209.71 KiB) Downloaded 3 times
Resistors Assembled.jpg
Resistors Assembled
(245.8 KiB) Downloaded 3 times
S.B.D
100 mW
100 mW
 
Posts: 48
Joined: Thu Dec 29, 2011 1:59 pm

Re: DIY Brushed ESC - Assembly Thread

Postby S.B.D » Fri Jan 13, 2012 3:18 am

I found the time today to continue the ESC assembly.
Next step was to assemble the SMT ceramic capacitors. This took very little time compared with the resistors as they do not have to be flipped to maintain the marked side upwards.
I forgot to mention that all the capacitors and resistors are 0805 SMT size, this makes soldering very easy, to my taste easier than through hole components.
The PCB does not have to be flipped all the time and components don't fall during soldering. All is needed are good tweezers, very thin solder and liquid flux. I personally use a "Hakko Like" soldering station that can be bought for around 40$ of ebay.

Next I assembled the SMT diodes and small SMT transistors. Nothing special to report here...

Than came the 1 milliohm shunt resistor turn to be placed. I used this type of resistor before but from Vishay. The ones we used here are from a Taiwanese vendor. The main difference is that these come made only from copper with no solder resist plating on the resistive part (the part that is elevated from the PCB). In order to keep the resistor as accurate as possible I needed to pay attention not to get solder on the elevated part so the resistance will not change. I am pretty sure that even if i did so it would not have made a significant difference.

Next assembled are to component side through hole capacitors and crystal. Thats it for the top side!

Next step is to assemble the power components. 2 x voltage regulators, 2 x high current schottky diodes & one reverse polarity protection diode.
We decided to try a different mounting method for the TO-220 components. All the thermal tabs will face away from the PCB and the PCB itself will pressure the components to the aluminum box.
I will use an insulating thermal pad between the thermal tabs and the aluminum box. I hope this will work as expected...

Part used here are one high voltage LDO from TI with an input voltage that can exceed 120V. This regulated the battery voltage to 12V for the MOSFET driver.
An LM317 regulates the voltage from 12V to 5V for the microcontroller. 2 high current schottky diodes are used in parallel as the freewheeling diodes parallel to the motor.
One general purpose diode is used for reverse polarity protection. 6 x P140NF75 MOSFETS from ST are used for the PWM modulation of the motor. These are 75V, 7.5 milliohm N-Channle MOSFETs.
4 of the same MOSFETs are used in series to the PWM MOSFETs for protection. In case one of the 6 PWM MOSFETs burns to a short these will disconnect the uncontrolled motor current.

The limiting value currently is the 1000uF capacitor that is rated at 63V. This is the best capacitor I could find from Digikey that gave good impedance for a sane price. I will surly try and find a higher voltage rated capacitor so the limiting value will be the MOSFET voltage rating and not the bulk capacitor.

Next step will be to wire the PCB and house it in the aluminum box.


S.B.D
Attachments
Caps & Diodes.jpg
Caps & Diodes
(248.49 KiB) Downloaded 3 times
Shunt.jpg
Shunt
(231.66 KiB) Downloaded 3 times
Component Side Finish.jpg
Component Side Finish
(188.66 KiB) Downloaded 3 times
Power Diodes.jpg
Power diode assembly on the bottom side
(189.11 KiB) Downloaded 3 times
Finish1.jpg
Finished assembly
(182.03 KiB) Downloaded 3 times
Finish2.jpg
Power component placement
(238.54 KiB) Downloaded 3 times
S.B.D
100 mW
100 mW
 
Posts: 48
Joined: Thu Dec 29, 2011 1:59 pm

Re: DIY Brushed ESC - Assembly Thread

Postby nieles » Fri Jan 13, 2012 4:23 am

the best (lowest ESR) capacitor on digikey i know is the KZE series of United chemi-con

http://search.digikey.com/us/en/product ... -ND/756262

it is also good to have some 1210 ceramic capacitors between + and - as close to the fets as possible for a low ESR
nieles
1 kW
1 kW
 
Posts: 469
Joined: Mon Jul 14, 2008 5:39 pm
Location: The Netherlands

Re: DIY Brushed ESC - Assembly Thread

Postby S.B.D » Fri Jan 13, 2012 4:54 am

Thanks for the info nieles, missed this one...

This is the capacitor assembled now:
http://search.digikey.com/scripts/DkSea ... D&x=11&y=8

The one you suggest shows half the impedance. I will add it to my next Digikey order and test it. I'm sure the lower ESR will give better results even with lower capacitance.

S.B.D
S.B.D
100 mW
100 mW
 
Posts: 48
Joined: Thu Dec 29, 2011 1:59 pm

Re: DIY Brushed ESC - Assembly Thread

Postby S.B.D » Sat Jan 14, 2012 11:37 am

OK, time for first power up. I always put in my schematics a series resistor I can take off when first powering a board. I removed the series resistor on the 5V rail and unsoldered the MOSFET driver 12V VCC pin from the PCB pad, connected to a 30mA current limited bench power supply and raised the voltage gradually....no short circuits :) ....took the multimeter to check the voltage on the two voltage rails and ...... nothing... :( Both showed 0V.

Went back to the schematics and saw that I also have a series switch option that was not assembled..... :)

Placed a 0 ohm resistor instead of the switch, reconnected everything and slowly throttled up the power supply voltage... again no shorts... took the multimeter and measured the two regulator outputs.
12V rail showing 12.4V (well inside the MOSFET driver spec), 5V rail showing 4.98V.

Who can find the series resistor in the picture... :lol: ?

S.B.D
Attachments
Power Up.jpg
(174.21 KiB) Downloaded 3 times
S.B.D
100 mW
100 mW
 
Posts: 48
Joined: Thu Dec 29, 2011 1:59 pm

Re: DIY Brushed ESC - Assembly Thread

Postby tedcs » Wed Feb 01, 2012 8:16 am

Your ESC project reports are entertaining, inspiring, and educational.

I've only started to poke around in motor controller circuits. It takes
some time to become familiar with the components available, their
characteristics, and what they smell like when in distress. I'm pleased
to find no filament transformer, 25L6, 12AX7, or Leyden Jar.
Everything I know is wrøng.
User avatar
tedcs
10 mW
10 mW
 
Posts: 32
Joined: Wed Apr 06, 2011 7:10 am
Location: on holiday, in Cambodia


Return to Stand-up E-scooters and E-skateboards

Who is online

Users browsing this forum: No registered users and 0 guests