SMD Red
The Brushed DC Motor Driver
Last updated
The Brushed DC Motor Driver
Last updated
SMD Red is designed to bring revolutionary solutions to the robotics and motion systems with brushed DC motors, allowing users to be more creative and focus on their project.
The key feature of SMD Red is its compatibility with a wide range of applications through the use of different SMD modules and brushed DC motor. This flexibility and modularity easily meets the requirements of many possible motion projects. All these facilities allow the user to design any mobile system without any hassle.
SMD Red opens a new door to the world of robotics for makers with its scalability and comprehensive control of motor systems. SMD Red allows many SMD sensor modules to be used together in a synchronised network via its RJ-45 bus connector. Thus, makers can shape and enlarge their project according to the needs, without having to worry about messy cable management. This feature enhances experience with motorised robotic projects and much more.
Each SMD Red has on-board power connectors, providing a convenient solution for daisy-chaining power lines of other SMD Reds or components of the mobile system. This approach makes power management of the project easier for makers, and allows seamless operation and integration.
In summary, SMD Red is not only a motor driver board, it is much more with smart solutions for motor control projects, mobile systems, educational projects and where imagination can extend. It sets a new standard of adaptability, scalability, modularity in the robotics and maker world, aiming to be a milestone and indispensable for projects.
The SMD Red is designed with features that simplify and improve the process of building a project. These features are mainly:
PID autotune function fairly optimizes the performance of the DC motor, by using Cohen-Coon method to calculate PID parameters for multiple motor driving modes such as position control and velocity control mode. This function of SMD Red is effective since it uses multiple measurements according to the current load of motor system.
SMD Red can be daisy-chained via RJ-11 connectors, and and connected to numerous SMD modules via RJ-45 connectors. This interconnection and communication increases the versatility of the systems and allows full synchronisation of the robotic system, using RS-485, one of the most preferred protocols with many advantages.
There are many benefits and reasons that make SMD Red an excellent choice for motion, mobile, robotics and educational projects.
Versatile project development with modular and synchronised design solution
PID auto-tune function that optimises the motor control experience
Daisy-chaining that allows multiple motor control systems with various SMD modules to input and output various data to enrich the projects
Here is a demonstration of daisy-chain and cable management used for "Synchronizing Linear Motors" application:
SMD RED has two power ports, two RJ-45 ports for the connection between SMD REDs, one I2C port for sensor connection and an actuator port. Ports are shown in the image below, a detailed map can be seen atDetailed Port Map of SMD Red.
Device ID is the first thing to configure when developing a project with SMDs. The ID of an SMD Red is 0 as default. This value can be changed within range of 0 - 254, 0xFF reserved for broadcast commands.
Reset the Torque Enable register before attempting to change the device ID, otherwise, request will be ignored for safety reasons. Device ID can't be changed while a motor is in operation.
It is crucial to change the ID of any SMD before daisy-chaining them, because SMD systems doesn't detect duplicated, overlapping IDs, meaning that if the user connects two or more SMDs without changing ID, since all of them has an ID of 0, system will not identify each card, resulting inability of controlling each SMD individually.
You can click for related functions to this register for Python and Arduino library.
SMD Red allows the user to select a baud rate from a wide range of 1527 - 6250000 bits/s. This makes it possible to develop various projects with specific requirements. The default baud rate of SMD Red is 115200 bits/s, which is a stable and widely accepted starting point.
Reset the Torque Enable register before attempting to change the baud rate of the SMD, otherwise, request will be ignored for safety reasons.
The user should ensure that the baud rate of each SMD in a system is the same to ensure synchronised communication
It is recommended that users to select known baud rates to ensure compatibility and reliability of communication. This selection is also important to avoid communication errors.
You can click for related functions to this register for Python and Arduino library.
The error flags register is where the error codes are stored as bits. It serves as a tool for error management, which allows the user to identify errors on SMD.
Specific error bits can be cleared with Error Clear Command.
Here are the error flags and their explanations:
Input Voltage Error: This flag is set when the input voltage rises above/falls below the minimum/maximum voltage limit that has been set by the user. If this flag is set, it causes the Torque Enable register to be disabled, resulting in the motor stopping.
Overheat Error: This flag is set when the temperature exceeds the temperature limit that has been set by the user. If this flag is set, it causes the Torque Enable register to be disabled, resulting in the motor stopping.
Overload Error: This flag is set when the current exceeds the current limit that has been set by the user. If this flag is set, it causes the Torque Enable register to be disabled, resulting in the motor stopping.
Encoder Error: This flag is set when the SMD is unable to gather data over a specified time from encoder. If this flag is set, it causes the Torque Enable register to be disabled, resulting in the motor stopping.
Communication Error: This flag is set when the SMD receives a faulty package. It doesn't affect the operation of the motor and the modules. It is an indicator for the user to understand if there are any communication problems.
Flash Error: This flag is set when the SMD encounters any difficulty while reading or writing data to EEPROM. It informs the user to check if there are any misconfigurations. In case of EEPROM reading failure, SMD will reset to the factory default.
All these flags allow the user to effectively determine the errors of the SMD when needed, so, the user will be able to take action to solve according to the error flag.
Here is a reference table of error flags register:
The hardware and software version registers allow the user to obtain information about the SMD system. If the user ever needs technical support, it is helpful to know the hardware version of the SMD. It is important to mind the hardware version of the SMD when looking for technical details of the SMD.
The software version information is essential to check if there are any updates to the functions of the SMD. The user can see the software version and check the source and updates of Acrome SMD, thus, knowing if it is necessary to update the software version of the SMD.
You can click for related functions to this register for Python library.
The operation mode register is used to set the operation mode of the motor that connected to the SMD. SMD Red's different motor operation modes allow the user to select the required mode for projects with specific motor control needs.
Here are the motor operation modes:
Position Control Mode (Default): The position mode is enabled by setting the operation made register to 0x00. In position mode, the motor performs movements based on parameters configured for specific positions, such as degrees. This mode allows the user to precisely change the position of the motor . It is preferred in systems that require precise and sensitive motor movements, such as robotic arms.
Velocity Control Mode: The velocity mode is enabled by setting the operation made register to 0x01. In velocity mode, the motor operates at the configured speed. This mode allows the user to set the speed of the motor in terms of RPM. It is preferred in systems where a constant speed is required, such as conveyor belts, elevators.
Torque Control Mode: The torque mode is enabled by setting the operation made register to 0x02. In torque mode, the motor operates to match a torque level. This mode allows the user to set the current that will be used by the motor, resulting in a specific torque level. It is preferred in systems where is a certain torque level is required, such as drilling machines, robotic material lift arms.
These various motor operation modes provide the opportunity to develop a wide range of applications and to meet the needs of the users and their projects. The simplicity of selecting the required motor operation mode allows the user to focus on the features of their project while maintaining the integration and synchronisation of the between the SMDs.
You can click for related functions to this register for Python and Arduino library.
The torque enable register allows the user to directly control motor operation by simply changing this register. For this register, '1' means that the motor connected to the SMD will operate on command, '0' means that the motor will not operate and will stop its process if it is turned to the '0' value while it was '1'.
Many other register changes require the torque enable register to be resetted. This means that the motor must not move to change features of the SMD, to avoid accidents with motion systems.
You can click for related functions to this register for Python and Arduino library.
The autotuner enable register controls the operation of the PID auto-tune function. The motor auto-tuning function can be run simply by changing this register from '0' to '1'. This will activate the PID auto-tune function, which takes approximately 30 seconds to determine the optimum P, I and D parameters for specific motor control modes of the SMD.
You can click for related functions to this register for Python and Arduino library.
The current limit is the upper limit for stopping motor operation. This value can be set by the user in mA (milliamperes) in the range of 0 - 65535. The motor that connected to the SMD will automatically stop if the supply current rises above the current limit. This feature ensures the system integrity and safety.
The current limit register operates independently of the Operation Mode, so it is not necessary to operate in current control mode to set a current limit for the motor operation.
The velocity limit is the upper limit for stopping motor operation. This value can be set by the user in terms of encoder ticks within 100 milliseconds time, in the range of the 0 - 65535. The motor that connected to the SMD will automatically stop if the encoder tick value within 100 milliseconds rises above the determined value. This feature allows the user to configure the system according to the project requirements.
The velocity limit feature applies only in the velocity control mode.
You can click for related functions to this register for Python and Arduino library.
The user can set the minimum and maximum position limits of the motor that connected to the SMD. This feature is essential for position control based applications both in terms of functionality and safety.
You can click for related functions to this register for Python and Arduino library.
The position control setpoint is the value at which the motor is to be positioned. This value can be set by the user in the range of 0 - 65535, in terms of encoder ticks.
You can click for related functions to this register for Python and Arduino library.
The velocity control setpoint is the speed value to which the motor is wanted to be driven. This value can be set by the user in the range of 0 - 65535, in terms of RPM.
You can click for related functions to this register for Python and Arduino library.
The torque control reference is the value of the current to be drawn by the motor. This value can be set by the user in the range 0 - 5000 in mA (milliamperes).
You can click for related functions to this register for Python and Arduino library.
The present position register provides the real-time position of the motor in terms of encoder ticks. It allows the user to enhance various position control based applications.
You can click for related functions to this register for Python and Arduino library.
The present velocity register provides a real-time measurement of the velocity of the motor, in terms of encoder ticks per 100 ms (milliseconds). It grants more control over the motor and enhances velocity control based applications.
You can click for related functions to this register for Python library.
The present torque register provides a real-time measurement of the current drawn by the motor in terms of mA (milliampers), it translates to a certain torque value in the motor control system. It is essential for various motor control applications which are certain torque values required.
You can click for related functions to this register for Python and Arduino library.
All parameters explained below can be set and changed by the user and also can be automatically determined by the PID auto-tune function.
The 'P' (proportional) gain parameter is the initial and most critical gain of the PID system. It is responsible for providing an immediate response to the current error of the system, and ensures that the system reaches to the desired setpoint.
The 'P' gain can be set by the user for each control mode available.
The 'I' (integral) gain parameter is the gain that improves the response of the system, and is generally used to solve the "steady-state error" by integrating the error and eliminating the offset that can be caused by sensor inaccuracies, friction, etc. It plays a corrective role in control systems.
The 'I' gain can be set by the user for each control mode available.
The 'D' (derivative) gain parameter is the gain that helps the system to improve stability and damp the oscillations of the system output. It also suppresses noises that affects the control system.
The 'D' gain can be set by the user for each control mode available.
The deadband value determines the threshold at which the system will not respond to the error. This situation generally solves the oscillation that caused by small errors by increasing the tolerance of the control system.
The deadband value can be set by the user for each control mode available.
The feed forward value is the value that adds up to the system output according to the input value. It acts as a pre-action to compensate for predicted errors before they impact output of the system in a unintended way.
The feedforward value can be set by the user for each control mode available.
The output limit determines the maximum output limit that can be calculated by the PID controller system. It is used as a precaution to prevent the system from outputting a higher result than intended. This ensures that the system fulfils its purpose as defined by the user.
The output limit value can be set by the user for each control mode available.
Each motor control mode has its own parameter set functions. The function names are different in the Python library according to the motor control mode, but in Arduino library the motor control mode is a parameter of a main parameter setting function. See the links below for detailed explanations:
For Python, Position - Velocity - Torque parameter setting functions.
For Arduino, parameter setting function.
The buzzer register allows the user to control the Buzzer Module. It simply controlls the buzzer on the module, the user can also provide a frequency value for the buzzer to play.
You can click for related functions to this register for Python library.
The IMU (Inertial Measurement Unit) registers allow the user to check the roll and pitch values. The values are obtained from the IMU Module. These values are most commonly used in motor control systems and where balance is an important concern.
Present Roll Register:
This register stores the roll value, which is the rotation of the sensor around its longitudinal axis.
Present Pitch Register:
This register stores the roll value, which is the rotation of the sensor around its lateral axis.
You can click for related functions to these registers for Python and Arduino library.
The ambient light intensity register allows the user to obtain light intensity data from the Ambient Light Sensor Module, in terms of Lux. It can be used in various applications where light sensitivity is a requirement.
You can click for related functions to this register for Python and Arduino library.
The button status register allows the user to obtain the button data from the Button Module. This register returns '1' if the button is pressed and '0' if it is not pressed at the moment. A button is the most used component in all kinds of projects.
You can click for related functions to this register for Python and Arduino library.
The present distance register allows the user to obtain the distance data from the Ultrasonic Distance Sensor Module, in terms of cm (centimeters). Distance is especially important in mobile robot systems and many other types of projects.
You can click for related functions to this register for Python and Arduino library.
The joystick registers contain the joystick X, joystick Y and joystick button data and allow to retrieve the data from the Joystick Module. The user can acces this data and use for various purposes in applications and projects.
Joystick X Register:
This register contains the X-axis data of the joystick mounted on the joystick module. This value varies in the range of [-100, 100]. '-100' represents the left side of the joystick X-axis, '100' represents the right side of the joystick X-axis.
Joystick Y Register:
This register contains the Y-axis data of the joystick mounted on the joystick module. This value varies in the range of [-100, 100]. '-100' represents the lower side of the joystick Y-axis, '100' represents the upper side of the joystick Y-axis.
Joystick Button Register:
This register contains the button status of the joystick button. This value is either '0' or '1', it is '1' when it is pressed. It can be used as a normal independent button in applications.
All of these registers are commonly used in applications that require navigational inputs for motor control or interfaces, etc. They allow the user to use the data in different project ideas, providing a much more dynamic control capability.
You can click for related functions to this register for Python.
The functions for joystick are seperated in the Arduino library, so the functions are joystick-X, joystick-Y and joystick button.
The QTR (Reflectance Sensor) registers contain left, middle and right QTR data and allow to get the data from the Reflectance Sensor Module.
The data from the module comes as an array, ordered as left - middle - right QTR sensors. QTR data is often used in projects such as line following, maze solving robots, etc. The user is free to use the reflectance data coming from the QTR sensors in any project that needs to differentiate the contrast between two colors, as each color reflects light differently.
You can click for related functions to this register for Python and Arduino library.
The protocol is working on a UART interface at up to 9M baud. Each package transmitted from the master device needs to be followed by a delay of minimum 1-byte-long of the selected baud rate at the time. However, a 2-byte-long delay is recommended to tolerate any possible timing issues since UART is an asynchronous communication interface.
Each package must have a preliminary information part before data bytes and an MPEG2 CRC32 value at the end of the package. These values are disclosed in Table 1. The whole communication protocol is based on little-endian architecture.
Note: If the user wants to broadcast a command to all the slave devices in the communication line, Device ID field should set to 0xFF. When a broadcast massage is transmitted, no reply will be received from any of the Actuators on the bus.
Ping Command
When the Actuator receives a package with a ping command, it will reply to the user with a ping package. The only difference between two packages is the 4th byte of the package that has been sent to the Actuator is the status register of the device.
Write Command
When the user wants to change the registers of the Actuator, the user should send a package that contains information about the required register pointers and register values with this command. The user should place pointer values and register data in the data field of the package template according to the given example below.
Read Command
When the user wants to read the registers of the Actuator, the user should send a package that contains information about the required register pointers with this command. The user should place pointer values in the data field of the package template according to the given example below.
EEPROM Write Command
When the user wants to save already-written data to the non-volatile memory of the Actuator, should send a package with this command. Actuators do not respond this command. Execution of this command takes about 300ms since writing to flash memory is a relatively slow operation. Keeping torque output disabled is recommended but not mandatory while sending this command.
Reboot Command
When the user wants to reboot the device, should send a package with this command. The device will be rebooted immediately and all parameters on the RAM will be replaced with the values that stored on the EEPROM.
Factory Reset Command
When the user wants to replace all parameters with the default ones, should send a package with this command. When this command is sent, Actuator is going to reset all parameters to their out-of-factory values, including ones that are saved to the EEPROM.
When the user wants to clear any errors on the Actuator, should send a package with this command. Users should set the status field of the package with the flags of the errors that will be cleared. To clear all errors, the user should set the status field to 0xFF. For details of error flags, see the Status register description.
ACK Flag
When the user wants to get a reply from Actuator after write command, should set the 7th bit of the command register. If the user sends ACK, the Actuator will return all of its parameters as the reply. Ping packages always get replies from the Actuators.
PID (Proportional-Integral-Derivative) control is a widely employed algorithm in diverse control systems, regulating variables like temperature, flow, pressure, and more. Autotuning, a crucial aspect of PID control, involves automatically adjusting the controller's parameters to enhance its performance. The benefits of autotuning PID controllers are numerous and impactful:
Improved Control Performance: Autotuning optimizes the PID controller's parameters, including proportional, integral, and derivative gains. This optimization results in a controller that can achieve faster and more precise control of the process variable. By fine-tuning these parameters automatically, the system can respond more effectively to changes in the controlled variable.
Reduced Setup Time: Autotuning eliminates the need for manual tuning, significantly reducing the time and effort required to set up a PID controller. Instead of relying on trial-and-error methods, autotuning algorithms systematically adjust the controller's parameters, streamlining the setup process and making it more efficient.
Better Response to Process Changes: Autotuning equips PID controllers to adapt dynamically to changes in the controlled process, such as variations in load or operating conditions. This adaptability ensures that the controller remains stable and responsive, minimizing the need for frequent manual adjustments. The ability to respond swiftly to process changes contributes to the overall robustness of the control system.
Enhanced Stability and Efficiency: The combined effect of improved performance, reduced setup time, and adaptability to process changes contributes to the overall stability and efficiency of the control system. Autotuning helps maintain control in a variety of operating conditions, leading to more reliable and effective regulation of the controlled variable.
In summary, autotuning PID controllers play a vital role in optimizing control system performance. By automating the parameter tuning process, these controllers achieve faster response times, reduce setup efforts, and adapt seamlessly to dynamic process conditions. The result is a more stable, efficient, and robust control system capable of delivering precise and reliable control across a range of applications.
The minimum voltage requirement for an electric motor is a critical consideration in ensuring proper startup and continuous operation. The minimum voltage is essential for initiating the motor's rotation and sustaining the necessary current flow to generate the magnetic field crucial for producing torque.
Here are key points to elaborate on this concept:
Initiating Rotation:
The electric motor relies on an initial surge of current to create the magnetic field required for torque generation. This is particularly crucial during the startup phase when the motor transitions from a standstill to rotation.
Generating Torque:
To produce torque, the motor must maintain a sufficient magnetic field. This is achieved by ensuring that the current flowing through the motor is at an adequate level. Below a certain voltage threshold, the current may be insufficient, leading to a failure to generate the necessary magnetic field, causing the motor to either not start or stall if already running.
Preventing Stalling:
In the case of an already running motor, if the supplied voltage drops below the minimum required level, the motor may stall. Stalling occurs when the motor cannot overcome the load or friction opposing its rotation due to insufficient current.
Ensuring Reliable Operation:
To prevent these undesirable scenarios, it is crucial to provide the motor with a voltage equal to or higher than the specified minimum. This ensures that the motor receives the necessary current to establish and sustain the magnetic field, allowing for reliable and efficient operation.
In summary, the minimum voltage requirement for an electric motor is a fundamental parameter for ensuring proper functionality, preventing stalling, and promoting reliable operation. Adhering to the specified minimum voltage guidelines is essential for optimizing motor performance and longevity in various applications.
The Cohen-Coon tuning method, developed by Norm Cohen and Bernard Coon in the 1960s, is another valuable approach for autotuning PID controllers. Like the Ziegler-Nichols method, Cohen-Coon relies on a step response test to determine optimal proportional, integral, and derivative gains for the controller. This method is considered more conservative than Ziegler-Nichols, prioritizing stability.
Here are the key steps involved in the Cohen-Coon method:
Maximum Speed Calculation:
Calculate the maximum speed that the motor can reach. It's crucial to operate at half power to avoid damage to the motor and the system.
Dead Time (td) Calculation:
Determine the dead time (td) in the system. Dead time is the time delay between a change in the controller output and the corresponding change in the process variable (PV).
Time Constant (𝜏) Calculation:
Calculate the time constant (𝜏), representing the time difference between the intersection at the end of dead time and the PV reaching 63% of its total change. This is a critical parameter in determining the system dynamics.
Gp Calculation:
Calculate the process gain (Gp), which is the change in the PV divided by the change in the controller output (CO), both expressed as percentages. This quantifies the sensitivity of the system to changes in the controller output.
Gp = change in PV [in %] / change in CO [in %]
Set Controller Gains:
Set the proportional, integral, and derivative gains of the PID controller to the recommended values based on the Cohen-Coon method.
The Cohen-Coon method is known for being more conservative compared to Ziegler-Nichols, resulting in a controller that is generally more stable. However, it's essential to note that while these tuning methods provide a good starting point, fine-tuning may still be required based on specific system characteristics and performance requirements. Ultimately, the choice between Ziegler-Nichols and Cohen-Coon depends on the desired trade-off between aggressive response and stability in a given control system.
The users can use the Cohen-Coon PID Autotuner Method to easily determine the coefficients of the PID for the optimal motor control.
Here is a summary of the autotuner method and its configuration:
Cohen-Coon Method
Autotuner Method Register Setting: 0x03
Description: Opting for the Cohen-Coon method instructs the Actuator to autotune its control parameters according to the Cohen-Coon method. This method, like Ziegler-Nichols, often involves a step response test but is generally considered more conservative, emphasizing stability. Users should set the Autotuner method register to 0x03 to initiate the Cohen-Coon tuning process.
Before selecting either method, users must ensure that both torque and the Autotuner are enabled. This ensures that the Actuator is ready to undergo the autotuning process and that the resulting parameters align with the chosen method.
By providing users with a choice between Ziegler-Nichols and Cohen-Coon methods, the Actuator accommodates different preferences and requirements for tuning its control parameters, allowing for customization based on the specific needs of the control system.
Here is a table of Hardware Specifications including Microcontrol Unit, Peripherals, Programmer, I/O Port Pins, Communication Ports, LEDs and Buttons, Input Power Source, Power Fuses and Dimensions.