Libraries

Acrome SMD can be used with Arduino IDE and any Python Programming Environment. Instructions on how to install the necessary libraries can be found on this page.

Python Library

This library provides easy-to-use Python modules and methods for interfacing with Acrome Smart Motor Driver products. The SMD Python Library is a tool made for easy control of Smart Motor Drivers (SMDs). It's user-friendly for programmers at any level who need to manage motor functions.

Whether you need simple tasks like changing speeds or more complex ones like precise positioning, this library lets you do it with the versatility of Python. You can quickly implement various motor control methods.

The library also enhances your projects by allowing for easy integration with SMD Sensor modules. This means you can gather data from sensors attached to the SMD without hassle, improving your project's functionality and efficiency.

All you need to develop your projects using the "Acrome Smart Motor Drivers" is a computer capable of running your Python scripts.

Installation

To use Acrome Smart Motor Drivers with python library, follow the installation steps below. Library is compatible with Python 3.x and can be installed on both Windows and Linux systems.

Prerequisites

Before you begin, make sure you have the following prerequisites:

  1. Open a Command Prompt with administrative privileges.

  2. Install SMD library using pip (Python package manager) by running the following command:

pip install acrome-smd
  1. Wait for the installation to complete. Pip will automatically download and install the library along with any required dependencies.

Verification

To verify that SMD library has been successfully installed, open a Python interpreter and run the following command:

import smd
import smd.red

If no errors are raised, the installation was successful.

For usage and more info, check out our Github page.

Control

PID (proportional-integral-derivative) control is a common control algorithm used in a variety of control systems, including those that regulate temperature, flow, pressure, and other process variables. Autotuning is the process of automatically adjusting the parameters of a PID controller to optimize its performance.

There are several reasons why autotuning PID controllers can be beneficial:

  • Improved control performance: Autotuning can help improve the performance of a PID controller by finding the optimal values for the controller’s parameters (proportional, integral, and derivative gains). This can result in faster and more accurate control of the process variable.

  • Reduced setup time: Autotuning can significantly reduce the time and effort required to set up a PID controller, as it eliminates the need for manual tuning.

  • Better response to process changes: Autotuning can help a PID controller adapt to changes in the process being controlled, such as changes in load or operating conditions. This can help maintain stable control of the process and prevent the need for frequent manual adjustments.

Overall, autotuning PID controllers can help improve the performance and efficiency of control systems by optimizing the controller’s parameters and adapting to changes in the process being controlled.

Arduino Library

The Acrome Smart Motor Driver (SMD) Arduino Library is a specialized tool designed to give you easy and advanced control over motors with your SMD, right through Arduino. This powerful library simplifies the way you work with motors, letting you concentrate on the main objectives of your project. With a careful design approach, the library is not just efficient for motor command but also for connecting with SMD Sensor modules, providing a complete toolset for your Arduino-based projects.

With the SMD Arduino Library, controlling motors becomes a task of ease, especially with the user-friendly Arduino environment. The library enables effortless motor manipulation, suitable for all levels of expertise in development. Whether it comes to basic or intricate motor functions like speed or position control, the SMD library paired with Arduino makes the task straightforward.

Moreover, the library presents a seamless approach to incorporating SMD Sensor modules. This feature makes it possible to integrate sensor data collection into your projects smoothly, significantly increasing their capabilities with minimal coding effort.

Installation

To get started with the Smart Motor Driver Arduino Library, follow these steps:

  1. Open your Arduino IDE.

  2. In the Arduino IDE, go to Sketch -> Include Library -> Search for Acrome-SMD and click Install.

How can I include the Actuator library in my Arduino code?

AutotuneMethod

This type definition is used for autotune methods of Actuator. The definition is an enum with 2 different possible values.

Possible values are:

  • ZieglerNichols: The Ziegler-Nichols tuning method is a process for determining the optimal parameters for a PID (Proportional-Integral-Derivative) control system to achieve stable and accurate control of a dynamic process.

  • Cohen Coon: The Cohen-Coon method is a process for determining the optimal parameters for a PID (Proportional-Integral-Derivative) control system by using frequency response data to model the process and provide improved robustness compared to the Ziegler-Nichols method.

Void Actuator::setAutotuneEnable()

This method sends a write package and does not return any value. When this command is applied, the Actuator board enables autotune.

Example Usage

Void Actuator ::setAutotuneMethod()

This method sends a write package and does not return any value.When this command is applied, the Actuator board changes the auto-tune method.

Actuator.setAutotuneMethod (ZieglerNichols) //Select Ziegler Nichols method
myActuator.setAutotuneMethod (ChonCoon)       //Select Chon Coon method

Void Actuator ::buzzerEnable()

This method sends a write package and does not return any value. When this command is applied, the buzzer will make a noise.

Example Usage

myActuator.buzzerEnable (1);

Void Actuator ::getDistance ()

This method sends a read package and returns distance in an unsigned integer. This value represents the distance between sensor and object.

Example Usage

uint16_t distance = myActuator.getDistance();

Void Actuator ::getQTRR

This method sends a read package and returns a Qtr sensor’s right phototransistor an unsigned integer. This value represents the QTR’s phototransistor If an object is in front of the phototransistor, the sensor returns a value of 0, otherwise it returns a value of 1.

Example Usage

uint8_t qtr_right=myActuator.getQTRR();

Void Actuator ::getQTRM

This method sends a read package and returns a Qtr sensor’s middle phototransistor an unsigned integer. This value represents the QTR’s phototransistor. If an object is in front of the phototransistor, the sensor returns a value of 0, otherwise it returns a value of 1.

Example Usage

uint8_t qtr_right=myActuator.getQTRM();

Void Actuator ::getQTRL

This method sends a read package and returns a Qtr sensor’s left phototransistor an unsigned integer. This value represents the QTR’s phototransistor. If an object is in front of the phototransistor, the sensor returns a value of 0, otherwise it returns a value of 1.

Example Usage

uint8_t qtr_leftt=myActuator.getQTRL();

Void Actuator ::getRoll

This method sends a read package and returns roll data.

Example Usage

uint16_t roll=myActuator.getRoll();

Void Actuator ::getPitch

This method sends a read package and returns pitch data.

Example Usage

uint16_t roll=myActuator.getPitch();

Void Actuator ::getJoyX

This method sends a read package and return Joystick X-axis location. The returned value is an integer between 0 and 1023, indicating the position of the joystick along the X-axis.

Example Usage

Uint16_t   joystick_x =  myActuator.getJoyX();

Void Actuator ::getJoyY

This method sends a read package and return Joystick Y-axis location. The returned value is an integer between 0 and 1023, indicating the position of the joystick along the Y-axis.

Example Usage

Uint16_t   joystick_x =  myActuator.getJoyY();

Void Actuator ::getJoyB

This method sends a read package and returns the Joystick’s button. The returned value is either 1 or 0, where 1 indicates that the button is pressed and 0 indicates that it is not pressed.

Example Usage

Uint8_t joystick_button =myActuator.getJoyB();

Void Actuator ::getButton

This method sends a read package and returns the Joystick’s button. The returned value is either 1 or 0, where 1 indicates that the button is pressed and 0 indicates that it is not pressed.

Example Usage

uint8_t button = myActuator.getButton();

Last updated