SMD Blockly: Visual Programming for Smart Motion Control

Introduction

Motion control programming has traditionally been a complex process requiring expertise in programming languages such as C, Python, or embedded programming. Engineers, researchers, and hobbyists needed to understand low-level motor control algorithms, hardware communication protocols, and logic structures to efficiently operate motion devices. However, the advent of visual programming tools has made motion control significantly easier and more intuitive.

One such revolutionary tool is SMD Blockly, a block-based visual programming platform developed by Acrome that enables users to control smart motion devices without writing complex code. Instead of manually writing thousands of lines of script, users can now drag and drop graphical blocks to create logical motor control sequences with ease.

Whether you are a beginner exploring robotics, an educator teaching students, an engineer developing automation solutions, or a researcher testing new motion control algorithms, SMD Blockly is a versatile tool that simplifies the process while offering a high degree of flexibility.

What is SMD Blockly?

SMD Blockly is an intuitive visual programming interface built on Google’s Blockly framework. Instead of traditional text-based programming, it allows users to program motion devices through graphical blocks that snap together, forming logical sequences that define the behavior of motors and actuators.

This approach eliminates many of the common challenges associated with traditional coding, such as syntax errors, debugging complexities, and the steep learning curve of programming languages. It also allows for rapid prototyping, making it a highly valuable tool for education, industrial automation, and robotics research.

Basic PWM motor control setup using SMD Red with SMD Blockly

Who Can Use SMD Blockly?

SMD Blockly is designed for a wide range of users, including:

 Students & Educators: Teaching motion control concepts in a user-friendly environment.

Engineers & Researchers: Quickly testing new motor algorithms and automation workflows.

Hobbyists & Makers: Building smart projects without the need for advanced programming skills.

Industry Professionals: Simplifying automation processes and integrating motion control solutions.

Official Documentation: SMD Blockly Docs

Why Use SMD Blockly?

 1. No Coding Required

  • Designed for non-programmers and beginners.
  • Build motion control logic with drag-and-drop blocks instead of writing code.

 2. Faster Prototyping and Development

  • Rapidly test and modify motion sequences.
  • Immediate feedback without debugging complex scripts.

 3. Error-Free Programming

  • No syntax errors, no typos! Blockly ensures all blocks are pre-validated.
  • Prevents logic mistakes that commonly occur in text-based programming.

 4. Customizable and Expandable

  • Advanced users can create new Blockly blocks.
  • Integrate additional features and sensors into motion sequences.

 5. Open-Source and Free to Use

  • Available on GitHub for modification and community contributions.
  • Users can contribute new features, report bugs, and expand functionalities.

GitHub Repository: Acrome SMD Blockly

How to Use SMD Blockly

Step 1: Access SMD Blockly

SMD Blockly is a Windows application, meaning it requires installation on your computer. To start using it:

  1. Download the latest version from the official SMD Blockly GitHub repository.
  2. Install the application following the on-screen instructions.
  3. Launch SMD Blockly and start exploring the visual programming interface.

Once inside SMD Blockly, you will be greeted with an intuitive workspace where you can drag, drop, and connect blocks to create motion control programs.

Step 2: Understanding the Blockly Interface

Before creating your first program, it’s essential to get familiar with the interface. The main components include:

  • Toolbox (Left Panel) – A categorized collection of blocks, including Motion, Logic, Loops, Math, and Sensors.
  • Workspace (Center Panel) – The area where you assemble your program by connecting blocks.
  • Execution Controls (Top Panel) – Contains Run, Stop, and Reset buttons to manage your program.
  • Output Console (Bottom Panel) – Displays execution messages, errors, and feedback.

Step 3: Creating Your First Program

Example 1: Setting an RGB LED Color in SMD Blockly

This example demonstrates how to configure an RGB LED module using SMD Blockly. The program sets a specific color by adjusting the red, green, and blue intensity values.

Required Blocks

  • Define Master – Sets the communication baud rate.
  • SMD Red – Defines the SMD Red module.
  • Set RGB Color – Configures the RGB LED’s color values.

