This is my first time I have been using a drone. I'm using a quadcopter with a pixhawk running PX4 firmware. I'm testing my drone without props connected to a power supply. When I increase the throttle the motors start spinning normally but when I hold the throttle for a time on the same level, some motors stop spinning. But when I change the pitch or roll, they start spinning again. Is this normal? I'm just a beginner.
Without more detail I can only make one suggestion:
With propellers disconnected there is very little resistance torque so the motors spin up very easily. Any slight differences in the ESC calibrations can cause some motors to stop near to throttle minimum.
You may find that with props connected it just works!
Also depending on what flight mode you are in, the controller is expecting to see some movement and if it is not, it gets "confused" and you will have weird behavior of motors.
Try same experiment and move the quad around so the motors react to the angle changes.
If you select acro mode you should be ok with it sitting still since the flight controller is not trying to constantly perform "auto level" calculations.