This is my totem pole circuit:
It works well, but R32 is too hot.
This is scope:
I changed R32, R34to 470 ohm, but I got the same result:
I think the resistor value is the problem. How can I fix this?
When Q11 is switched on, the voltage across R32 is the full 24V of the power supply. In this state it will dissipate power:
$$ P = \frac{V^2}{R} = \frac{(24V)^2}{1000\Omega} = 0.58W $$
That's enough to cause it to heat up quite a lot. R32 will have to be rated for power dissipation greater than this. If it's a 1W model, or above, then it will be fine.
If you are unable to use a larger power rated resistor (for size concerns, perhaps), then using that same formula you can work out what minimum resistance is acceptable, given some maximum permissible power dissipation. For example, if you want to use a standard 250mW (\$\frac{1}{4}W\$) resistor:
$$ R_{32} = \frac{V^2}{P} = \frac{(24V)^2}{0.25W} = 2.3k\Omega $$
Round up to the nearest available value, from the E12 series, for example:
$$ R_{32} = 2.7k\Omega $$
You have three options here.
Increase the resistance of R32. This means it will pull less current, lowering the power dissipated in the resistor. The higher output impedance of the first stage will lower the peak output current you can achieve and the bandwidth of the circuit, but it should be fine for PWM at a frequency this low.
Use a higher-power rated resistor for R32. If you use a resistor designed to be used at higher powers, designed to dissipate more heat, it won't get as hot because it can transfer the heat to the environment faster. Depending on just how much heat we're talking, you may need to add a heatsink.
2a) If R32 is through-hole, raise it up on its leads instead of mounting it flush to the board. This will help it exchange heat with the environment.
I would go with option 1, personally. Option 3 is also fine, but option 1 also decreases power consumption.
guess
until and unless corrected later (with a compliance current of at least a few mA.) What's the MCU voltage rail? Better yet, what's the MCU? \$\endgroup\$