Step-by-Step Implementation

  1. Set the communication settings:
    • Drag the “Define Master” block into the workspace.
    • Set the baud rate to 115200 for proper serial communication.
  2. Initialize the SMD Red module:
    • Drag the “SMD Red” block into the workspace.
    • Set the Red ID (or adjust according to your module setup).
  3. Set the RGB LED color:
    • Drag the “Set RGB Color” block into the workspace.
    • Configure the color values as follows:
      • Red ID: Corresponding to the LED module
      • Module ID: The RGB LED module’s identifier
      • Red: Red intensity
      • Green: Green intensity
      • Blue: Blue intensity
  4. Run the program:
    • Click the Run button to execute the program and observe the LED color change.
RGB LED color configuration via SMD Blockly with SMD Red

Conclusion: Why You Should Try SMD Blockly

SMD Blockly provides an easy, powerful, and flexible way to control motors visually without needing to write code. Whether you are a beginner learning motion control or an advanced user looking for customization, the platform offers intuitive motor programming, real-time execution, and scalability.

Key Takeaways

  • Drag-and-drop programming with no coding required
  • Real-time motor control and execution
  • Error-free, fast, and efficient
  • Custom block support for advanced users
  • Open-source and freely accessible

Start Now

Unlock the power of visual programming and start controlling your motion devices today.

Building a 4-DoF Serial Robotic Arm with Smart Motion Devices

Introduction

Makers/hobbyists and academicians are often willing to build their own serial robotics arm. This is because the robotic arms have a good amount of engineering challenges and learning topics for their internals and how they work. Read our other blog post if you need some information about the different type of robotic manipulators and their building blocks.

In this article, we will delve a bit more into the serial robotics manipulators and share a simple design on building an affordable and a decent performance robot. Let’s start with the ingredients first:

List of Items Required for Building a Serial Robotic Arm

There are 6 major components that are needed to build a Serial Robot Arm. Here’s a the list of these components with some explanation as well:

  1. Actuators: The serial robotic arm employs multiple motors for rotating its each or at least major motion related joints. Electrical motors (mostly DC, servo for high-speed or stepper motor for low-cost options), which are coupled with gear mechanisms are used to form the actuators of the robotic arms. There are minority cases where another type of actuation mechanism is used such as pneumatic or elastic materials, but those really are not something one can see in daily life.
  2. Sensors: Encoders, loadcells, accelerometers and some digital Input/Output nodes are integrated into the system, offering different ways of feedback for control algorithms. 
  3. Linkage and Mounting Parts: To interconnect the actuators to each other and also to make the robotic arm to reach to a distance, some linkage and also mounting parts are needed. The linkage parts can be considered as the exo-skeleton of the robotic arm, whereas the mounting parts may  not be seen easily. 
  4. Control Unit/Box: An electronics control unit, mostly placed inside a bow or underneat the robotic arm. These are equipped with a specialized control unit that interfaces with Motors / Motor Drivers, sensors and other input/output devices of the robot.
  5. Power Unit/Supply: A suitable and powerful enough power supply is required to power all the actuators, sensors and control unit/box.
  6. Software: Robot Arms have 2 different software options. The industrial arms have a locked firmware and gives access to the robot through an API for supervisory control and robotic tasks. The open-source robots such as Acrobot provide direct access to the motor drivers hence gives the user the ability to control each joint individually. The latter option should also include kinematic and trajectory software functions for the robot to operate in a supervisory control manner similar to the industrial robotic arms.

Introduction to 4-DoF Robotic Arms

While 6 or more-DoF arms offer a wide range of motion and versatility, they often come with complexities that are not required for many common tasks. This is where 4-DoF robotic arms come into play, offering a more streamlined, efficient, and cost-effective solution for specific applications. 

3d model of a 4-dof robotic arm controlled by acrome smart motor drivers

Axes and Motion Capabilities

