Monday, July 29, 2013

Today was a good day. Alfred is going to move! I'll let you see for yourself:
Some of the problems I ran into and how I fixed it:
-Heat-sinking. I needed to heat-sink the P channel MOSFETs because they were getting too hot and started smoking. I just soldered a piece of copper to it.
-It turns out the N channel MOSFETs I was using required a greater gate current than the Arduino was producing. I replaced them with logic level N channel MOSFETs.
-The NPN transistors were pulling too much current from the Arduino. To fix that I just put a 1K resistor between the pin and the base of the transistor.

So yeah, once I fixed those issues the H Bridge started H Bridging. I plan on getting this on a perfboard and installed in Alfred as soon as possible. Now to start figuring out how to program line following...

Thursday, July 25, 2013

So I haven't blogged in a while because I really wanted my next post to be a success story but I really should post all the failures because you learn just as much from them. So here we go:

What I've learned from my earlier H Bridge failures is I can't use 4 N Channel MOSFETs like I was doing without something called a high side driver. Basically, the source of an N Channel MOSFET needs to be directly connected to ground. In my H Bridge design the source of the top two MOSFETs led to the motor and then the bottom MOSFETs. In order for that to work I would need to drive the top two with a higher voltage using a high side driver. In order to fix that I would need to replace the top two N Channel MOSFETs with P Channel MOSFETs. Also, to protect my MOSFETs from voltage spikes when switching (which have destroyed a few of my MOSFETs) I would need to use protection Schottky diodes (just diodes that switches very fast) on the MOSFETs with the cathode at the source and the anode at the drain for the P Channel MOSFETs and vice versa for the N Channel MOSFET. So that design will look a little bit like this:

^^don't mind accidental gate wiring error (crossed)^^
or this:


...which better illustrates where the problem in this design was. See, since we are using P Channel MOSFETs now, we need to use pull up resistors instead of pull down, and if the Arduino were to come into contact with that 12V wire it would destroy the chip. So now we need to use NPN transistors to ensure there is no direct contact. It'll look like this, except on both side sides:

or this:

However, it doesn't spin the motor and now I'm have this problem where the P Channel MOSFET that's getting power starts smoking which I assume is bad. I'll keep updating if anything changes. In the meantime I've been learning Java in preparation for getting the line following to work which is also why I haven't been posting too much. Anyways, back to work.

Update: So I was looking at the breadboard in the above picture and realized I wired something wrong so I changed that and tested it. Now instead of smoke, nothing happens. I guess that's better but I would really like for the motors to spin.