# Homebrew AC Controller



## frodus (Apr 12, 2008)

I'll be following this project! I have two mbed LCP1768's.

Why is the throttle 2-pin? Why not use a 3-wire 0-5V (allows you to use hall effect or a pot)


----------



## chris917 (Apr 26, 2012)

frodus said:


> I'll be following this project! I have two mbed LCP1768's.
> 
> Why is the throttle 2-pin? Why not use a 3-wire 0-5V (allows you to use hall effect or a pot)


To be honest I just designed it to use some 10k pots I had laying around. I figured there would be at least one revision before this actually goes into a car so I could figure out what would work best for a throttle/regen interface.


----------



## Stiive (Nov 22, 2008)

Nice one.
A lot of work lies ahead, dont let it get you down.


----------



## chris917 (Apr 26, 2012)

Stiive said:


> Nice one.
> A lot of work lies ahead, dont let it get you down.


Thanks 

By the way, I read through your DTC controller thread with much interest. I spent quite a bit of time deciding between DTC and FOC and still am quite curious about DTC. Haven't seen as many applications of it as FOC.


----------



## chris917 (Apr 26, 2012)

I should also mention that I plan to make the schematics, Gerber files and BOM public once this thing is a tested and complete design. I'm not sure how much I can release at the moment due to university policy.


----------



## JRoque (Mar 9, 2010)

Good work, Chris. Here's hoping the U policy allows your own design to be published... but you're right on not risking your final project chances.

Looking forward to the schematics and other materials when you have the time. I'd selfishly love to see them in native Altium format if you can.

JR


----------



## chris917 (Apr 26, 2012)

Time for a minor update!

With all of the parts collected (minus the PCB itself  - should have that by Wednesday), it's time to start assembling the system. Once it's together and the PCB is tested I'm going to use some equipment from the school to start the development - namely a small induction motor with a belt drive attachment to a DC generator. A few pics included below.

To all of you in BC, Happy Family Day!


----------



## wanispissd (Feb 6, 2013)

Chris, 

Thanks for posting an update - having parts in hand is a good sign! I am happy to see an update on this and will be following the progress. Actually I registered for this forum specifically to see this thread, as I intend to build a (big) brush-less controller on the basis of an LPC1768 (currently have an mbed). I have done some or the schematic but have not yet started the layout. The software side is the part which worries me, so I hope to be able to learn some of this from your project. 

To prepare, I have been doing a lot of reading. AN10899 is particularly good. I have determined that the Motor Control PWM signals are the way to go (specifically for dead-band settings to avoid shoot-thru on the IGBT gate pairs). One thing I found yesterday that was troubling is an errata sheet put out by NXP specifc to the LPC1768 chip stating that some of the MCPWN do not function. I have yet to check the pin-to-pin comparability, but I am really hoping that I can just swap to the faster LPC1769 chip (provided that it does not have the same issue). I may be jumping the gun, but I wanted to give you a heads up on this potential issue. 

Good Luck !

- Brian


----------



## chris917 (Apr 26, 2012)

wanispissd said:


> Chris,
> 
> Thanks for posting an update - having parts in hand is a good sign! I am happy to see an update on this and will be following the progress. Actually I registered for this forum specifically to see this thread, as I intend to build a (big) brush-less controller on the basis of an LPC1768 (currently have an mbed). I have done some or the schematic but have not yet started the layout. The software side is the part which worries me, so I hope to be able to learn some of this from your project.
> 
> ...


Thanks Brian!

Is this the errata sheet?

I think it may only refer to the original revision (released in 2009 I think) of the die, hopefully the later revisions have it fixed. Regardless, I actually have an LPC1769 on hand that I intend to try out - I will let you know if the MCPWM input pins work. I believe the 68 and 69 are pin-to-pin compatible, it seems to follow the general trend of their device family naming.


----------



## chris917 (Apr 26, 2012)

Time for a reading week update!

The PCB is now assembled and ready for basic testing. I need to figure out what kind of filters are needed at the current sensors and a couple other basic component choices, but I should be able to start testing the micro-controller and PWM signalling shortly. So far I've powered it up and tested the four rails (+5V, +3.3V, +15V, -15V).

