Wednesday, December 17, 2014

The Realist

"The Pessimist complains about the wind; The Optimist expects it to change; The Realist adjusts the sails."
- William A. Ward
I have been raised to be a firm believer in attitude affects everything. Life is %10 what happens to you and %90 how you decide to handle it. There is obviously a wide gambit of ways to handle any single unfortunate situation. However Mr. Ward broke those infinite ways down into the three most categorically common viewpoints on a problem.

Tuesday, December 9, 2014

PWM control and Dead Time Insertion

So as is often the case I vastly overestimated my knowledge on a few subjects. In my last post on this project I had successfully designed and put together my physical motor driver. This meant that all I really needed to do to get the motor spinning was fire up some pwm signals on my micro and done, right!? Well I was wrong. There were two fundamental gaps in my knowledge on BLDC control that I did not know I was lacking in until I attempted to start writing the code to control a motor. The first of the two being the PWM control scheme. There are 4 main variants of PWM control schemes for a 3 phase BLDC controller. I originally was just under the naive impression that there was one standard way to perform the functionality, and was no so surprised to find that "there is more than one way to skin a cat." The second area of knowledge that I did not know too much about, and was only vaguely aware of, is the practice of dead-time insertion (DTI). The main goal of DTI is to avoid a short circuit from the high side of the DC Bus to ground through the two transistors that control a single phase. This can happen because switching on and off transistors just like anything else is not instantaneous and some overlap may occur. DTI is guaranteed off time to ensure that no overlap happens. I knew that DTI was necessary I just had no idea how much was needed or how to go about implementing it. I had to do a bit of research before being able to answer either of those questions.

Trying to avoid this....

Blown Transistor

This post will hopefully allow me to re-enforce what I learned and maybe teach others about these two subjects as well.

Monday, November 24, 2014

Addition of Digi-Pow Senior design project

I just wanted to make a quick post that I have added some initial information about my senior design project from my BSEE at the University of Florida. I did not do as great of a job documenting my project as I would have liked but I have layed the overall picture out on the Project Page on this blog. The goal of our project was to complete a prototype of a personal appliance wireless power meter that could transmit all data to a handheld device for viewing. I later added the functionality of being able to transmit to a cloud based application. It is my intention to lay everything out on the project page and then go into depth more about the design with blog posts later on when I have the time.

The project was a partnership with my friend and fellow student at the time Eric Iraheta. I thank him for all of his hard work and help with everything along the way. We decided on the coy name of Digi-Pow for our project; because of the digital based power meter design.

Final Prototypes
Sample cloud based application with live data

Monday, November 17, 2014

Putting together the motor driver

A picture story:

I have completed the building of my first motor driver board. This is a prototype so it has been constructed on a perf board protyping board that I bought at Fry's electronics. This is not meant to be a flying prototype just a test bed to get a BLDC motor spinning, and correctly controlled from the xMOS startKIT in a safe environment. Most of this will be explained by pictures and captions, because my last two posts were a bunch of text. The explanation of the component selection was done in this post, and the theory behind all of it was done in this post. Please read those at your leisure and interest.  

Testing the layout before begining soldering and jumpering.

First off I wanted to point out that this is the first time that I have used a perf board for prototyping. In the past I have always used a breadboard. This is largely due to the fact that any of my previous prototyped circuits did not involve as high of a current as the motor driver circuit will be drawing. I did not want to risk melting breadboard connections and blowing something up. So in short don't laugh at my first attempt at a perf board setup haha, but suggestions are welcome. I watched this short video in order to learn some standard techniques first and then gave it a shot myself.

Thursday, November 13, 2014

Bootstrap Gate Driver Calculations

Parts, datasheets, and Background:

As was mentioned in my previous post in order to successfully drive two N-Type MOSFETS in an H-Bridge configuration from a microcontroller a Gate Driver is needed to complete the task. The gate driver IC that I selected is a Fairchild Semiconductor FAN7842 High and Low side gate driver.

Gate Driver IC on breakout board for testing (quite small)
As you can see the IC is pretty small overall and is a relatively simple IC. It takes inputs from a microcontroller and translates that high or low value to the gate of the FET it is driving. The high and low signals are taken in separately and can be controlled separately. This gives the user programming the microcontroller more control however there could be an accidental BOOM! if the high and low sides are on at the same time. This means the programmer needs to be diligent in their work. Pressure is on haha.

Thursday, November 6, 2014

BLDC motor and controller theory

What is a motor controller? Why do we need it? What circuit topologies are commonly used? These are all good questions and I will try to provide a little bit of background from my limited knowledge on the subject.

