Pololu simple motor controller driver download
Print Email a friend Feeds. Temporarily out of stock. See product page to backorder. Out of stock. Pololu Simple Motor Controller 18v7. Log In. Shop Blog Forum Support. Feedback Comments or questions? Products New Products Specials! Original versions, not recommended for new designs included for comparison purposes. The original SMCs are not recommended for new designs, and they are only included in the table below for comparison purposes.
A wide operating range of up to 5. Although this motor controller has many more features than competing products, a free configuration utility for Windows and Linux simplifies initial setup of the device and allows for in-system testing and monitoring of the controller via USB.
Simple High-Power Motor Controller 18v25 or 24v23 simplified connection diagram. This video demonstrates the versatility of the Simple Motor Controller by showing how it can be controlled directly from the analog output of a Sharp analog distance sensor—there is no intermediate control board and no programming involved.
For more information on this example, including the SMC settings file and a list of parts used, see our blog post about the demo. The connector-free version allows flexibility in choice of connectors and placement of the power capacitor e.
Note: The power capacitor has a significant effect on performance; the included capacitor is the minimum size recommended, and bigger ones can be added if there is space. A bigger capacitor might be required if the power supply is poor or far more than about a foot from the controller. Warning: Take proper safety precautions when using high-power electronics. Make sure you know what you are doing when using high voltages or currents! The Ignore pot disconnect option disables the disconnect detection for analog channels.
The analog channel will still be considered invalid if the voltage goes out of the acceptable range specified by the Error min and Error max parameters for that channel. This option is necessary if you are connecting a limit switch or other device to the analog input in a way that prevents the disconnect detection from working.
The Never sleep ignore USB suspend option prevents the device from going in to deep sleep mode in order to comply with the suspend current requirements of the USB specifications. The default value of Command Timeout is 0, which means the error is disabled. The Command Timeout can be specified with 0. The purpose of the Command timeout error is to ensure that your motor will stop if the software talking to the controller crashes or if the communications link is broken.
For more details about this error see Section 3. The Simple Motor Controller has field-upgradeable firmware that can be easily updated when Pololu releases bug fixes or new features. If you do not have the latest firmware, you can upgrade the firmware by following these steps:. If you need to upgrade your firmware, please use a computer running Windows.
If you run into problems during a firmware upgrade, please contact us for assistance. The Simple Motor Controller has two serial interfaces that allow you to send commands and receive responses from the controller.
The commands and responses are represented as a series of bytes. The Simple Motor Controller treats the two command sources independently and can simultaneously process commands from both sources. In Mac OS X You can use a terminal program or computer software to send commands to this virtual serial port over USB. Most common programming languages have libraries for sending serial data e. Visual C has a SerialPort class , which makes it easy to write a custom computer program to control the Simple Motor Controller.
The baud rate settings do not matter when communicating through the virtual COM port. The voltage on the RX pin should not go below 0 V and should not exceed 5 V. The Simple Motor Controller provides logic-level 0 to 3. The bytes sent by the motor controller on TX are typically responses to commands that request information, but they can also be data received by the TXIN pin and passed on.
The Simple Motor Controller has the ability to automatically detect the baud rate, which means that it can be used even when the baud rate of the serial source is unknown as long as the serial source initiates communication by sending the proper baud rate indication byte: 0xAA written as in decimal notation.
The Simple Motor Controller works with baud rates from to , bits per second. The data format is 8 data bits, no parity bit, and one stop bit, which is often expressed as 8-N The diagram below depicts a typical asynchronous, non-inverted TTL serial byte:.
A non-inverted TTL serial line has a default non-active state of high. Logical ones are transmitted as high 3. The Simple Motor Controller supports fixed baud rates of bps to 2 Mbps and can automatically detect baud rates up to kbps in auto-detect baud rate mode.
You must wait for at least 1 ms after the Simple Motor Controller powers up or is reset before you start sending data. Anything sent during this first millisecond is likely to be ignored or incorrectly received. There are three possible CRC modes:. This setting is useful when using the Simple Motor Controller with other devices in a daisy-chained configuration see Section 6. This is useful when interfacing with devices like the Basic Stamp that use half-duplex UARTs and need time to switch from transmit mode to receive mode.
When this feature is disabled, transmission of a response packet begins as soon as possible after the last byte of a command packet is received if that command packet generates a response. Command Timeout: This setting lets you configure the Simple Motor Controller to shut down the motor if too much time elapses between received commands, which could happen if your serial control source gets disconnected or loses power.
See Section 5. Communication is achieved by sending serial command packets consisting of a single command byte followed by any data bytes that command requires not all commands require data bytes; some command packets simply consist of a single command byte.
Command bytes always have their most significant bits set, while data bytes almost always have their most significant bits cleared:. This means that each data byte can only transmit seven bits of information. The only exception to this is the Mini SSC command, where the command byte is 0xFF, or , and the data bytes can have any value from 0x00 to 0xFE 0 to The 0xAA baud rate indication byte can be the first byte of a Pololu protocol command, or it can be transmitted as a single byte.
The hexadecimal representation starts with the prefix 0x e. Keep in mind that a byte is simply a number between 0x00 0 and 0xFF For serial protocols, the important thing about a byte is its value, not the notation e. This is the simpler and more compact of the two protocols; it is the protocol you should use if your Simple Motor Controller is the only device connected to your serial line. The compact protocol command packet is simply:. For example, if we want to set the motor speed to full speed forward, we could send the following byte sequence:.
This protocol is compatible with the serial protocol used by our other serial motor and servo controllers. As such, you can daisy-chain a Simple Motor Controller on a single serial line along with our other serial controllers including additional Simple Motor Controllers and, using this protocol, send commands specifically to the desired controller without confusing the other devices on the line.
To use the Pololu protocol, you must transmit 0xAA in decimal as the first command byte, followed by a Device Number data byte. The default Device Number for the Simple Motor Controller is 0x0D 13 in decimal , but this is a configuration parameter you can change. Any controller on the line whose device number matches the specified device number accepts the command that follows; all other Pololu devices ignore the command. The remaining bytes in the command packet are the same as the compact protocol command packet you would send, with one key difference: the compact protocol command byte is now a data byte for the command 0xAA and hence must have its most significant bit cleared.
Therefore, the command packet is:. This protocol allows you to control up to different motors by chaining multiple motor controllers together.
Since it only takes three serial bytes to set the speed of one motor, this protocol is good if you need to send many commands rapidly to multiple motor controllers. Therefore, A speed byte of 0 results in full-speed reverse, a speed byte of results in speed 0 motor stopped , and a speed byte of results in full-speed forward. The command packet is:. The Simple Motor Controller identifies the Pololu, Compact, and Mini-SSC protocols on the fly when configured in Binary serial mode; you do not need to use a configuration parameter to identify which of these three protocols you are using, and you can freely mix commands in the three protocols.
This program makes it easy send packets of arbitrary bytes, which can help you identify if your problems are with your control software or with the bytes you are trying to send. The Serial Transmitter Utility can even automatically append the appropriate CRC7 byte to the end of the transmitted command packet.
Specifically, this command must be issued when the controller is first powered up, after any reset, and after any error stops the motor. This command has no serial response. If you just want your motor to run whenever possible, you can transmit Exit Safe Start and motor speed commands regularly. The motor speed commands are documented below. One potential problem with this approach is that if there is an error e. If you want to prevent your motor from starting up unexpectedly after the controller has recovered from an error, then you should only send an Exit Safe Start command after either waiting for user input or issuing a warning to the user.
Description: This command lets you set the full-resolution motor target speed in the forward direction. The motor speed must be a number from 0 motor stopped to motor forward at full speed and is specified using two data bytes. The first data byte contains the low five bits of the speed and the second data byte contains the high seven bits of the speed. The first speed data byte can be computed by taking the full speed modulo 32, which is the same as dividing the speed by 32, discarding the quotient, and keeping only the remainder.
We can get the same result using binary math by bitwise-ANDing the speed with 0x1F In C and many other programming languages , these operations can be carried out with the following expressions:. The second speed data byte can be computed by dividing the full speed by 32, discarding the remainder, and keeping only the quotient i. We can get the same result using binary math by bit-shifting the speed right five places. In C and many other programming languanges , these operations can be carried out with the following expressions:.
Therefore, we can send the following compact protocol bytes:. Alternate Interpretation: The allowed values for the second speed data byte are 0—, so you can ignore the first speed data byte always set it to 0 , and consider the second data byte to simply be the speed percentage.
Description: This command lets you set the full-resolution motor target speed in the reverse direction. The motor speed must be a number from 0 motor stopped to motor reverse at full speed and is specified using two data bytes, the first containing the low five bits of the speed and the second containing the high seven bits of the speed.
This command behaves the same as the Motor Forward command except the motor moves in the opposite direction. Description: This command sets the motor target speed in the forward direction based on the specified low-resolution 7-bit Speed byte. The Speed byte is a number from 0 motor stopped to motor forward at full speed. To set the motor target speed to approximately half-speed forward 63 , we could send the following compact protocol bytes:. Description: This command sets the motor target speed in the reverse direction based on the specified low-resolution 7-bit Speed byte.
The Speed byte is a number from 0 motor stopped to motor reverse at full speed. Description: This command causes the motor to immediately brake by the specified amount configured deceleration limits are ignored. Requesting a brake amount greater than 32 results in a Serial Format Error. Description: This command lets you read a bit variable from the Simple Motor Controller. The value of the requested variable is transmitted as two bytes, with the low byte sent first. You can reconstruct the variable value from these bytes using the following equation:.
If the variable type is signed and the above result is greater than , you will need to subtract from the result to obtain the correct, signed value.
Alternatively, if it is supported by the language you are using, you can cast the result to a signed bit data type. Requesting variable IDs between 41 and results in a Serial Format Error, and the controller does not transmit a response. To request the board temperature variable ID 24 , we would transmit the following compact protocol bytes and wait until we have received two bytes in response from the Simple Motor Controller or until our receiving function times out, which could happen if there is a problem :.
Description: This command lets you change the temporary motor limit variables documented in Section 6. The ID of the limit to set is specified by the first compact protocol data byte, and the value of the limit is specified by the next two data bytes, the first of which limit byte 1 contains the low seven bits of the value and the second limit byte 2 contains the high seven bits.
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:.
Note : The Brake Duration units used by this command are 4 ms , which differs from 1 ms units used by the Brake Duration variables returned by the Get Variable command. We can get the same result using binary math by bitwise-ANDing the limit with 0x7F The second limit value byte, limit byte 2 , can be computed by dividing the full limit value by , discarding the remainder, and keeping only the quotient i.
We can get the same result using binary math by bit-shifting the limit right seven places. Note that the Hard Motor Limit settings place restrictions on the limit values you can set with this command see Section 5. This means that the Maximum Speed, Acceleration, and Deceleration temporary limits cannot be increased beyond their hard-limit counterparts and the Brake Duration limits cannot be decreased below their hard-limit counterparts.
If you try to set a temporary limit in a way prohibited by the corresponding hard limit, the temporary limit value is set to the hard limit and the response code byte indicates that the value could not be set as requested.
If the arguments to this command are valid, the controller responds to this command with a single-byte code:. Limit IDs above 11 and limit values outside of their allowed value ranges result in a Serial Format Error and no response is transmitted by the controller. Therefore, we can send the following compact protocol bytes and wait until we have received one byte in response from the Simple Motor Controller or until our receiving function times out, which could happen if there is a problem :.
This response tells us the temporary limit was set as requested. If our Max Deceleration Reverse hard motor limit was below , we would receive a response code of 2 , which would tell us that the temporary limit was not set as requested rather, it was set equal to whatever the hard limit is.
Description: This command lets you read the Simple Motor Controller product number and firmware version number. The first two bytes of the response are the low and high bytes of the product ID each Simple Motor Controller version has a unique product ID , and the last two bytes of the response are the firmware minor and major version numbers in binary-coded decimal BCD format.
BCD format means that the version number is the value you get when you write it in hex and then read it as if it were in decimal. For example, a minor version byte of 0x15 21 means a the minor version number is 15, not To request the product ID and firmware version, we would transmit the following compact protocol byte and wait until we have received four bytes in response from the Simple Motor Controller or until our receiving function times out, which could happen if there is a problem :.
This response tells us that the product ID is 0x and the firmware version is 1. Description: This command sets the motor target speed to zero and makes the controller susceptible to a safe-start violation error if Safe Start is enabled. Put another way, this command will stop the motor configured deceleration limits will be respected and not allow the motor to start again until the Safe-Start conditions required by the Input Mode are satisfied.
This mode makes it easy to interact with the Simple Motor Controller through a terminal program, such as HyperTerminal, and it can provide a more intuitive interface for users who would rather deal with character strings than bits and bytes. ASCII commands consist of a command string, which is typically a single letter, followed by a comma-separated list of numbers representing the arguments to the command. Not all commands take arguments, and only one command Set Motor Limit takes multiple arguments.
For example, to command the motor to drive forward at speed full speed , we could send the following ASCII command:. The first character of the response gives you information about the status of the Simple Motor controller; it can be one three possible characters:. If the command sent responds with data e. Commands that consist only of termination characters do not result in a serial response from the Simple Motor Controller.
All other commands, even invalid ones, cause the Simple Motor Controller to respond when a termination character is received. The responses are formatted so that they will appear nicely in the terminal window. We recommend you enable local echoing of transmitted characters when typing commands into a terminal program.
When Safe-Start protection is enabled, this command must be issued when the controller is first powered up, after any reset, and after any error stops the motor. Description: This command sets the motor target speed in the forward direction. If the argument speed is outside the allowed range, a Serial Format Error occurs..
Examples: The following commands all make the motor drive forward at half speed:. Description: This command sets the motor target speed in the reverse direction.
It behaves the same as the Motor Forward command above, except the motor turns in the opposite direction. Examples: The following commands all make the motor brake as hard as possible:.
Description: This command lets you read a variable from the Simple Motor Controller. Example: The following commands both request the board temperature variable ID 24, or 0x18 :. This particular variable has units of 0. If the arguments to this command are valid, the controller responds to this command with an ASCII digit:. Limit IDs above 11 and limit values outside of their allowed value ranges result in a Serial Format Error.
Example: The following commands all set the reverse deceleration limit limit ID 10, or 0x0A to , or 0x1F Description: This command prints the Simple Motor Controller product number in decimal and firmware version number the two major firmware version digits followed by the two minor firmware version digits.
Description: This command sets the motor target speed to zero and makes the controller succeptible to a safe-start violation error if Safe Start is enabled. The serial interface reports all variables as bit 2-byte values transmitted least significant byte first , though not all variables use all 16 bits. The raw and scaled signals measured on the RC channel inputs are always available through serial variable requests, which allows programs using the serial interface to factor the channel inputs into their motor control algorithms.
If no valid signal is detected, the raw channel value is reported as 0xFFFF and the scaled channel value is reported as 0. The raw and scaled voltages measured on the analog channel inputs are always available through serial variable requests, which allows programs using the serial interface to factor the channel inputs into their motor control algorithms.
If the controller detects a disconnected potentiometer this requires potentiometer disconnect detection to be enabled under the Advanced Settings tab , the raw channel value is reported as 0xFFFF and the scaled channel value is reported as 0. The following variables can be used to monitor various internal conditions of the Simple Motor Controller, such as the input voltage, the board temperature, the and the motor speed.
These variables contain the user-imposed limits on the motor output, such as maximum speed, acceleration, and deceleration. These variables are initialized to the hard motor limit settings see Section 5. The Simple Motor Controller uses an internal system of units, labeled internal units in the above tables, where represents the maximum possible motor speed in the forward direction, 0 represents a stopped motor, and represents the maximum possible motor speed in the reverse direction.
For certain applications, verifying the integrity of the data you are sending and receiving can be very important. Because of this, the Simple Motor Controller has optional 7-bit cyclic redundancy checking, which is similar to a checksum but more robust as it can detect errors that would not affect a checksum, such as an extra zero byte or bytes out of order.
The most-significant bit of this byte must be cleared, and the seven least-significant bits must be the 7-bit CRC for that packet. A detailed account of how cyclic redundancy checking works is beyond the scope of this document, but you can find more information using Wikipedia. The Simple Motor Controller uses CRC-7, which means it uses an 8-bit polynomial and, as a result, produces a 7-bit remainder.
This remainder is the lower 7 bits of the CRC byte you tack onto the end of your command packets. The CRC implemented on the Simple Motor Controller is the same as the one on the Maestro servo controller and jrk and qik motor controllers, but it differs from that on the TReX motor controller. Instead of being done MSB first, the computation is performed LSB first to match the order in which the bits are transmitted over the serial line.
In standard binary notation, the number 0x91 is written as However, the bits are transmitted in this order: 1, 0, 0, 0, 1, 0, 0, 1, so we will write it as to carry out the computation below. If you have never encountered CRCs before, this probably sounds a lot more complicated than it really is.
The following example shows that the CRC-7 calculation is not that difficult. For the example, we will use a two-byte sequence: 0x83, 0x This section is a guide to integrating the Simple Motor Controller in to a project that has multiple TTL serial devices that use a compatible protocol.
First of all, you will need to decide whether to use the Pololu protocol, the Mini SSC protocol, or a mix of both see Section 6. You must make sure that no serial command you send will cause unintended operations on the devices it was not addressed to.
If you want to daisy chain several Simple Motor Controllers together, you can use a mixture of both protocols. If you want to daisy chain the Simple Motor Controller with other devices that use the Pololu protocol, you can use the Pololu protocol.
Secondly, assign each device in the project a different device number so that they can be individually addressed by your serial commands. The following diagram shows how to connect one master and many slave devices together into a chain. Each of the slave devices may be a Simple Motor controller or any other TTL serial device, such as a Maestro , jrk , qik or other microcontroller.
Daisy chaining serial devices using the Pololu protocol. To make a chain of devices using the TXIN input, connect them like this:. Connect the TX line of your controlling device to the RX lines of all of the slave devices.
Sent commands will then be received by all slaves. When receiving serial responses from multiple slaves, each device should only transmit when requested, so if each device is addressed separately, multiple devices will not transmit simultaneously. However, the TX outputs are driven high when not sending data, so they cannot simply be wired together. Instead, you can use an AND gate, as shown in the diagram, to combine the signals, or you can use the TXIN pin as described above if the device has one.
Note that in many cases receiving responses is not necessary, and the TX lines can be left unconnected. This allows the devices to be individually addressed, and it allows responses to be sent without collisions. If the devices are configured to detect the baud rate, then when you issue your first Pololu Protocol command, the devices can automatically detect the baud from the initial 0xAA byte.
Some older Pololu devices use 0x80 as an initial command byte. If you want to chain these together with devices expecting 0xAA, you should first transmit the byte 0x80 so that these devices can automatically detect the baud rate, and only then should you send the byte 0xAA so that the Simple Motor Controller can detect the baud rate. Once all devices have detected the baud rate, Pololu devices that expect a leading command byte of 0x80 will ignore command packets that start with 0xAA, and Pololu devices that use the Pololu Protocol, such as the Simple Motor Controller, will ignore command packets that start with 0x For information about the serial commands used by this sample code, refer to Section 6.
The Arduino is a popular prototyping platform that is well suited for beginners to the world of embedded programming.
The drawback is that software serial requires much more processing time than hardware serial. In the following examples, we use the SoftwareSerial library to transmit bytes on digital pin 4 and receive bytes on digital pin 3. These examples are written for Arduino 1. These sample programs require the Simple Motor Controller to have a fixed baud rate set to bps. Auto baud rate detection can be used, but it is not recommended because of inaccuracy in the SoftwareSerial library.
This example assumes the following connections exist between the Arduino and the Simple Motor Controller:. This program demonstrates how to initiate serial communication with the Simple Motor Controller and how to send commands to set the motor speed.
Note that the Simple Motor Controller must be powered when this Arduino sketch starts running. This program demonstrates how to initiate serial communication with the Simple Motor Controller and how to send commands to set the motor speed, read variables, and change the temporary motor limits.
It will be more interesting if you have input power and a motor connected to your Simple Motor Controller see Section 4.
The Orangutan robot controllers feature user-programmable Atmel AVR microcontrollers interfaced with additional hardware useful for controlling robots. Unlike the Arduino, the hardware serial lines are completely available on the Orangutans, so software serial is not necessary when connecting to serial devices like the Simple Motor Controller. See the Pololu AVR library command reference for more information on these functions. This code requires the Simple Motor Controller to have automatic baud rate detection enabled or to have a fixed baud rate set to bps.
This example assumes the following connections exist between the Orangutan and the Simple Motor Controller:. Note that the Simple Motor Controller must be powered when this Orangutan program starts running. It demonstrates how to get the error status from the controller, how to read a variable, and how to set the target speed. For Windows-specific example code that works with either compiler, see Section 6. These are the default settings that the controller is shipped with.
The controller should be connected to the computer via USB. This example is like the previous example except it does the serial communication Windows-specific functions like CreateFile and WriteFile. You can run it using the example commands given below. This script can also be run on Windows, but since Windows does not have bash installed by default it is easier to use SmcCmd. The following example program shows how to compute a CRC byte in the C language. The outer loop processes each byte, and the inner loop processes each bit of those bytes.
In the example main routine, this is applied to generate the CRC byte in the message 0x83, 0x01, that was used in Section 6. The following example program shows a more efficient way to compute a CRC in the C language. The native USB interface provides more features than the serial port, such as the ability to change configuration parameters and select the Simple Motor Controller by its serial number. Also, the USB interface allows you to recover more easily from temporary disconnections.
The virtual serial port interface is easier to use if you are not familiar with programming, and it can work with existing software programs that use serial ports, such as LabView. You can modify the applications in the SDK to suit your needs or you can use the class library to integrate the Simple Motor Controller in to your own applications.
We recommend the Microsoft. NET framework, which is free to use and contains a SerialPort class that makes it easy to read and write bytes from a serial port. Print Email a friend Feeds. Simple Motor Controllers. Key Features Simple bidirectional control of one DC brush motor. Logic-level TTL serial interface for direct connection to microcontrollers or other embedded controllers. Additional Features Adjustable maximum acceleration and deceleration to limit electrical and mechanical stress on the system.
Adjustable starting speed, maximum speed, and amount of braking when speed is zero. Optional safety controls to avoid unexpectedly powering the motor. Input calibration learning and adjustable scaling degree for analog and RC signals. Under-voltage shutoff with hysteresis for use with batteries vulnerable to over-discharging e. LiPo cells. Adjustable over-temperature threshold and response.
Adjustable PWM frequency from 1 kHz to 22 kHz maximum frequency is ultrasonic, eliminating switching-induced audible motor shaft vibration. Error LED linked to a digital ERR output, and connecting the error outputs of multiple controllers together optionally causes all connected controllers to shut down when any one of them experiences an error. Field-upgradeable firmware.
Example code in C , Visual Basic. Optional command timeout shut off motors if communication ceases. Supports automatic baud rate detection from bps to kbps, or can be configured to run at a fixed baud rate. Optional serial response delay for communicating with half-duplex controllers such as the Basic Stamp.
Controllers can be easily chained together and to other Pololu serial motor and servo controllers to control hundreds of motors using a single serial line. Works with RC pulse frequencies from 10 to Hz. Configurable parameters for determining what constitutes an acceptable RC signal. Two RC channels allow for single-stick mixed motor control, making it easy to use two simple motor controllers in tandem on an RC-controlled differential-drive robot. RC channels can be used in any mode as limit or kill switches e.
Analog features: 0. Works with 0 to 3. Two analog channels allow for single-stick mixed motor control, making it easy to use two simple motor controllers in tandem on a joystick-controlled differential-drive robot.
Analog channels can be used in any mode as limit or kill switches. Yes Yes Yes No No 1 We do not recommend using the 18v7, 18v15, or 18v25 versions with 24 V batteries, which can significantly exceed 24 V when fully charged. Simple Motor Controller 18v7, partial kit with included hardware.
Simple Motor Controller 18v7, fully assembled. Simple High-Power Motor Controller 18v15 or 24v12, partial kit with included hardware. Simple High-Power Motor Controller 18v15 or 24v12, fully assembled. Simple High-Power Motor Controller 18v25 or 24v23 with included hardware. Simple High-Power Motor Controller 18v25 or 24v23 with included hardware installed.
If the installer fails, you may have to extract all the files to a temporary directory, right click setup. During the installation, Windows will ask you if you want to install the drivers. After the installation is finished, your start menu should have a shortcut to the Simple Motor Control Center in the Pololu folder.
This is a Windows application that allows you to configure, control, and get real-time feedback from the Simple Motor Controller.
0コメント