For those wondering what the little blue module sticking up is, it's the Bluetooth comms module. These things are dirt cheap now, you can grab them for ~$8 on dealxtreme. The micro-controller is programmed over it, and during regular operation it'll be used for live diagnostics streamed to a laptop.

Link to Bluetooth module here.


----------



## PStechPaul (May 1, 2012)

Looks good! I found other Bluetooth modules that may be more generic and may work with Microchip PICs.

https://www.sparkfun.com/products/10253?

http://www.farnell.com/datasheets/50665.pdf

http://www.seeedstudio.com/depot/grove-serial-bluetooth-p-795.html

http://www.ebay.com/itm/HC-05-Bluet...ule-Wireless-Serial-6pin-Dupond-/251130486361

http://www.ebay.com/itm/New-RS232-B...ation-Master-Slave-2-Modes-free-/251215185081

http://www.ebay.com/itm/New-MIni-3-...ter-Module-Serial-Port-30ft-TTL-/261053250441


----------



## chris917 (Apr 26, 2012)

PStechPaul said:


> Looks good! I found other Bluetooth modules that may be more generic and may work with Microchip PICs.
> 
> https://www.sparkfun.com/products/10253?
> 
> ...


Thanks Paul. 

FWIW the modules I'm using should work fine with any micro-controller. The 3.3V IO will likely work out of the box with 5.0V PICs, or you could add a basic unidirectional level converter (resistor divider) for the 5.0->3.3V if you're worried about the levels.

Chris


----------



## PStechPaul (May 1, 2012)

I'm happy to say that I ordered and received a Bluetooth module:
http://www.ebay.com/itm/181072994083

It works directly on 5VDC and TTL RX/TX lines from the PIC18F4420 in my datalogger project. I got a $12 Bluetooth dongle for my laptop and it found the module and allowed me to use COM14 to receive the data stream at the default 9600,N,8,1 settings. Very easy to use and dirt cheap. I paid $12 for the dongle but I saw some on eBay for less than a dollar including shipping! How do they do that?
http://www.ebay.com/itm/USB-2-0-Min...Adapter-For-PDA-Mobile-Phone-PC-/280865366084

I was amazed that the signal was not blocked by a 7" x 9" 12 gauge steel plate. I may incorporate this into an industrial test set I am designing. Thanks for the idea!


----------



## chris917 (Apr 26, 2012)

Quick update: 

School's been quite busy lately with other projects and assignments, and as a result I haven't had as much time to focus on this project as I would have liked. In addition to other schoolwork, I've run into a problem with the controller. I haven't been able to get the LPC1769's bootloader to respond - meaning I can't even program the damn thing. After some probing it looks like the chip is completely dead and will have to be removed. It may have been damaged during assembly or perhaps had shorted underneath the pins; regardless of what caused it the next step is to remove it and check for visible shorts. Being that it was 3:00 AM and I didn't have a hot air gun, I decided to try something different. Surprisingly, it worked in just a couple minutes and didn't seem to leave any damage to the board other than some candle residue which wiped off easily. Hopefully a replacement LPC will have this board up and running tomorrow!


----------



## Siwastaja (Aug 1, 2012)

Ovening the PCB's is not worth the hassle unless you have the real process at your disposal. 

Just hand solder, it's one of the quickest steps in the project and pretty straightforward. If not, then you have too many components!

If you are going to mass produce, then develop and test the reflow process first.


----------



## chris917 (Apr 26, 2012)

Siwastaja said:


> Ovening the PCB's is not worth the hassle unless you have the real process at your disposal.
> 
> Just hand solder, it's one of the quickest steps in the project and pretty straightforward. If not, then you have too many components!
> 
> If you are going to mass produce, then develop and test the reflow process first.


Yes, I hand-populated the boards for this run. I have a toaster oven for reflow but I had a lot of through hole parts anyways so I figured I'd go for the hand soldering method. In this case, I used the candle to desolder, since the oven would haved caused all of the parts to come loose instead of just the one. It worked surprisingly well!


----------



## jhuebner (Apr 30, 2010)

I'm a bit jealous to be honest. Gate drivers and controller all on one board, thats nice.

