Motor Controller Issues

May 16, 2024, 04:20

themuffinhead

Hey, I got this motor controller, it’s an L298N motor controller. I’m trying to power a 12V 60W DC motor through it. When connecting directly to the power source, the motor runs fine, but when hooked up to the motor controller it gets weird. The motor is completely unpredictable with starting and stopping whenever I enable the pins, and sometimes just pulling out an input wire from the RPi onto the motor controller just starts it, only for it to stop when putting it back on and then either stopping on its own or just stopping randomly after putting the same wire in and out over and over. I got my code from here: https://www.electronicshub.org/raspberry-pi-l298n-interface-tutorial-control-dc-motor-l298n-raspberry-pi/

themuffinhead

By the way, I noticed that if I get the IN2 pin off at the right time, the high and low commands work, but I had to switch them for some reason

themuffinhead

I would take that as a win if it weren’t for the fact that I am now unable to change its direction

themuffinhead

Update: I moved the yellow wire to go to the same port as the black wire that’s on the bottom side of the picture based on a video I saw. It worked a little better in that IN2 hasn’t been an issue, but it still can’t go backwards.

themuffinhead

Thoughts?

oops.se

Have you followed the schema in the URL? And the plier beneath the L298N module can shorten it and create everything from unpredictable actions to "the magic smoke".

themuffinhead

Funny story

themuffinhead

That just happened

themuffinhead

Should’ve checked this earlier

themuffinhead

I took apart the wiring and redid it, and now I can control forward motion perfectly

themuffinhead

But it’s still not able to reverse direction

themuffinhead

Which is confusing

themuffinhead

Update: When I make it backwards, the power light flashes on and off

themuffinhead

Update: Magic smoke happened, nothing is working but the motor still runs when directly supplied so we’re redoing the wiring with a different driver

riothedev

damn

oops.se

Wheres the "Funny" part!?

themuffinhead

Idk just shoulda checked this earlier before the wire melted

themuffinhead

But the problem still persists

themuffinhead

But only on lower voltages

themuffinhead

Direction change is ok now so we should be fine