A 4-degree of freedom robotic arm -as its name stands for- has four primary axes that provides manipulator action and capabilities. These axes are as follows:

  • Axis for Base Rotation: The base rotation axis allows the arm to swivel 360 degrees in a horizontal plane. This is particularly useful in tasks that require the arm to sort items from multiple directions or assemble parts that come from various angles.
  • Axis for Shoulder Movement: The shoulder axis enables the arm to extend or retract linearly. This is crucial for tasks that require the arm to reach into confined spaces, such as retrieving items from shelves or extending over a conveyor belt to pick up objects.
  • Axis for Elbow Movement: The elbow axis provides the arm with vertical movement capabilities. This is essential for lifting or lowering objects with precision, making it invaluable in applications like welding, where the arm needs to maintain a specific height for optimal results.
  • Axis for Wrist Rotation: The wrist rotation axis allows the arm’s end effector to rotate, adding a layer of finesse to tasks that require intricate movements, such as painting intricate designs or performing surgical procedures.

Use Cases and Applications

  • Manufacturing: In automotive assembly lines, 4-DoF arms are indispensable for intricate welding tasks. Their precision ensures high-quality joins, eliminating the need for human intervention and thereby reducing the margin for error.
  • Healthcare: In the medical field, these arms are revolutionizing minimally invasive surgeries. Their ability to maneuver surgical instruments with pinpoint accuracy significantly reduces the risk of complications, making surgeries safer and more efficient.
  • Agriculture: In the realm of modern farming, 4-DoF arms are being employed to harvest delicate crops like tomatoes or strawberries. Their precise movements ensure that the fruit is picked without any damage, optimizing yield and reducing waste.
  • Research and Education: Educational institutions and research labs are increasingly adopting these arms to study robotics kinematics and provide hands-on STEM learning experiences.

Advantages Over Other Types

  • Cost-Effectiveness: One of the most compelling advantages of 4-DoF arms is their affordability compared to 6-DoF arms, making them a more accessible option for startups and SMEs.
  • Ease of Use: The reduced complexity in the control algorithms for 4-DoF arms translates to a shorter learning curve, allowing operators to become proficient more quickly.
  • Energy Efficiency: These arms are designed with energy conservation in mind. Fewer motors and joints mean less power consumption, which in turn leads to lower operational costs.

Control of the 4-DoF Robotic Arm with Smart Motion Devices (SMDs)

The Brain Behind the Brawn

Smart Motion Devices (SMDs) play a crucial role in the operation of 4-DoF robotic arms. They offer real-time monitoring and adaptability, adjusting motors control signals in real-time synchronously. Please check our Synchronizing Linear Motors and DC Motors article to learn how multiple SMDs can be interconnected and used for driving multiple and different types of motors synchronously.

acrome smart motor drivers port diagram

The synchronous motor control is especially valuable in robot arm applications, to achieve trajectory movement patterns, like placing an object in a confined or tight space. Each motor has to be controlled precisely during the course of motion (where the synchronous control comes into play) for the arm to follow a predefined trajectory.

In addition to the synchronous position control, the current level of the motors should also be monitored to see if the robot arm is moving freely or if it has hit any obstacle during its motion. Current limiting and active current monitoring are tremendously important for collaborative robot arm applications. Current monitoring is a built-in feature of the SMDs as well.

Last but not least, the sensor data needs to be read by the controller in a timely and precision manner as well. Robot arm can not see its environment directly hence auxiliary sensors are needed for this task. The sensor add-ons of the SMD family is a very neat feature that not only solves this requirement but also provides an easy and clean cabling all around the robot. Both the motor driver boards and also the sensor nodes are daisy chained, hence a single communication line passes both the motor and the sensor data to the controller. Please check the below diagram to see an outline for the connections:

Bill of Materials

    Creating a 4-DoF robotic arm is not just about assembling mechanical parts; it’s about integrating a variety of components into a cohesive, functional system. 

acrome smd module and connection diagram for 4-dof robotic arm

Here’s a list of materials you’ll need, along with their respective roles in the assembly:

Mechanical Components

  • Frame: Provides the structural integrity for the arm.
  • Gearbox: Facilitates the mechanical advantage needed for lifting heavy objects.
  • Bearings: Ensures smooth rotational movements at various joints.