So these black things are DC/DC converters and the 8SOIC parts are the gate drivers?

What other I/Os do you have?

I hope you can fire it up soon, there is none greater


----------



## PStechPaul (May 1, 2012)

That's a clever idea with the candle, but it may still cause some damage to the board. What I usually do for removal of SMD chips with exposed legs is to cut them with an Exacto knife and then use a soldering iron and vacuum sucker to remove the debris. Of course that won't work for a BGA or a chip with a soldered ground/heatsink pad under it.

Also make sure you clean the board thoroughly, using something like alcohol to remove the solder flux and then follow with detergent and water to remove conductive ionic contaminants, and finally a thorough wash with clean water )perhaps even distilled or deionized). Then a thorough baking or drying with a heat gun.

It looks like you have a lot of room on your board, and you may do well to use an adapter board and a socket for easier removal and testing. Good luck on your project.


----------



## chris917 (Apr 26, 2012)

jhuebner said:


> I'm a bit jealous to be honest. Gate drivers and controller all on one board, thats nice.
> 
> So these black things are DC/DC converters and the 8SOIC parts are the gate drivers?
> 
> ...


Correct, the black potted SIP packages are the +15/-8.4V DC/DCs and the SOICs are the 12A low-side drivers. I/Os are kept to a minimum for this revision, other than the phase current and encoder inputs there are just a few pushbuttons, contactor control, two pots (throttle and regen) and a serial link.



PStechPaul said:


> That's a clever idea with the candle, but it may still cause some damage to the board. What I usually do for removal of SMD chips with exposed legs is to cut them with an Exacto knife and then use a soldering iron and vacuum sucker to remove the debris. Of course that won't work for a BGA or a chip with a soldered ground/heatsink pad under it.
> 
> Also make sure you clean the board thoroughly, using something like alcohol to remove the solder flux and then follow with detergent and water to remove conductive ionic contaminants, and finally a thorough wash with clean water )perhaps even distilled or deionized). Then a thorough baking or drying with a heat gun.
> 
> It looks like you have a lot of room on your board, and you may do well to use an adapter board and a socket for easier removal and testing. Good luck on your project.


I have tried that technique in the past (scalpel then iron + solder sucker) but have had pretty bad luck with damaging pads. I'm probably not as experienced at it as yourself though, so maybe I'm being too aggressive during the removal. In any case, I'm going to pick up a hot air reflow gun soon so hopefully I won't have to resort to candles or knives anymore 

Yes I made sure to wipe the board with alcohol and I usually use the low-solvents "no-clean" flux anyways. Will take another pass with distilled water as per your advice, thanks.

Regarding the socketing of the microcontroller, in retrospect I kind of wish I would have modularized the whole thing - one board for the power supplies, one for the micro and inputs/outputs, and one for each driver (mounted on the IGBTs). Unfortunately this was considered a bit too prohibitively expensive for this project at the time of conception.


----------



## mizlplix (May 1, 2011)

Keep up the good work. A lot of us are watching with interest.

Miz


----------



## Siwastaja (Aug 1, 2012)

+1 for modular construction when prototyping. We had our controller running in a few hours because of that. That gives motivation, and idea what to add next.

OTOH, the finished product should be as much on a single PCB as possible to increase reliability and decrease cost.


----------



## Arlo (Dec 27, 2009)

Yup sitting on the edge of my seat.


----------



## chris917 (Apr 26, 2012)

Wooooohoooooooo! She's alive! 

Made a giant noob mistake and had the package soldered in 90 degrees rotated. Who puts three pin 1 markers on a chip and lines the chip text up with pin 76!?!  Anyways should have read the datasheet closer - but its running now and I'm seeing a nice 3-phase output on the scope. Firmware development and testing to begin!


----------



## JRoque (Mar 9, 2010)

Congrats! Come on, shows a scope screen capture of those 3 phases dancing. If you're trying with a motor/inductive load, how's the noise looking?

JR


----------



## chris917 (Apr 26, 2012)

Hey again,

Sorry for the long delay - the project has been 'completed' and demonstrated and I'm happy to say it has resulted in the highest course grade of my undergraduate degree!

