Download printable PDF
Transcript
Pololu Simple Motor Controller User’s Guide © 2001–2015 Pololu Corporation Motor Brake (Serial/USB input mode only) Command Format: “B<brake_amount><CR>” Description: This command causes the motor to immediately brake by the specified amount (configured deceleration limits are ignored). The argument brake_amount can be an integer from 0 (maximum coasting) to 32 (full braking) or an integer percentage from 0% to 100%. You can represent the brake amount in hex by putting an “H” at the end of the number. If the argument brake_amount is outside the allowed range, a Serial Format Error occurs. Error. Examples: The following commands all make the motor brake as hard as possible: ◦ “B32<CR>” ◦ “B100%<CR>” ◦ “B20H<CR>” Get Variable (any input mode) Command Format: “D<variable_id><CR>” Description: This command lets you read a variable from the Simple Motor Controller. See Section 6.4 for a list of all of available variables. The value of the requested variable is transmitted as an ASCII-encoded decimal number. If the argument variable_id is between 41 and 127, a Serial Format Error occurs. Example: The following commands both request the board temperature (variable ID 24, or 0x18): ◦ “D24<CR>” ◦ “D18H<CR>” We might receive “.286<CR><LF>” as a response. The leading ‘.’ is a status character that indicates the last command was understood and no errors are currently stopping the motors. The rest of the characters before the carriage return (<CR>) and new line (<LF>) characters are an ASCII representation of a decimal (base 10) number. This particular variable has units of 0.1 °C, which would mean that the board temperature is 28.6 °C. Set Motor Limit(any input mode) Command Format: “L<limit_id>,<limit_value><CR>” Description: This command lets you change the temporary motor limit variables documented in Section 6.4. Limit IDs from 0 to 3 are affect both forward and reverse limits equally (they are “symmetric”). Limit IDs from 4 to 7 affect only forward limits and limit IDs from 8 to 11 affect only reverse limits. The following table provides the limit IDs for all of the temporary motor limit variables along with the allowed limit values: 6. Using the Serial Interface Page 81 of 108