Stepper motor, oneRevolution example is not accurate

Hello everyone,

My first post on this forum, so pleas be gentle with me :smiley:

I have a Stepper Motor, the 42BYGHW811 connected to an L298N.
Now the 42BYGHW811 is supposed to have 1.8 degree per step. this makes 200 steps a revolution.
Well the problem is, this is only a quarter of a revolution. I tried to set it to 800 and that didn't work either.

I tried fiddling with it and setting the speed to 255 and the steps per revolution to 1500 works. but it makes around 1,5 revolution.

My wiring is as follows.
IN 1,2,3,4 to pin 8,9,10,11
a 20.4V supply to GND and 12V+ (i took the 12V cap off)
a common ground to the arduino and the 5V to Vin on arduino.
And ofc. the coils wired to both sides. (I measured the pairs :))

You need to make a simple drawing of all your wiring connections and post a photo of the drawing. It is too easy to misunderstand verbal descriptions.

This seems very strange to me

a 20.4V supply to GND and 12V+ (i took the 12V cap off)

Why have you an 20.4v supply and a 12v supply?
What is a 12v cap?

Post a link to the datasheet for your stepper motor.

...R
Stepper Motor Basics
Simple Stepper Code

The Vin pin needs at least 6.5 - 7 V but no more than about 15.

When I search for 42BYGHW811 I find a 2.5A, 1.25ohm low-impedance stepper.

You cannot drive that from an L298N, its a high current, current-driven bipolar steppper.

You must use a chopper driver like a DRV8825 (except that cannot handle 2.5A). A Geckodrive
or something similar perhaps?

The sort of motor you can drive with an L298N is a DC motor, or a high impedance stepper
motor (40 ohms perhaps) if you don't mind it being very slow.

a 20.4V supply to GND and 12V+ (i took the 12V cap off)
a common ground to the arduino and the 5V to Vin on arduino.

All of that sounds very suspect or wrong. (except the common ground)