Support » Pololu Simple Motor Controller G2 User’s Guide » 3. Getting started »
The Errors box in the Status tab of the Simple Motor Control Center G2 shows problems that are stopping your motor.
The Simple Motor Controller G2 has several features that stop the motor when something is going wrong. These are called errors, and they can help protect your project from damaging itself. Whenever you are having an issue with the controller, you should first check to see what (if any) errors are occurring. You can get information about the errors by:
- Checking the Errors box in the Status tab of the Simple Motor Control Center. This is recommended because it gives you the most information, including a running count of how many times the error has been reported.
- Running the command-line utility (just type
smcg2cmd -sat the command line).
- Looking at the red LED on the device. It will be lit if there are any errors stopping your motor.
- Writing PC software or using a microcontroller to send the “Get variable” serial/I²C command to read the “Error status” variable.
- Using a microcontroller to measure the voltage on ERR pin. This pin is linked to the red LED so it should go high (3.3 V) when there is an error stopping your motor and low (0 V) otherwise.
All the errors are explained below:
- Safe start violation: Safe start is a feature that helps prevent the motor from starting up unexpectedly. This feature is enabled by default, but can be disabled in the “Advanced settings” tab. The behavior of safe start depends on what input mode you are using.
In Serial/USB input mode, the safe start violation error occurs whenever any other error is stopping the motor. After all the other errors have been fixed, you can clear the safe start violation error by pressing the Resume button (which issues a native USB command) or using a serial command.
In Analog or RC input mode, the safe start violation error occurs whenever the motor is stopped because of an error AND the inputs that control the speed of the motor are not near their neutral positions. This helps prevent the situation where there might be an error stopping your motor (such as a disconnected battery), and the motor starts running at a high speed when you fix the error. To clear the safe start violation error, move all the inputs that control the speed of the motor to their neutral positions (the sum of the absolute values of their scaled values must be less than 8%).
- Required channel invalid: This error occurs whenever any required RC or analog channel is invalid. This error helps ensure that your motor will stop if you accidentally disconnect your joystick, potentiometer or RC receiver. A channel is invalid if it is disconnected, or has a value that is out of range. A channel is required if it controls the speed of the motor or it is configured as a limit switch or kill switch. By default, there are no required channels because the input mode is serial and no limit or kill switches have been configured. You can check the “Input settings” tab to see which channels are required. Channels that are required and invalid are highlighted in red in the “Input channels” box of the Status tab so you can quickly see which channel is causing this error.
- Command timeout: This error occurs if you are controlling your motor using a microcontroller or a PC (input mode is Serial/USB) and the (configurable) time period has elapsed with no valid serial, I²C, or USB commands being received by the controller. The purpose of this error is to ensure that your motor will stop if the software talking to the controller crashes or if the communications link is broken. All valid serial and I²C commands clear this error. The native USB commands for setting the speed and exiting safe start also clear this error. By default, this error is disabled, but it can be enabled from the “Advanced settings” tab by setting a non-zero command timeout value.
- Limit/kill switch: This error occurs when a limit or kill switch channel stops the motor. More specifically, it occurs in three cases: when a kill switch is active, when a forward limit switch is active AND the target speed is positive, or when a reverse limit switch is active AND the target speed is negative. A limit/kill switch is considered active if its scaled value is above 50 %. If you are using a limit switch and your input mode is Serial/USB, you will need to check the Count column in the Status tab to see this error because in Serial/USB mode the Target Speed gets set to 0 whenever there is an error.
- Low VIN: This error occurs whenever your power supply’s voltage is too low or it is disconnected. If you set the correct thresholds in the “Advanced settings” tab, this error will prevent you from over-discharging your battery.
- High VIN: This error occurs whenever your power supply’s voltage is too high. You can set the threshold voltage in the “Advanced settings” tab.
- Motor driver error: This error occurs whenever the motor driver chip reports an under-voltage, over-current, or over-temperature error.
- Over temperature: This error occurs whenever a reading from one of the temperature sensors is too high. You can see the temperature readings in the “Conditions” box of the Status tab. The behavior of this error and the threshold temperatures can be configured in the “Advanced settings” tab.
- ERR line high: This error occurs whenever there are no other errors but the voltage on the ERR line is high (2.3 V to 5 V). This error allows you to connect the error lines of two Simple Motor Controllers together and have both of them stop when either one experiences an error. This error can be disabled in the Advanced Settings tab.
- Serial errors: Serial errors are recorded whenever something goes wrong with the serial or I²C communication, either on the TX/RX/SDA/SCL lines or on the USB virtual COM port. If the input mode is Serial/USB, then a serial error will stop the motor from running until a valid serial command is received, or the Resume button is pressed, or the native USB “Set speed” or “Exit safe start” commands are sent. If you are using serial and have not disabled safe start mode, you will need to send the “Exit safe-start” command followed by a “Set speed” command to recover from an error and get the motor running again. If you are using serial and have disabled safe start, the motor will start driving as soon as a valid “Set speed” command is received. These are the types of serial errors that are recorded:
- Frame: This is error occurs when a de-synchronization or excessive noise on the RX line is detected.
- Noise: This error occurs when noise is detected on the RX line.
- RX overrun: This error occurs when the buffer for storing bytes received on the RX line is full and data was lost as a result. This should not occur during normal operation.
- Format: This error occurs if the serial or I²C bytes received do not obey the protocol specified in this guide. If you get this error, check the bytes you are sending carefully, and compare them to the examples provided.
- CRC: This error occurs if you have enabled cyclic redundancy check (CRC) for serial commands, but the CRC byte received was invalid. CRC helps prevent the motor controller from accidentally performing unwanted actions when it is receiving commands over a noisy serial link. If you get this error, check your algorithm for calculating CRCs and check the quality of your serial signal at the RX pin.
The count that is displayed next to each error in the Simple Motor Control Center G2 indicates how many times the occurrence of the error has been reported. You can clear these counts by opening the “Device” menu and selecting “Clear counts”.