I should clarify though, by completed I mean it is operating in V/Hz mode at low power levels (15V laptop power supply). So, 'completed' for a capstone university project but still under development for a personal project. I plan to resume work on it at some point this summer, but for now I am focusing on other priorities (namely, obtaining a private pilots license) before beginning full time employment in July.

I will post the schematics now and the code and layout at some point in the future. The code needs much cleanup and refining.

A quick video of the initial fixed V/Hz testing:

https://www.youtube.com/watch?v=pIb5hzMQrrM&feature=youtu.be

Chris


----------



## Siwastaja (Aug 1, 2012)

We have had relatively good results from a very simple "slip" control that is easy to add on the top of your V/Hz. Just remember that contrary to many sources, slip is not a percentage but an absolute value. So, measure rotor speed, add slip frequency to the corresponding frequency, and you have your Hz. Then deviate from the linear V/Hz by using your torque input and there you are, a working torque control in a few lines of code.

We have taken a few test rides and after a few kilometers, both motor and controller are cool even without cooling (with V/Hz, the controller became hot and motor became warm in much shorter time). The gas pedal (torque input) is a bit aggressive when starting though. It's not perfect but certainly usable. Anyhow, it has been nice to see that my statement was perfectly correct all the time and it ain't rocket science.


----------



## HighHopes (May 29, 2013)

nicely done, congradulations on the well deserved grade.

i am interested in your +15V/-8V DC/DC converter, can you share who the supplier is and the part number?


----------



## Siwastaja (Aug 1, 2012)

12V and 5V DC/DC converters are abundant, so if you want good IGBT gate drive voltages with the most commonly available components, use 12V and +/- 5V DC/DCs in series to get -5V, GND and +17V. These voltages are just optimal for almost all IGBT gate drivers and IGBTs. Remember that most gate drivers have voltage drop of 1 to 2V when on, and therefore +15V supply is a tad low, as 15V is recommended for most IGBTs. Don't forget to use large enough capacitors, the current consumption will be very spiky and the small DC/DC modules have high internal resistance.


----------



## chris917 (Apr 26, 2012)

HighHopes said:


> nicely done, congradulations on the well deserved grade.
> 
> i am interested in your +15V/-8V DC/DC converter, can you share who the supplier is and the part number?


Thanks!

Powerex VLA106-15242, bought it from Newark here.


----------



## HighHopes (May 29, 2013)

ah yes.. powerex, that's why they looked familiar. looked into those years ago. as i recall, i ended up not using it because the datasheet did not specify input-to-output capacitance (transformer interwinding capacitance) and i was too lazy to measure it. 

on an unrelated subject .. if you don't mind some advice from a complete stranger .. i was like you a few (read many) years back, in university building power electronic things for various projects i was working on. just before i graduated, i went back into my archive of fun projects and made one page summaries of three of them. worded like this, Problem Statement, My Solution, a picture of the thing, Summary of quantifiable results. I took 3 three summary sheets, along with my resume, to the interviews i had and was offered a job on the spot by all interviewers. engineers just love this stuff .. real work, shows what you can do. perhaps something like this will help you in the near future? best of luck!


----------



## chris917 (Apr 26, 2012)

HighHopes said:


> ah yes.. powerex, that's why they looked familiar. looked into those years ago. as i recall, i ended up not using it because the datasheet did not specify input-to-output capacitance (transformer interwinding capacitance) and i was too lazy to measure it.


Yes I also was a bit wary of the lack of information but I assumed it would be lower than anything I would be able to come up with (considered a custom wound flyback setup).



HighHopes said:


> on an unrelated subject .. if you don't mind some advice from a complete stranger .. i was like you a few (read many) years back, in university building power electronic things for various projects i was working on. just before i graduated, i went back into my archive of fun projects and made one page summaries of three of them. worded like this, Problem Statement, My Solution, a picture of the thing, Summary of quantifiable results. I took 3 three summary sheets, along with my resume, to the interviews i had and was offered a job on the spot by all interviewers. engineers just love this stuff .. real work, shows what you can do. perhaps something like this will help you in the near future? best of luck!


This is really good advice, thanks. I had been intending to do something similar with a personal website and your post has reinforced my motivation.


----------

