So after hitting 500 subscribers, and the death of the last controller, I went on a mission to design a PCB for the BLDC Alternator controller. It’s smaller, sleeker, and has a couple improvements(maybe?) over the old version. Thanks for watching, and thanks for subscribing!

]]>So… the alternator motor controller PCBs came in a little bit ago, I actually received the order by that Friday (from that Monday, they’re very quick considering the distance!). Since then I have mocked it up, but I haven’t soldered it together yet… because…

I happened to make the mistake of putting the wrong size pitch terminal blocks on the board… I designed this with 3.5mm pitched blocks, but I only have 5mm pitched blocks.

Are 3.5mm blocks small, they seem really small…?

Well until I get these connectors, I am not going to solder this guy together yet. There is still the new in-box alternator I never mentioned, and want to run with this controller. I just need to create the sensor array for it, remove the voltage regulation, and find the common end on the coils…

So there are still some things to be done before this PCB gets to run something… But doesn’t it look cool?!?!?!?

After all this, there is still the the idea that it should be doing something besides looking like a pretty circuit board that does magic to an alternator. What should it drive? Bicycle, go-kart, a pump of some sort? I don’t know, there are a lot of applications here, my original idea was to harness the back EMF from it. I did that, but lack the tools to find out just what can come from it, and well, a go-kart sounds really fun! There is a comment section below if you have an idea!

(P.S. if you’ve got a spare go-kart, or maybe some batteries, I could totally use ’em!!!)

]]>So this has been a very long time coming. I have come to notice that the most popular thing I have created on the internet happens to be my BLDC Alternator motor. So let’s try continuing with that. Here I have finally designed a PCB using Eagle that will control the alternator motor with less of a wire nest. With this board I can just pop the components on it and hook it up to the alternator! Let’s take a look at the list of components needed:

- Q1 through Q12: IRF2807 N-Channel Hexfets – These FETs were picked for their very low on-resistance, and high power dissipation capabilities at relatively high voltages. It is possible to use other N-Channel FETs, however they need to be powerful enough to drive a 0.5 ohm load with the voltage it’s given.
- IC1 through IC3: TC4420 MOSFET Drivers – In my original design I used the 555 timers to drive the gates on the Hexfets. This worked, but the 555 timers do heat up due to the high current the Hexfets can pull. The TC4420 fixes this by allowing up to 6 amps though it’s output, where the 555 timer was only supposed to allow up to 200 mA.
- IC4 through IC6: NE555 Timers – These 555 timers are configured as “Inverted Schmitt Triggers”. They take the sensor outputs and invert the signal since the output from the A3144 hall effect sensor shows HIGH when no magnet is present, and LOW when there is a magnet present. This signal then goes to the TC4420 chips to trigger the Hexfets.
- IC7: NE555 Timer – This 555 Timer is a throttle solution by providing a PWM signal the other 3 555 timers reset pins. It basically overrides the output by shutting down all three chips if it is LOW and bringing them back up if it is HIGH. The PWM frequency is controlled by the selection of C1 and the Potentiometer that is placed on THR+, /, and -. The pulse width then is determined by the position that the potentiometer is set at. In the last iteration, I used much to low of a frequency and it was very noisy (Chewbacca noisy! ha ha) So this time I plan on using a much higher frequency to quiet it down.

Really that’s it. The only other components on the board are the 12x 3.5mm 2 pin connectors, and about 6 inches worth of 3/4″ aluminum angle for mounting the Hexfets.

There was one big issue in designing this though. I was disappointed in not being able to place a positive power rail for the motor on the board. This was because the trace width needed to be just as big as the ground plane that’s already on the board (the size of the whole board) in order for it to work right. So the positive power for the motor actually just goes directly to the motor. Really though, the only reason I wanted it was so that I could maybe make it into a shunt resistor and measure the current off of it, but that can just be placed in line with the positive power to the motor anyway.

One small annoyance was that I could not figure out how to remove the middle pin from the TO220BV package in Eagle. My design does not use that pin as it uses the mount to pass the current through the drain, so I usually just break that pin off the component. However it was used by what seemed like billions of other devices in Eagle, and would have been a nightmare to clear it all up. In a future version I may just create my own library for it.

I have JLCPCB working on this board right now, and it should be finished and delivered here by the 15th. Once that shows up the fun can begin with assembling this little beast. I am having trouble figuring out what to do with 5 pieces though… I only really need one *wink wink! I will work on how I can possibly get rid of the extras to any super fans of the project that may want one!

Hope this is as exciting for you guys as it is me! Be back next week!

]]>Jar of Sparkly Things is now on Google Play! It’s just a fun simulator toy you can break out when your in one of those boring places and need a casual, yet colorful way to pass the time. Available on all devices running Android 4.1 and up.

This is basically my kind of “Hello World” for HTML5/Javascript. Super difficult to figure out where to start, but got it going after a couple nights of programming. It looks almost identical to the android version I made, I just haven’t added any other functions to it. There are some scrolling and resizing issues where the mouse is concerned. Not sure why that has become the difficult part.

]]>

Download Jar of Sparkly Things 0.9 – Android APK

Here it is which some major updates. A new menu system, new color choices, and new movements. The options now persist from when you close the app to when you open it again. The option to invert the accelerometer’s output is also now available. It’s version 0.9 because there are just a couple more things that need polishing. Enjoy!

]]>

So the Jar of Sparkly things has been updated to include color changing, a couple of different fields, and different ways for the particles to move. The latest is that not only is this a runnable jar file, but I also created an Android App. It’s not quite the same due to my device not being able to handle a simple triple nested for loop (it took eight minutes to run through one frame of this on my Galaxy S5!). But here it is in action!