Electrical Components

  • Motors: Powers the arm’s movements.
  • Sensors (Encoders, Gyroscopes, etc.): Provides feedback for precise control.
  • Power Supply Unit: Fuels the electrical components.

Control Systems

  • Smart Motion Devices (SMDs): The control center for the robotic arm, offering real-time monitoring and adaptive control algorithms.
  • Microcontroller: Executes the control algorithms and interfaces with the SMDs.

Software and Firmware

  • Control Algorithms: Software logic that dictates the arm’s movements.
  • User Interface: Software for human-machine interaction.

Optional Add-ons

  • Camera Module: For computer vision tasks.
  • Grippers or End Effectors: Specialized tools for specific tasks, such as welding or painting.

The introduction of 4-DoF robotic arms represents a significant advancement in fields ranging from manufacturing and healthcare to research and education. The integration of Smart Motion Devices (SMDs) further enhances these systems with features such as real-time sensing, a built-in PID controller, and an easy-to-use graphical user interface. If you are a researcher, educator or industry professional, it is time to embrace this technology.

Delta Robot and Conveyor Example: A Glimpse into Industrial Automation

Part 1: What is a Delta Robot and What Does It Do?

In today’s world, robotics is transforming how we teach and learn about automation. One such educational tool is the Delta Robot, a precision parallel robotic arm with three degrees of freedom (3-DOF), meaning it can move its end-effector in X, Y, and Z coordinates. The Delta Robot serves as a scaled-down version of the large robotic arms commonly used in industries but is primarily used for educational purposes in school laboratories.

Its main purpose is to show to students, particularly in Control and Automation fields, the fundamental principles of robotic arms, including kinematics and precision handling. Large industrial robotic arms are not feasible for lab environments due to their size and complexity, so the Delta Robot provides a more manageable and safer alternative for hands-on learning.

Figure 1: Acrome Delta Robot

Part 2: Kinematic Equations – The Core of Robotic Motion

At the core of the Delta Robot’s functionality lies kinematic equations, which describe the robot’s motion. These equations allow us to calculate the exact position and orientation of the robot’s end-effector based on joint angles. There are two primary types of kinematic equations:

  • Forward Kinematics: This method calculates the position of the robot’s end-effector based on the angles of its joints, effectively converting angles into X, Y, and Z coordinates.
  • Inverse Kinematics: This is the reverse process, where we specify the desired position of the end-effector, and the system calculates the necessary joint angles to achieve that position.

By mastering these equations, students can understand how robots are programmed to move accurately within their workspace.

Part 3: Conveyor Example Using a Delta Robot

In this educational setup, we applied the Delta Robot in a conveyor system example. A conveyor is a mechanical device that moves objects from one location to another. This project demonstrated how a Delta Robot can be integrated with a conveyor to recognize objects and perform precise handling tasks. While industrial robots are often seen in factories working alongside conveyors, in this case, the Delta Robot will be able to operate in a school lab environment, showcasing a similar yet smaller-scale interaction.

The custom conveyor designed for this setup allows the Delta Robot to detect various materials moving along the belt and place them in specific positions. One of the most intriguing parts of this process was object recognition—where the robot identifies objects, detects their shapes, and calculates their position in real-world coordinates.

Figure 2: Flow Chart for Conveyor App

Part 4: Converting Pixel to Real-World Coordinates

To accurately place objects, the Delta Robot must first convert the objects’ position from pixel coordinates (captured by the camera) into real-world coordinates that it can understand. We achieved this using the following formula:

Formulas to calculate the pixels vs real-world coordinates
Scaling calculations

Where:

  • OffsetX and OffsetY are real-world offsets,
  • PixelX and PixelY are the object’s position in the camera’s field,
  • CenterX and CenterY are the pixel coordinates of the camera’s center,
  • ScaleX and ScaleY are the scaling factors converting pixel distance to real-world units.

By using this conversion, the robot can accurately map the detected object’s position on the conveyor belt, ensuring it picks up and handles objects precisely.

Part 5: Detecting Shapes with the Delta Robot

