I have a somewhat interesting situation regarding the digital output of the vex controller. I’m trying to open/close a mosfet using the 5 volt output from the vex controller but I’ve run into a bit of a snag.
First of all, I’m using a converted PWM cable to go from the controller to the circuit. The problem is that as soon as I turn on the controller, I’m getting a continuous voltage.
Should there be a voltage as soon as the controller turns?
I have written a program which should turn the outputs on and off but I am still getting a non-stop voltage no matter what. Does anyone have any idea as to what I might be doing wrong? Should I use a different cable setup?
Also, which of the three pins carry the voltage? Just from checking with a multimeter it seems that both the red and white wires carry a current, is that how its supposed to be?
It is normal to get continuous voltage across the Red/Black wires. The +5V source (Red) is constant and is not switched on/off with the port. The signal wire (White) is what gets switched on/off, but that can’t source very much current (a few mA).
Given the low signal current, you might find it hard to get the MOSFET to fully turn on. If that happens, it’ll present a higher resistance, which will cause it to get hotter under load than it otherwise would.
What MOSFET are you using, and what load are you trying to drive?
Will you be driving the H bridge as a PWM (variable speed) drive, or just a basic “Forward - off - reverse” drive?
I ask, because a PWM drive requires fast switching. A MOSFET being driven from a low-current source (like the VEX) will not switch quickly, and may not switch on fully. If you just want basic control (no PWM), then that will be less of an issue.
I don’t have a ton of experience driving MOSFETs (I tend to just make do with BJTs), so I can’t give you an exact schematic to try.
I’d recommend breadboarding the most basic circuit (Gate to White, Source to Black & -24V, Load goes between +24V and Drain) and see how that works. Try measuring the voltage drop across the Source and Drain pins while it is driving your load. That’ll give you an idea how completely the MOSFET is turned on, and will let you know how much power it is going to dissipate.
If you find that it isn’t switching fast or fully enough for your needs, then you can add a MOSFET gate driver (you can just use a transistor, or they make driver chips for this).
I will be using a basic forward -off -reverse drive.
I have already soldered together a circuit that does basically does that (I can post pictures if you want). The problem is that I’m getting a continuous current out of the controller and I can’t figure out how to stop and start it. My program doesn’t seem to be doing anything. And yes I really need to be sure that it is opening/closing fully or else I will ruin some very expensive motors.
Where should I start looking for a MOSFET gate driver which will work with the vex setup?
Well after a little tweaking I managed to get the circuit working and the voltage is opening and closing the MOSFET. Now the other thing I need to know is whether there is a way to ensure that the MOSFET completely shuts down, or that the signal is off before the other signal is sent. Is there some sort of fail-safe device or code I can put in my program?
If you want to do this in hardware (the most fail-safe), you can use some logic gates to ensure that you don’t activate both the FWD and REV MOSFETs are the same time. Here is an example schematic using a single 7402 (or 74LS02) chip:
You can do the same type of thing in software, but given the amount of power that would go through your H-bridge if you hit a bug, I’d recommend that hardware approach.
wow that was what I call stinkin thinking if both of them are off at the first set of gate that outputs a 1 which locks out both of the second set of gates… the only possible way this can turn on is if one is on and the other is off…
Here is the diagram showing the chip pinout. Most of the connections are pretty simple (since the gates in the chip are arranged just like the gates in the schematic). Pins 2 and 12 are the “crossover” pins that lockout a MOSFET if the opposite input is on.
Thanks… that is what we needed was the pin assignment. Funny how chatting with Digikey for a half hour I learned more than an entire quarter of College electronics class:mad: Guess that is what you get with a very bad prof.
In the defense of Educators (most of my Family are/were Primary and Secondary Education Teachers, I had a Great Aunt and Uncle that were College Teachers), what you learn is a class, might be very general, and if you ask them for a Specific Solution, you might get a very Specific Answer.
oh I am by no means going against educators… I am a teacher! The prof I had was a very smart man very smart, but he was not a teacher… he was not able to get the info out of his head… we were to make it through like 12 chapters in the class and we made it through 4! Please dont take that as a bash on teachers!