If you compare the way they look, you’ll notice that the dots in the android version are drawn using a bunch of circles that fade out from white, to their color, then to black. Here is a screen shot of the the same particles, but drawn on the field in the runnable jar:

Being able to plot the field around the dot instead of drawing the dot gives a very nice glowing effect. It is pretty hard on the computer though. With 1/4 resolution my computer runs this at 20 frames per second. The problem is in the triple nested loop. If you read the earlier post about the math involved in calculating an Electric Field, you’ll know that the field is calculated by running every pixel against every point. So at 320 x 180 pixels, and 20 points, there are 1.1 million calculations going on per frame. That’s pretty far out, and I’m guessing that is just to much to run on an Android device.

What was done in the android device was just drawing 20 circles that fade out from the point, and the colors are added together on the canvas. This drastically cuts down on the number of calculations. This makes the number of calculations 50 dots x 20 radius,which is only 1,000 calculations (relatively speaking). So it runs much smoother and can handle much more particles. However if there is a way any one knows about that can allow me to do something like what was done in the PC version, please let me know.

OH! and don’t forget to download them both right here:

]]>I took the e field simulator, and decided to turn it into a toy of sorts. These programs use the same type of math used (only much nicer on the hardware by using integers everywhere possible.) and basically map out the field around a point. Since it looks so cool I decided to make the points interact with the mouse and have different properties. In these examples, the dots accelerate towards the mouse pointer when clicked, and have a pulsing charge on them. The fire flies just float around, bumping off the walls, while the sparks fall to the ground like gravity is pulling them down. Let me know what you think! ]]>

Getting pretty handy with my vector algebra, so as I was doing some homework for my Engineering Analysis class(EE310 for those NMSU folks), I decided to write a program that would let me map out some of the problems. This one deals with electrostatics and point charges. Basically given some points with charges, what is the E field direction for one given point, and the force exerted on it given it’s and the other’s charge.

“Hey! That’s not programming!”, one might say, and one is right. We have here some bonafide mathematics. Not to worry though, it can be turned into a program. However, to use this, you need to have some kind of particle system set up. I came up with a class called TheDot() that I could turn into an array. TheDot() contains variables for what are needed; x, y, x velocity, y velocity, mass, radius, charge… This gave me an array points I can access and update in a game loop. I’m using Java for this so it was a class. if you are using some other language you can create what is needed maybe a 2 dimension array of points, or an array of custom types maybe. You can also render them how you like. I used a JFrame and Graphics2D to draw evreything.

We have points in space (x, y), and they have charges, now it’s time to make the line of code that uses those points. The math above describes the E field and Force field based off of how close the particles are to each other and their individual charges. You can tell by how many R’s (distances) and Q’s (charges) there are in the formulas. There is a K as well which should defined as 9*10^-9. It’s just the permittivity of free space, and it stays constant in this example.

“Ok, what about the scary E thing there?”, that right there is a summation, and it is only fancy talk for a ‘for loop’. You know the one:

for(int i = 1; i < n; i++){ //do something 1 to n times }

They even have the same variables. It just says do the thing on the right 1 to n times and add all the results together (get it? ‘summation’). Every time you do the math on the right you increase ‘i’ by 1 until it reaches n, and you have your answer. You’ll also notice the i subscript on the Q on the right side of the summation. This increases with each time you calculate the right side. So basically what you get is:

Now we aren’t going to write out every summation of every dot on the screen, this is a ‘for loop’ remember. But we still have one more thing… The Vector R. Right now we have described enough to get all of the charges added up… if they were on top of each other. We need their distances and this is where the vector algebra comes in. It’s not complicated though. To find the distance between two points, we subtract one point from the other. So since we are in (x,y), we have two distances, so we do x2 – x1 and y2 – y1, and this gives a vector R that has the distance from one point to the other in x and y coordinates. To get the actual distance, you use Pythagorean Theorem on that new vector R and you get:

So what this whole thing ends up with is a new (x,y) vector in the direction from a point to another, multiplied by the other’s charge and divided by the distance cubed. It’s probably best to have a couple of functions that do some of the work, and come together. Like one for the distance, and one for finding the new vector. So let’s have 3 functions, one that updates the loop (in my case was part of TheDot() class), a function to get the new vector, and a function to get the distance from the new vector.

public void update(int point2update, int n){ double Ex = 0; double Ey = 0; double K = 9*10^9; double newVectorX = 0; double newVectorY = 0; for(int i = 0; i < n; i++){ newVectorX = vector(point[i].x, point[point2update].x); newVectorY = vector(point[i].y, point[point2update].y); // heres the important part! Ex = k*point[i].charge*newVectorX/Math.pow(Magnitude(newVectorX, newVectorY), 3) Ey = k*point[i].charge*newVectorY/Math.pow(Magnitude(newVectorX, newVectorY), 3) } } private double vector(double x2, double x1){ return x2 - x1; } private double Magnitude(double x, double y){ return Math.sqrt(Math.pow(x, 2)+Math.pow(y, 2)); }

This bit of code though won’t exactly do anything to the particles. This only gives the E field. The next thing to do it multiply the E vector by the points charge, and you get your force in the x and y directions. You can take this force and get your acceleration from the mass, and then velocity from that acceleration. This would give the x and y coordinates in the direction of the E field given the force. The stuff moves around like there is gravity (which is almost the same!), however, with just this, the points can overlap, which creates an infinite force, and things go really crazy. So from here you just have to implement a collision system and, Bam! A nice little particle system based on the Forces from the E-field generated by the points in the system

Check out two of the examples I made, which model the problem 4.2 and 4.3 from the book Elements of Electrostatics by Matthew N. O. Sadiku:

I wanted to publish this somewhere so that maybe I could remember better if I showed others. Hope you enjoyed this bit of writing and hopefully this might help you with your homework. Thanks for reading!

]]>