I've experienced a similar problem before. For me, the root cause was insufficient battery power. When my motor tried to draw peak power it caused the battery supply bus to brown out. This led to supply voltage dropping below the minimum rated voltage for the motor controller. The master board was fine as the brownout voltage was still above that minimum.
When the motor controller browned out it cleared its own enable bit and the motor stopped responding. Additionally, it required a certain "arming" sequence before it would respond to speed commands, and I had only programmed those to be sent on initial startup. Since the master board was never reset, the master continued sending valid speed commands to the motor controller, but the motor controller failed to respond because it hadn't been (re-)armed.
Potential solutions for you:
- Check that your existing battery is actually fully charged.
- You can add more batteries (or battery packs, depending on your configuration) in parallel to boost your supply capacity. As with all batteries, they should all be fully charged before you connect them all together.
- If your issue is that your controller is getting reset, you could provide two different batteries. One larger battery to run the H-bridge chip and the motor and a (not necessarily) smaller battery to run your controller. You will need to ensure that the controller, H-bridge, and motor all share a common ground or the H-bridge may fail to respond to PWM signals. This is a less-desirable option, because the motor response will be limited by your supply power (they'll accelerate slowly), but it's a quick/cheap fix if your existing batteries are hard to source.
- You could try adding a capacitor as jdios said. I would argue it would be better to use a large capacitor on the battery-supply-side of the H-bridge than to put it next to the motor, but just because the motor is bidirectional. Large capacity electrolytic capacitors are pretty easy to come by, but they're polarized. As I mentioned in my comment in jdios' post, the capacitor does smooth voltage, and it provides a short-duration current surge during high-demand conditions by preventing the supply voltage from falling.
Mark Booth's answer is also valid, and would probably be my go-to answer (it was how I solved my own problem), except for the fact that you're trying to do control. Adding a rate-limiting scheme as described there is effectively creating an actuator saturation limit, which then will cause more problems for your controller (control windup).