DC Motors:

Let us start with the Motor. DC motors rely on the fact that current running through loops of wires produce magnetic field. That generated magnetic field in turn then produces a torque on a magnet (permanent or electromagnetic) causing it to turn. The wires are wound in such a way, and current supplied in the right order that the motor continues to spin round and round. This process is called commutation.

Brushed DC Motor:

 A brushed DC motor is called as such because the commutation process (the correct order of applying DC current to cause rotation) is typically done through carbon brushes pressed up against the commutator pads on the rotor of the motor. The current is supplied by a constant DC source. This process is also called internal commutation. While this process is initially inexpensive, reliable, and relatively simple, the brushes wear out over time and cause maintenance and repair down the road. Controlling speed is as simple as varying the voltage of the constant supply connected to the brushes and in turn increasing current. Below is an example of a basic brushed DC motor.

Wednesday, November 5, 2014

New Oscilloscope! Every engineers dream!

The Why...

For a long time now I have wanted to have my very own oscilloscope. Not just one that I could have access to but one that I could call my own and use on my bench, and use for my stuff. I feel like this is a want of every engineer's at some point,  or at the very least for those in the electrical field. Well I finally cracked down and bought one. The main reason why I could justify it was because I am in the middle of building a BLDC motor controller for my Gator Quad project, and a oscilloscope will be very useful for verification and tuning timings. Other than that, because who doesn't want their own... am I right?!?

I wanted a scope that was digital for two main reasons. The first being that digital scopes come in more compact physical platforms and I don't have that much space and move a lot so I did not want to be lugging it around. Secondly, I wanted to be able to connect my computer and pull wave-forms off of the scope directly, and not do the in between with the flash-drive. Obviously after that, I wanted as many features for as little as possible because I already feel guilty for not trying to salvage an analog scope so I might as well go all out. 2-channels is okay with me... I am sure that there are projects where 4 would be useful but I am sure I can get by on 2 for now. That's the other thing. I am a hobbyist, and will be using this for my own personal projects, I do not need to spend thousands of dollars to capture the waveform when I inevitably blow something up. So for these reasons I selected the following scope.

The What...

The scope that I landed on was a brand I was not too familiar with and was sold on amazon. It ran for $279 when I bought it. More than a lot of people would spend, but I felt it was reasonable for the amount of features I was getting and the reviews it had gotten on Amazon. Way cheaper than a "comparable" Tektronix scope or Rigol. Probably not as high quality but hey... Im just doing this for fun so... Yolo. On the upside I was able to buy it with bitcoin thanks to the services of GYFT allowing me to buy an amazon gift card with bitcoin. It worked quite well as a matter of fact and did not take much time at all to purchase an amazon gift card of $300 dollars from them that I was able to use immediately.

Siligent SDS1052DL 7" TFT- LCD Oscilloscope

Thursday, October 30, 2014

You gotta want it!

This one just resonates with me. You can ask my friends... I am often found saying the phrase "You Gotta Want It!" for just about any task in life no matter how big or how small. Because what is the point of doing something if you are not entirely behind it. Why half ass doing anything if you are not 100% sure that is what you want to be doing at that very moment. You have to believe that every step you are taking is for the betterment of yourself and those around you cause if not why are you doing it.

I know this is easier said than done but that's why i love this quote. Find what you want. Write it down. Then focus on that goal every single day. No matter how little or big. Work on it every single day. Its like investing. Putting a little bit away every day, even just a dollar, will turn into huge extraordinary results years down the road.

Anyone that graduated college in my opinion knows a little bit about this. You wrote down on your college admission essay why it was that you wanted to go to that school and why you want to graduate. Then you made a course plan, worked on it every single day, and you reaped the rewards 3-5 years later. A little taste of that shows just how powerful this concept can be.

I will continue to make goals for myself that I identify as true inner targets and make my life and others lives better. I will work on them every single day.

Thursday, October 23, 2014

Testing Hall effects

Today's test work was pretty simple overall. After having installed the hall effect sensors onto the motor I wanted to test to see if they would in fact work. One issue I was afraid of was that the rotor magnets did not go down far enough past the stator to trigger the sensors. The sensors were just below the stator windings because the slots in the stators in addition to the windings were not big enough. I was also not sure how the latching function of the Melexis US1881 was going to work.

1. Wiring up the sensors

First thing I needed to do was to run some wire from the TO-92 package Hall effect sensors glued to the stator to a breadboard or test apparatus. I had some old computer fan power cables lying around (the ones that plug into the mother board) and they seemed like they would do the trick just fine. I cut one end off and left the female connector end on.

