How to fix motors jerking when changing directions with an Arduino and l298n?

December 31, 2023, 19:39

war_car

I have an L298N motor that when used with delay() to switch the direction of the motors, it will jerk when changing the direction. The video attached shows the motors trying to change from left to right every 1 second, but also shows the jerking My code: https://pastebin.com/fYnawSvE

kutuptilkisi

Thats how physics work?

kutuptilkisi

Thats not something you can change unless you have a controller which can change output

war_car

I don’t know much I assume the l298n is the controller?

kutuptilkisi

ye

war_car

Okay But if that’s normal I’ll see how it turns out in the end, I just thought it would be smoother

k9t33n

that's called inertia lol

k9t33n

if you don't want it as badly slow the changing in direction down

war_car

Yeah I was thinking of changing the speed then getting the direction changed Makes more sense now thanks guys

k9t33n

np