Floppy drive motor and L298N

Hello!

I'm trying to drive a stepper motor I got out of the head positioner part of an old floppy drive.

I'm using the "Stepper" library, and run the 4 Arduino pins to the 4 input pins of a L298N, with the power output side running from a separate 12V supply. As far as I can tell I then set the resistors off pin 1 and 15 (current sense) to give me the correct current to drive the motor. It seems to work ok with LEDs and 2k resistors. If I swap the LEDs for the 4 wires of the motor (which a multimeter shows to be 2 coils about 2ohms each, and opposite pairs in high kohm/Mohms) it doesn't work. I can decrease the resistance down to 20ohms (to increase current) where it jitters more, but with 12V/10ohms that should be about 1.2A ignoring losses in the L298N. Would it really need that kind of current? It's only a tiny positioning motor that turns a worm gear? I could try lower but the IC gets hot as I currently don't have a heat sink, and my resistors don't have the power rating.

Any ideas? Should it really need more current than that? Or is there a problem with my sequencing or something?

What kind of steps per rotation could I expect as well (obviously it must be quite sensitive to read a disk head)?

Thanks! :slight_smile:

The sense resistors should be much lower value than that, they are not current-limiting in function and should not have more than a small fraction of the power supply voltage across them.

If you are not interested in monitoring current you can omit the sense resistors and connect the sense terminals to ground.

Since you motor is low impedance you need to reduce the average current from what the supply voltage would put through it, so use PWM on the enable pins to control this. You can then use current sensing to dynamically set the PWM value as the motor speed changes... Alternatively just set the PWM value to ensure the correct current when the stepper is stationary and leave it fixed.

You may need flywheel diodes too, given that the datasheet doesn't show built-in flywheel diodes.

You mean the 4 diodes between ground and the motor lines, and 4 from motor lines to the +ve supply? If so I have them.

So you use PWM to reduce the continuous power, whilst keeping the same peak voltage/current?

Can I use the PWM pins and the stepper library together? How would I do that? Any links to any sample code you know of?

Thanks for the help! :slight_smile:

Can anyone tell me how I'd use PWM in relation to the stepper.h library?