Problem with linear servos

Got a bunch of micro linear servos like this one: https://i.imgur.com/WUjNxe3.jpg

And so far 3 commited suicide.

My usual go-to for servos is making a testing sketch, finding the positions I need in microseconds (1000 and 2000 in this case), then write the code.

Whenever I press a button, the servo moves from one position to the other.

void loop() {
    if(initialPosition) {
        servoTopPos = servoTopEndPos;
    } else {
        servoTopPos = servoTopStartPos;
    }

    servoTop.attach(servoTopPin);
    servoTop.writeMicroseconds(servoTopPos);
    delay(350);
    servoTop.detach();
}

For the typical rotary servos, a detach means the servo stops commanding the motor and doesn't hold the position, you can move it freely by hand. But for these ones, it doesn't work like that. Unless I ground the PWM pin in the servo, it will always hold the position. Ans sometimes, don't know why (maybe it's stuck at the end of the screw) the servo keeps feeding current until I realize it smeells toasted and then it's too late.

Any ideas on how to avoid that and stop wasting money?

Please post the entire code.
Drawing a wiring diagram showing the power distribution could be valuable for helpers.

Those servos work on a worm gear. There's no way to safely move them freely by hand.

And detach() actually just stops sending a control signal to the servo.

Steve

Do you mean the signal pin ?

The output of these servos is driven by the horn running along a threaded rod so no wonder that it holds its position when detached. It also probably explains why it sticks if driven too hard to the end of the threaded rod

When I say "by hand" I mean that if I rotate the big gear I can move forward and backward the knob, but it makes some resistance and goes back to its position even after a servo.detach().

After that, if it disconnect the signal pin from the servo and connect it to ground, I can repeat that operation without the servo making any resistance or moving back to the last given position. That's what I find strange.

Normally servos only fail like this (cooking themselves) if you prevent the output from moving, thus stalling the servo's motor. Sometimes its possible to command the position
past the hard-stops, which will have the same effect...