I'll try to explain the situation from my point of view: when I said that the signal on the gate looks good, I meant that it looks exactly as it should. That is, the driver appears to be working correctly. But, judging by the voltage on the motor, drain, and source - the MOSFET does not work correctly. FET can work incorrectly for only three reasons: 1 - it is not driven correctly, 2 - it burned out, 3 - it is connected incorrectly.
1. Judging by the gate voltage diagram, the MOSFET is controlled correctly, but do not forget that the driver can start working correctly only at the moments when you touch its output with the oscilloscope probe (yes, the probability of this is 1% or even less, but not zero. I saw such situations more than once and this is not a miracle and do not ask me to explain it, just accept as a fact that this sometimes happens).
2. Burning the MOSFET is not that difficult. For example, you can shoot it with static voltage and it will die quietly without any visual effects such as smoke or a cracked package. But you had changed it for a new one which works exactly the same. That can mean, either the new one also burned out or the reason is other.
3. As always, you are confident in the circuit (all people who have experience in electronics for less than 10 years are always sure that the circuit is assembled correctly - this is a tradition
)
So - all three reasons why the FET can not work are excluded, the question remains why does it still not work?
How I would try to find out the problem:
1. unsolder the gate of the FET from the board so that it hangs in the air and check it with a multimeter. In diode test mode, the multimeter should show infinite resistance from the gate to the drain and to the source in any polarity. If it is not so - FET is out of order.
2. If the MOSFET is normal, connect its gate directly to the teensy pin, take a pin that is not connected to the driver and toggle it between 0 and 1 every 5 seconds.
Code:
void setup() {
pinMode(6, OUTPUT);
analogWriteFrequency(6, 20000);
analogWrite(6, 128);
pinMode(7, OUTPUT);
}
// the loop function runs over and over again until power down or reset
void loop() {
digitalToggleFast(7);
delay(5000);
}
Disconnect the motor with the diode and connect a 50-100 ohm resistor instead. (A current of 50-100mA will be sufficient for testing and at the same time will not burn the resistor at the seconds). Check with a multimeter how the circuit works. When the MOSFET is open, there is the full supply voltage should be present across the resistor, the resistance of your open MOSFET is only 40mΩ. When the MOSFET is closed, the voltage across the resistor should be 0. If something is wrong, change the transistor, if it does not help, remove the transistor from the circuit and connect everything with wires to be sure that there is no error in the printed board itself.
3. When everything works, increase the control frequency to 10-20 kHz and check the same voltages with an oscilloscope.
4. When it works, connect the driver between the teensy and the FET gate (although we can create another holy war there about if the driver is needed there
) and check it with an oscilloscope if everything works as before.
5. If everything works, change the resistor back to the motor. Do not forget about the shunt diode across the motor, without it the MOSFET can burn out either immediately or sometime in the future. If it suddenly does not work, return the resistor again and check if it still works with the resistor, if it works with the resistor but not with the motor, try repeating steps 2-4 but with the motor.
6. If you have gone through all the steps and as a result, nothing works, you can sit down and start crying ... But I believe that it will not come to that