In our object recognition process, the Delta Robot first captures an image of the conveyor system. Using image processing techniques such as thresholding and contour detection, the system identifies shapes like squares, triangles, and circles. Once a shape is detected, the robot calculates its centroid (center of the shape) and applies the pixel-to-real-world conversion formula to determine its precise location on the conveyor.

Below is the algorithm and pseudo code that explains how to detect the object.

Detect and Pixel to Real Coordinate Algorithm:

The Delta Robot first captures an image of the conveyor system in the object recognition process. Using image processing techniques such as thresholding, eroding and contour detection, it identifies shapes like squares, triangles, and circles. When a shape is detected, the robot calculates its centroid and applies the pixel-to-real-world conversion formula to determine its precise location. The algorithm begins by initializing the camera and capturing an image, which is then flipped horizontally. A perspective transformation is applied using predefined corner points, and the resulting image is converted to grayscale. Next, binary thresholding and erosion operations are used to enhance the shapes in the image. Contours are detected, and properties such as the centroid, bounding shapes, and aspect ratio are calculated for each contour.

If the Y-coordinate of the centroid is near a specified value, the type of shape is determined, and labels such as square, triangle, or circle are displayed on the console. The centroid of each shape is marked, and the current time is recorded. If the shape has not been logged before, its data is recorded with a timestamp, and the coordinates are converted to the robot’s real-world system. When the coordinates are valid, they are printed along with the shape name, and the coordinates are returned. Throughout this process, the robot adjusts its movements based on the detected shape, allowing it to pick up and place objects accurately.


Detect and Pixel to Real Coordinate Pseudo Code:

FUNCTION detect()
    INITIALIZE camera
    READ frame from camera
    FLIP frame horizontally
    DEFINE centroids as predefined coordinates
    DEFINE pts1 and pts2 for perspective transformation
    APPLY perspective transformation to the frame
    CONVERT transformed image to grayscale
    APPLY binary threshold
    ERODE  the threshold image
    FIND contours in the image
    DEFINE line_y as 350
    DRAW horizontal line on the image
    FOR each contour DO
        APPROXIMATE contour shape
        CALCULATE contour properties (centroid, bounding rectangle, aspect ratio)
        IF centroid_y is near line_y THEN
            PRINT width and height
            DEFINE shape_name as empty string
            DETERMINE shape based on sides and aspect ratio
                IF square THEN DISPLAY "Square"
                ELSE IF triangle THEN DISPLAY "Triangle"
                ELSE IF circle THEN DISPLAY "Circle"
            DRAW circle at centroid position
            GET current_time
            IF shape is new THEN
                LOG shape data with timestamp
                CONVERT coordinates to robot's real-world system
                IF coordinates are valid THEN
                    ADJUST and PRINT coordinates with shape name
                    RETURN coordinates and label
    RETURN None
END FUNCTION

Depending on the detected shape, the robot can adjust its movements to ensure the object is picked up and placed correctly. For instance, if the robot identifies a square, it uses the centroid coordinates to guide its gripper to the correct position, showcasing the power of automation.

Conclusion: Bringing Automation to the Classroom

This project showed the Delta Robot’s potential for students, highlighting its ability to perform tasks such as object recognition, precise motion, and shape detection—skills essential for real-world automation. Although the conveyor project has not yet been integrated into the educational environment, the progress made with the Delta Robot lays a promising foundation for future applications. It continues, and will continue, to serve as a valuable teaching tool, preparing students for the complexities of industrial automation systems.

Items used in the example system
Figure 3: Camera View of the Delta Robot, Detect Centroid Algorithm

In conclusion, this project shows the Delta Robot’s potential for students, highlighting its ability to perform tasks such as object recognition, precise motion, and shape detection — the essential skills for real-world robotic process automation (RPA). Although this is a conceptual digital conveyor project, the progress made with the real Delta Robot hardware lays a promising foundation for real-world applications.

ACROME’s Delta Robot continues to be a valuable teaching tool, preparing students for the complexities of industrial automation systems.

References:

Craig, J. J. (2005). Introduction to robotics: Mechanics and control (3rd ed.). Pearson.