by s.frings » Sun Dec 25, 2011 6:51 pm
I like to repeat what gllomyandy write in other ords, because it is so important.
It's basically not a good idea to drive the motor against a hard end point using maximum power as the regulated motor class does. Because the NXT motor is quite powerful and may break your parts in half when you do that. The motor has a thermal protection that protectes the electric parts, but there is no protection for the plastic parts.
So better use the unregulated motor class (or motor port) and drive the motor with only as much power as really necessary (e.g. 70%). You can poll the tacho counter every 200 or 500 milliseconds to see whether it changes. If it does not change or changes only a very little, then the motor is stalled.