The problem I am trying to solve is related to a window motor, and a "what if". The configuration back in 1987 for the window motor didn't include an MCU. It was just a switch directly connected to the window motor. If you pushed the switch to the up position, it routed +12v to the A leg of the window motor. If you pushed the switch to the down position, it routed +12v to the B leg of the window motor. The motor is attached to chassis/ground.
I will be controlling the motor with an arduino in the middle. The code will prevent both up and down (D11, and D10) from being high at the same time. BUT, what if the MCU malfunctions and we get +5V going out from both? We don't want the magic smoke to come from the heavy guague wiring and/or motor. I'll have a fuse in the mix, but I'd also like an additional layer of electronic design failsafe to prevent the +12v from being supplied if both D11 and D10 are set HIGH at the same time.
I am a beginner in electronics, and came up with this design today. It denotes VCC and GND as "A" or "B". Circuit A is the 5vdc Arduino. Circuit B is the 12vdc vehicle. They share connections at some points in the diagram where one is used as gate and the other as the load passing through the MOSFET.
The premise of the design is that the NAND will send a HIGH signal to the N-Type MOSFET (U3) in the middle of the design (allowing +12V to reach U4 and U5) unless HIGH is being sent from both D10 and D11 concurrently.
I'm worried that the +5V from D10 and D11 after passing through Q1/Q2 gate control will reach U3 and trigger the gate with a HIGH signal. Can anyone confirm this?
Sorry I can't answer your question about the gates, but I have a similar setup for one of my projects, and I'm using a couple of relays to control the motor like this:
Your software will stop outputs D10 and D11 from being HIGH at the same time.
All you need is two MOSFETs, but some extra hardware as your output MOSFETs will not operate correctly with 5V gate drive on high side N-CH MOSFET with 12V supply.
Simplify your circuit, and put a fuse in the power line of the motor.
Have you measured the stalled rotor current of the motors?
Do you know the normal running current of the motors winding UP and winding DOWN.
Nice schematic, It saved all of us a lot of time. No insult but I suggest you spend some time researching MOSFETs and how to implement circuits with them. Your schematic has a lot of errors and will not work as drawn.
When using a MOSFET the Gate always references the source for its voltage. N MOSFETs need a voltage positive to the source, P MOSFETs measure negative to the source to turn on. I would also recommend you read this application note: AN2689 by ST on automotive electronics. reading it will help you a lot. Good luck.
Have not measured current yet, but I have procured the current sensors that will be used to measure the current, and I've removed the doors so they're ready to setup in a lab to measure. Part of the goal is to add auto-up and auto-down. To accomplish this, my thought was to monitor current to determine if the motor has reached limits or is moving. Based on what I could find online prior to obtaining measurements, I was seeing a current of <=20A @ 12-14vdc.
I will research Automotive High Side Switching MOSFETS. I had been looking for MOSFETS rated for >=30V and 40-60A.
I know that this should never be needed and is over-engineering the solution. The code doesn't allow both outputs to enable concurrently -- but computers don't always do what is expected. I'm in the middle of a frame-off resto-mod. If I can add an extra failsafe in the design, why not?!
Added note... I am questioning the information that the design is based on. Namely, that the motor is grounded, and direction is determined by which leg the +DCV comes in from. I don't think GM was what clever or complex making an 87 Suburban. It's more likely that the polarity is reversed based on switch position, and one of the legs IS a ground. I will have to bench test this.
I can easily accomplish all of this with some relays, but relays are loud and clicky. I'm looking for silence from the components (other than the motor).
I wouldn't have put together what I did without first researching. Unfortunately for me, this is a very new topic and it's taken a lot of reading, brain-getting-full, resting, reading, brain-getting-full, resting, cycles.
Thank you for the mention to application notes. It looks like a good read so far.
I've spent more time today on the learning loop, and saw many errors in my previous diagram. I hope I'm getting closer to correct. The below is simplified in that it only includes a NAND gate and a N-Type MOSFET behind it to allow/disallow the 12vdc source . If I'm still wildly off, please point out anything specific I can look at.
Thank you!
*PS Disregard any part numbers listed on the schematic. I was just pasting generic symbols. Parts would be selected to meet or exceed double the maximum expected load.
You have come a long way. Next thing is to add labels to the signal lines that indicate a function like forward, stop, etc. I expect the motor to pull from about 15 to 30 amps when running.
A simple rule for MOSFETS, when switching P for Positive and N for Negative. You used the wrong symbols but labeled the P parts correctly. On this schematic you only need the output MOSFET, a 10K resistor to ground from the port pin and a 100 ohm from the port pin to the gate. The 10K keeps it off during reset etc. The diode in the source will give you problems, it will fry with the load and reduce the Vgs by about 0.7V, its forward drop.
I'm 1000 miles away from my home at the moment, so I can't walk out and run a test. That's why I'm focusing on the NAND logic and gate control of 12V. I can separate the job into two segments.
Turn the juice on/off
Apply the juice appropriately to set the direction
For the second half, it's probably a good idea for me to work out the solutions to both options as it will help my understanding grow. I won't be implementing either solution on the actual vehicle for many months. When I return home, the first job is to complete the second gantry to lift the front of the body, allowing me to roll the frame out. Restoring the underbody and chassis will take me the rest of the summer. During which time, I'll be taking small diversions to work out the electronic enhancements. This way I'm not rushing anything and have plenty of opportunities to "sleep on it", consult with those who know much more than I, and iteratively improve upon ideas. By the time I'm ready to implement on the vehicle, I hope to have solid designs as well as fabricated casings, connectors, and support documentation. At this time, I'm exploring control of:
Lighting (interior and exterior) - enable/disable power to systems for functionality with protection against draining the battery.
Window control - extend access for a period after the ignition is turned off AND gain auto-up/auto-down options for the front windows.
Air Conditioning Control -- Temperature Sensors, Fan Control, Vent Control, Blend Valve Control. Removing the radio and AC from the dash should open up a block for a touchscreen system to be cleanly installed.
Seat Belt Alert, Door Open, etc... ECU is not compatible with the new engine, so ancillary alert functions will need to be replaced.
Other engine sensors out-of-bounds
But you eat an elephant one bite at a time. Today's bite is NAND logic to control 12VDC source to a window motor. Next week may include time to validate the motor wiring and work on the second half of that control.
That may be shelved for a bit while I get familiar with the AN2689, and then re-visited with additional hazard mitigation in mind. If I can learn something each day, then every day is a good day.
$ 1 0.000005 10.20027730826997 50 5 50 5e-11
f 208 288 272 288 32 1.5 0.02
f 208 352 272 352 32 1.5 0.02
f 176 192 224 192 33 1.5 0.02
f 272 192 320 192 33 1.5 0.02
w 224 208 224 240 0
w 272 272 272 240 0
w 272 240 224 240 0
w 272 240 320 240 0
w 320 208 320 240 0
w 272 304 272 336 0
g 272 368 272 384 0 0
L 112 224 64 224 0 0 false 5 0
L 112 256 64 256 0 0 false 5 0
w 112 224 112 192 0
w 112 192 176 192 0
w 176 192 176 288 0
w 176 288 208 288 0
w 112 256 144 256 0
w 144 256 144 352 0
w 208 352 144 352 0
w 144 256 144 144 0
w 144 144 272 144 0
w 272 144 272 192 0
w 320 176 320 112 0
w 320 112 272 112 0
w 272 112 224 112 0
w 224 112 224 176 0
R 272 112 272 64 0 0 40 5 0 0 0.5
w 384 208 384 160 0
415 416 -128 352 -128 0 0.5 1 0.15 0.15 0.02 0.05 1 0
g 384 256 384 288 0 0
R 384 -240 384 -272 0 0 40 12 0 0 0.5
w 352 80 384 80 0
w 384 80 384 160 0
w 416 80 384 80 0
w 112 32 112 192 0
w 112 256 112 432 0
w 112 432 464 432 0
w 464 32 464 432 0
f 320 240 384 240 32 1.5 0.02
w 384 208 384 224 0
f 304 -192 352 -192 33 1.5 0.02
f 464 -192 416 -192 33 1.5 0.02
w 416 -176 416 -128 0
w 352 -176 352 -128 0
w 352 -128 352 -80 0
f 304 -64 352 -64 32 1.5 0.02
f 464 -64 416 -64 32 1.5 0.02
w 416 -80 416 -128 0
w 384 -240 352 -240 0
w 352 -240 352 -208 0
w 384 -240 416 -240 0
w 416 -240 416 -208 0
w 352 -16 352 -48 0
w 416 -16 416 -48 0
w 304 -192 304 -64 0
w 304 -64 304 32 0
w 304 32 112 32 0
w 464 32 464 -64 0
w 464 -64 464 -192 0
w 352 -16 352 80 0
w 416 -16 416 80 0
o 29 64 0 4099 0.01953125 0.0015625 0 2 29 3
If you've never used Falstad's circuit applet, copy that text and go to File > Import From Text and paste it there. You can click on the "L"ows to turn them "H"igh and play with the logic.
The FETS look much better. Now look at the gate voltage during the transition from on/off/on/off on the bridge FETs, then compare that to the Vgs ratings of the MOSFET. You will find that you will have both a P and N FET on at the same time on the same which will try to short the power supply. If they switch fast you will just get a heavy spike which is called shoot through. The current can get into the 100A range or greater during the spike system dependent. Do not get discouraged you are getting better.
Your logic looks good but it will not work as intended. The 5 lower MOSFETs could be replaced with some logic gates. The N Fet at the negative side of the bridge can be eliminated. Designing a bridge is not a easy task, there is a lot that is going on that is not apparent.
If you want to cheat like I do I would use a BTS7960 bridge module, they can be gotten for less then $5 US.
If there is a concern that gate switching time could cause shoot through, would adding a resistor at the ground pin not resolve that?
I don't see any condition where both N's and P's would be enabled outside of a race/timing issue during state change. However, I do see where I attached a wire wrong. The signal to U6 should be between Q1/Q3 and U2/U5. With the wiring correction:
I'm using "on" and "off" to mean current can pass between Drain and Source.
If D11 is HIGH then Q1 is Off, Q3 is on, U2 is On, and U5 is off. Current passes through Q3. U5 blocks the current from being pulled low so U6 receives a HIGH state and is enabled.
If D10 is HIGH then Q1 is On, Q3 is Off, U2 is Off, and U2 is Off, and U5 is on. Current passes through Q1. U2 blocks the current from being pulled low so U6 receives a HIGH state and is enabled.
With D11 and D10 set LOW, current passes through both Q1 and Q3, but is blocked from being pulled low by U2 and U5. U6 receives a HIGH state and is enabled.
With D11 and D10 set HIGH, Q1 and Q3 are disabled. U2 and U5 are enabled, pulling U6 to ground / low.
Sorry I was not clear, I was referring to godred's schematic. Example, not real numbers, just keeping the math simple; assume the P and N devices turn on with -5 and 5 volts referencing there respective sources. Your gate drive is 15V. Referencing the source of the N FET when the gate gets to 5V it will turn, the P device is on and will not turn off until its gate gets to a -5V or reference the N FET source 10V. There is a 5V overlap where both would be on. You have do delay them to be sure only one is on at a time. Hopefully this helps.