Summary:
Remove all diodes except maybe D1.
Use a lower Rdson FET if you can.
Change R6 to as low as you can for now - 100 Ohms would not be too low, but ...
Provide an active FET gate pulldown - just am emitter follower, for much improved turn off times.
Run PWM as slow as you can tolerate.
You do not need D1 and D2 - remove either one.
If PWM+ is always positive wrt PWM- you do not need either of D1 or D2.
If PWM+ - PWM- is AC then placing D2 across the opto input with reverse polarity will place about equal load on PWM with both polarities of input. This may or may not matter.
D4 is not needed.
D3 is not needed.
Now for the hot stuff. You can like to use whatever you wish, but you may have to rewrite the laws of physics. The IRF540 has more Rdson than you want even when driven well - and the 4.7K turnoff resistor ensures that it has a slow and horribly hot turn off. Changing R6 to as low as you can stand will help heaps. With eg R6 = 100 R, IR5-R6_on is < = about 100 mA which is sad but only maybe 1% of your load current. Adding an emitter follower pulldown driver for turnoff will help immensely.
And it will still almost certainly be too hot. See below.
Changing to a MOSFET with Rdson more like 10 milliOhm or lower will help immensely and actually allow you to do what you want IF you do it properly.
IRF540 data sheet and another like unto it - almost
At 84 Watts load at 12V Il = 7A.
If you have say about 10V Vgs then at 10A an IRF540 has
at 25C by fig 1 - about Vds = 0.35V TYPICAL
and at 175C by fig 2 - about Vds = 1V TYPICAL
In the first case as 7A you have about 2.5W dissipation at 25C TYPICAL and in the second case at 175C = 7 Watts.
Both of those are TYPICAL and both are with 20 uS pulses. ie reality will usually be worse.
The TO220 pkg has 62 C/W Rjc and
the D^2Pak claims 40 C/W Rja with 1" square FR4 PCB.
So TO220 rise with no heatsink =
= >= 62 C/W x 0.35 W at 25C = 22C rise
so Tj ~= 47C.
This is enough to start it up the pernicious -> hotter -> more Rdson -> more temperature rise -> more Rdson ... curve.
At 1 Watt you'd have 62C rise = Tj = ~~~ 90 C.
So it should not get that hot TYPICALLY as the 1 Watt is when Tj = 175C
were it not for the fact that this data sheet was influenced by marketers and tobacco salesmen and they use a 20 uS pulse width. And it's also typical. So say 100-120 C would be expectable. Your very very very slow turn off will add the coup de grace.
The circuit below shows two emitter followers as a gate driver.
Added:
Related only - high side driving 'trick'.
This is Olin's P Channel high side FET gate driver cct.
He says it achieves 200 nano-second switching.
Note the special magic from having R14 present, what that dos tohow Q2 works and the roles of R15 and R14. You should understand it yourself , but:
R14 makes Q2 an emitter follower "sort of". R14 is now driven to 1 Vbe below Vin high. Note the "no series resistor note.
HOWEVER, R15 is (here) 45 x R14 so as R14 voltage rises R15 will drop 5 x as much.
So if Vin rises from 0V to ~= (3.3-Vbe) = say 2.7V, R15 will drop 5 x 2.7 ~= 13.5V. Thi provides all the drive needed but the gate of the FET does not need a zener clamp to prevent overdrive.
Best Answer
Using the example of case temperature being controlled/limited to 25 degC, the spec says you can dissipate 71 watts. Now look at maximum junction to case thermal resistance - it says 2.1 degC/watt.
So, for 71 watts I would expect the junction to rise to 149 degC above the case. This ties nicely with the case being fixed at 25 degC because 25 + 149 = 174 degC - ok a slight discrepency with the stated max junction temperature.
8 watts would raise the junction by nearly 17 degC above the case. However using the "Maximum Junction-to-Ambient Steady-State" value, 8 watts will raise the junction up to 8x50 degC because now, the case isn't "held" at some value. This is why you need a heatsink.
If you went for a heatsink that was rated at 3 degC per watt (case physical connection to ambient), you use that figue (3 degC/watt) plus junction to case (2.1 degC/watt) to get a combined number of 5.1 degC/watt. Thus, for a junction temperature of not more that 175 degC in a controlled ambient of 25 degC, the temperature rise of 150 degC divided by 5.1 degC gives you the max continuous power i.e. 29.4 watts.
A heatsink of 16.65 degC/watt would be on the cusp of tolerating an 8 watt internal dissipation because 16.65 (external) + 2.1 (junction-to-case) = 18.75 and 150/8 = 18.75.
Does this help? Maybe these simplified pictures will: -