Schematic PWM motor control feedback
The MOSFETs used for controlling the motor are rated at 20 volts maximum voltage and this, in my opinion is too close to the nominal 18 volts supplied from your 18 volt battery. I would make the MOSFET maximum voltage more like 30 volts.
If the 40 amp current perfectly shared for each MOSFET then that would be 20 amps per device. However, the MOSFETs will get warm and this will raise their temperature and raise the on-resistance possibly to around 30 mΩ at a junction temperature of above 100 °C. This will dissipate (in each MOSFET) a power of 20² x 0.03 watts = 12 watts and I don't see anything about the copper-area heatsinking you might have formed on your circuit board.
I am also concerned that the data sheet isn't clear about the safe operating area especially at longer on-periods other than 1 ms: -

The 32 amps and 1 volt lines indicate an on-resistance of about 30 mΩ.
I would strongly urge you to look at data sheets from other (more recognized) suppliers to see how the safe operating area curve might be applied for longer on-duration periods.
You need to work on this if you haven't considered it. You also need to reckon that the MOSFETs won't equally share current so I would use a 2:1 factor for this and this suggests to me that the maximum continuous current rating of 30 amps (per MOSFET) is inadequate.
The back-emf protection (D3) isn't clear in your schematic. This also needs to be rated for well-over a peak current of 60 amps in my opinion.