many thanks H500
I didn't draw any schematic just used single L298 for each phase , connect tied input & tied currents sense to Atmega, I've decide to simulate the L297 performance with Atmega chip.
you mean in my code,current exceed the set value long before I check it and led to overheat and vibration? is there any way to calculate the optimum chopping frequency for specific voltage?

My best regards