Fan wires attached to sensors

Gate drivers and Hall effect sensors

Today I accomplished two main things. The first was quite simple. I was able to get the gate driver IC's mounted to the SOIC-8 to DIP-8 breakout boards from sparkfun. The second was to determine where to place the hall effect sensors to meet the needs of the controller as well as find a convenient place to place them physically.

1. Gate Driver SOIC to DIP

SOIC-8 to DIP-8 breakout board

Top view of the Sparkfun breakout board.

Wednesday, October 22, 2014

First Parts Came In!


My first order of parts came in today. I am starting with the basics for right now. My goal is to get a BLDC motor driver up and running for 1 motor with the same MCU that will be used on the GatorQuad, and then go from there. This will allow me to start to prove the concept while saving as much of my code and work moving forward.

Parts Ordered:

  • 6 x CSD18537NKCS - N Channel Power Mosfet - Texas Instruments (Digi-key, TI free samples)
  • 3 x FAN7842MX - High side, Low side, Mosfet driver - Fairchild Semiconductor (Digi-key)
  • 3 x US1881 - Hall effect latching sensor, Melexis (Sparkfun)
  • 3 x SOIC to DIP adapter 8-pin, Sparkfun (Sparkfun)
  • 1 x NTG Propdrive 28-30s 800kV BLDC motor, Turnigy (Hobby King)
  • 1 x 3.5mm 3 wire Bullet wire connectors, Hobby King (Hobby King)
  • Already on Hand:
  • 1 x XMOS startKIT multicore microcontroller, XMOS (XMOS)

The motor was ordered from Hobby King because it was inexpensive and widely used. I did not know what I was getting with it because It's Hong Kong manufacturer "Turnigy" does not have a lot of documentation online. This motor does not come with built in Hall effect Sensors for sensored control. I ordered a few bullet style connectors from HobbyKing so i can make and connect my own wire. Thus I ordered some from Sparkfun and hope they will fit my needs. I did not notice when I ordered the Hall effect sensors that they are a latching version, so I will find out if that will effect my control and ultimately may need to order non latching sensors. The TI Power mosfets are capable of sourcing 50A of drain current while the motor is only rated for 20A. Obviously I way over sized here, these will likely be scaled down in later designs, but for now I wanted to be on the safe side. Picking the gate drivers was a little tricky, the main things that I wanted was independent control of the High side and Low side of an H-bridge, as well as enough source current to switch the mosfets fast enough. I found scattered resources across the web to help with determining the source current for certain mosfet capacitance's and switching speeds. Right now I think I am okay, If my calculations were wrong we will revisit this. The gate drivers were a small SOIC package and I am doing my initial prototyping from a breadboard and desktop power supply. Additionally I will be using my Xmos StartKit development board, so no self designed PCB's yet.


"Education is the most powerful weapon which you can use to change the world." - Nelson Mandela

I love Nelson Mandela quotes and all of the lessons that he had to offer. But more importantly one of the values I have fortunately been exposed to in my life is education. My parents taught me at a young age what an education can do for oneself, and later on in college I truly was able to live that.

Through my own experiences and the teachings of those who were kind enough to share, education will remain a high priority in my life. With a desire to learn all else can be accomplished, all goals achieved, and all problems quelled. All great things come back to the desire to learn and to get better. 

I will continue focusing on my continuing education, as well as spreading the gift to others.  

About this Blog

Intrinsic Motivation

The motivation for creating this blog is pretty simple. I want (and need) a place for me to dump my thoughts and ideas pertaining to projects and self learning that I am working on. I often find myself doing many things like projects, reading, learning, and self improvement routines to continue my own personal development as I navigate life. However as much as I start these projects and goals, I often find myself getting lost along the way. Whether it is due to my own laziness or because what I had started had gotten so off track I forgot what I was doing or why I was doing it in the first place.

I plan to mainly use this blog as a project log for various things I may be working on. I am an electrical engineer by trade so I will likely be working on something in that field. This will allow me to have one place to post pictures, ideas, sketches, and logs... and hopefully keep me on track along the way. Also what is equally important is that this will be a venue for people to comment on my projects and goals. Maybe to motivate, provide input, point me in the right direction, or constructively criticize, whatever the reasoning the value of peer discussion can not be overlooked.

This blog (I hope) will be what leads me from starting things and maybe getting lost along the way, to staying on track. Goals can be dynamic and I hope that this blog is proof of that, but staying focused on the moving target is what is difficult. The motivation for creating this blog is pretty simple, the motivation is purely intrinsic.