Built-in motor protection