@Johansen
How big the capacitor should be?
So there is a 24Vdc, 26A, 500W motor while will be responsible for the transportation of the device.
depends on the supply side inductance.
the issue is energy stored.
suppose you have 10 uH, and the motor is pulling 30 amps
The 4.5mJ of energy stored in the thin air between the battery and the h bridge will continue to go somewhere when the h bridge turns off.
if the pwm frequency is 20,000 hz, that's 90 watts of power... again, it will find some place to go.
suppose you have a 10uF capacitor across the H bridge.
when the fets turn off, it will be charged from 24 volts to about 42 volts.
this isn't normally a problem for say, 60 volt mosfets, but 50% voltage ripple is insane, and will cause small electrolytic caps elsewhere on the circuit to explode.
generally, the issue isn't how much capacitance do you need, but rather, can they handle the ripple current.
100uF would be enough in this case, which is trivial for an electrolytic, but they need to be able to handle the ripple current, which for instructional purposes only, is equal to the peak motor current you expect to pull.
note however that the distance between the H bridge and the capacitors is critical, the wires must be as short as possible.