C should give about 500ms on/off smoothing
No such thing. C will just form a tank with motor's inductance and will oscillate, not smooth. You want a snubber to keep the motor turn-on and turn-off clean.
100mF is 0.1F - have you thought what happens when you hard-switch such a huge capacitor to the 12V rail? It is in parallel with the motor after all. It'd be equivalent to shorting the rails for a little bit. Bad news all around.
You misunderstood what Andy Aka meant when he said
If you are careful on how you activate and deactivate the two control lines (O1 and O2) you can use (for instance), Q3's drain to activate Q2 (when its position is remedied). Same for the other side of the H-bridge.
Well, you were not careful :) Here's a circuit that will work:
simulate this circuit – Schematic created using CircuitLab
Assumptions in the circuit model:
- motor inductance is 15mH,
- locked rotor current is 2.5A,
- the rotor is locked.
To get a more accurate representation of reality, you should measure the locked rotor current and motor inductance, and modify the inductance and series resistance of L1 to match those. Locked rotor condition places the higher load on the driver than any other condition (other than possibly backdriving the motor), thus should be conservatively used in modeling to get maximum stress on the driver.
Note that when M3/M4 get turned off, there's some current flowing through the motor inductance. The diodes automatically turn on M1/M2 to neutralize motor current. If that's a problem, you'll want to control the top-side switches using a dedicated driver.
Here are the current and voltage waveforms as V1 and V2 get turned on for 10ms each:
You'll have to convert the GPIO levels at least to 5V to drive the gates of M3 and M4. 3.3V GPIO from RPi is not enough.
The snubber resistor R3 should be rated 2W at least with the motor model as shown. The dissipation should be measured (using a current probe and differential voltage probe) in actual circuit, the peak power determined, and the resistor's power rating adjusted accordingly (!).
Do you spot any issues?
Your task is to control a motor. An easy task. You've turned that task into designing a motor driver. That's a hard task. I'd suggest you don't play in hard mode so early :)
Use a proper H-bridge driver chip that takes care of all those details. That's why those chips are so popular. It takes quite a bit of work to actually drive a motor in a reliable fashion (vs. the silly tutorial posts that show such discrete H-bridges with abandon, never mentioning that they didn't get them to work).
Yeah, there's a lot of online "tutorial" posts that show the discrete H-bridges not unlike what you started with. 99.9% of "authors" of those posts never put together a circuit more advanced than a light bulb, battery, and a switch in series - at least if we scrutinize the nonsense they put out.