I am having trouble with my Nema 17 motor (Y axis) because is falling

I am having trouble with my Nema 17 motor (Y axis) because is falling down after executing a command. The weight of the gantry is low compared to the theorical capacity of the motor.

What Firmware are you running? By default many turn the Steppers off after fraction of a second. So you are fighting gravity since yours is a vertical application. Step

In GRBL it is $1

$1 - Step idle delay, milliseconds
Every time your steppers complete a motion and come to a stop, Grbl will delay disabling the steppers by this value. OR, you can always keep your axes enabled (powered so as to hold position) by setting this value to the maximum 255 milliseconds. Again, just to repeat, you can keep all axes always enabled by setting $1=255.

Thanks!
It works great. I change it to 255.

@Gerardo_De_Nicolas keep an eye on the stepper heat. If you keep them on you may need to address the driver current lower so it doesn’t over heat the steppers while sitting idle.

@Kelly_Burns Thanks Kelly, I added the heatsink to every NEMA motor, and I try to turn in on only as required.