voltage getting down with L298N and stepper

hi

am trying to build some 3d printer using arduino uno and mega,an extruder,4 nema 17 ,4 L298N but

i have lost 3 bridged till now i can’t figure why

so i constructed som voltage regulator using some resistores and LM317T

and using this code on the mega :

// Arduino stepper motor control code

#include <Stepper.h> // Include the header file

// change this to the number of steps on your motor
#define stepsPerRevolution 60

// create an instance of the stepper class using the steps and pins
Stepper stepperX(stepsPerRevolution, 42, 44, 46, 48);            
Stepper stepperY(stepsPerRevolution, 22, 24, 26, 28);  
Stepper stepperF(stepsPerRevolution, 32, 34, 36, 38);
Stepper stepperZ(stepsPerRevolution, 23, 25,27, 29);





int val = 0;

void setup() {
  Serial.begin(9600);
  stepperX.setSpeed(350);
  stepperY.setSpeed(350);
  stepperZ.setSpeed(250);
  stepperF.setSpeed(200);

}

void loop() {

  if (Serial.available()>0)
  {
    val = Serial.parseInt();
// stepperX.step(val);delay(500);
//stepperZ.step(val);delay(500);
stepperY.step(val); delay(500);
//   stepperF.step(val); delay(500);

           


    Serial.println(val); //for debugging
  }
 

}

i get voltage going down when sending step and still down untill i press reset button
is it normal?

in the other hend the motor stop turning well when voltage is under 6v and the bridge get hot

can i get more explanation why that happen

Post a link to the stepper motor.

The L298 is a brushed DC motor driver, and is not a suitable for most modern low-impedance stepper motors.
Leo..

You should find stepper motor basics helpful.

Jones on steppers is more advanced.

there is motor model

https://www.hotmcu.com/nema17-bipolar-48mm-stepper-motor-p-183.html

1.25ohm coils, and 2.5A max coil current.
That definately needs a beefy stepper driver.
An L298 is totally unsuitable.

You also need a 12volt supply (or >= 24volt supply if you need speed) with the right current rating for four motors.
Leo..