A cutting-edge three-axis parallel platform has been engineered to dynamically control the erratic motion of a ping-pong ball in real-time, serving as a compelling showcase for a new generation of high-performance servomotors. This sophisticated demonstration integrates synchronized servo actuation with robust visual feedback and complex real-time kinematic computations, pushing the boundaries of precision motion control. Developed by engineering experts, including Charan Bhamra, a Mechatronics engineer affiliated with Monolithic Power Systems, the platform meticulously addresses critical challenges such as visual-feedback latency, multi-axis synchronization, and the execution of real-time inverse kinematics and proportional-integral-derivative (PID) control on embedded hardware. This innovative approach not only highlights the capabilities of integrated servomotors but also demonstrates a streamlined solution for applications demanding exceptional accuracy and responsiveness across various industrial and medical sectors.
The Genesis of Precision: A Showcase Platform

The core objective behind the development of this parallel-kinematics platform was to vividly illustrate the performance advantages of a specific line of integrated servomotors, notably the EZmotion MMS740100-24-C2-1 model. By engaging in tasks like dynamic balancing, circular swirling, and precise bouncing of an inherently unstable ping-pong ball, the system provides a tangible example of what these advanced motors can achieve. The choice of a ping-pong ball, a lightweight object prone to chaotic movement with the slightest disturbance, was deliberate; it amplifies the challenge, making the demonstration of precise, real-time control all the more impressive.
Parallel-kinematics platforms, often called parallel manipulators or Stewart platforms, are renowned for their high stiffness, high speed, and exceptional precision compared to their serial manipulator counterparts. Their inherent design, where multiple kinematic chains connect the base to the end-effector, allows for superior force distribution and reduced accumulated errors. This makes them ideal candidates for tasks requiring dynamic and precise movements, such as flight simulators, machine tools, and intricate robotic surgeries. The motors employed in this demonstration are "smart motors," featuring onboard drivers, integrated angle sensors, and CANopen support. This integration facilitates high-resolution motion, ultra-fast real-time response, and tight multi-axis synchronization, which are non-negotiable requirements for advanced robotic systems.
Unpacking the System Architecture: A Symphony of Technologies

The success of the ping-pong ball control system hinges on a meticulously designed system architecture that intelligently distributes computational roles between different hardware components. At its heart, the system is a closed-loop control mechanism that continuously senses, processes, and actuates.
Visual Tracking and Image Processing for Dynamic Feedback
The initial input for the control loop comes from a top-mounted USB camera, which captures video frames at a moderate but effective rate of 40 frames per second (fps). This visual data is crucial for determining the ping-pong ball’s exact position and height. A Raspberry Pi 5 device is tasked with handling the demanding visual feedback processing. It runs a lightweight Python script leveraging the powerful OpenCV computer vision library. The processing pipeline involves several key steps:

- Gaussian Blur: Applied to the raw video frames to reduce noise and smooth the image, enhancing the accuracy of subsequent detection steps.
- HSV Color Space Conversion: Frames are converted from the standard RGB color space to Hue, Saturation, Value (HSV). This conversion is critical because HSV is more robust to variations in lighting conditions, making color-based object detection more reliable.
- Color Masking: To specifically isolate the ping-pong ball, which is intentionally colored orange, an orange color mask is applied. This filters out all other colors in the scene, leaving only the ball.
- Contour Filtering: After masking, contour detection algorithms identify the boundaries of the isolated orange object. Further filtering helps distinguish the actual ball from any spurious noise or reflections.
- Center Coordinate Extraction: The system then identifies the smallest circle that completely encloses the largest detected contour, providing the precise X and Y coordinates of the ball’s center in the 2D plane.
- Z-Position Determination: The ball’s vertical (Z) position, or height, is cleverly determined by its apparent diameter in pixel units. As the ping-pong ball moves closer to the camera, its detected pixel diameter increases, and vice versa. This pixel information is calibrated and translated into a real-world Z-position in millimeters.
The Raspberry Pi 5 also connects to a local display via HDMI, providing a live feed of the camera input overlaid with the post-processed ball tracking frames, offering real-time visual verification of the system’s performance. The calculated ball position (X, Y) and height (Z) data are then transmitted to the Cortex M4 microcontroller unit (MCU) via a Serial Peripheral Interface (SPI) communication, a high-speed synchronous serial data protocol commonly used for short-distance communication in embedded systems.
The Brain of the Operation: Real-time Control and Kinematics
The Cortex M4 MCU serves as the central control unit, acting as the motors’ initiator controller. Its primary responsibilities include managing the platform’s core control loop and executing the complex kinematic model. The choice of a dedicated MCU for critical control tasks, rather than relying solely on the Raspberry Pi, is strategic. MCUs offer deterministic performance, lower latency, and greater reliability for time-sensitive control operations, whereas a general-purpose OS on the Raspberry Pi might introduce unpredictable delays.

The core control algorithm is built around a sophisticated PID (Proportional-Integral-Derivative) controller. This algorithm continuously calculates the error between the desired ball position and the actual ball position (as provided by the Raspberry Pi). It then converts this positional error into a precise target platform tilt angle and Z-translation. PID controllers are fundamental in industrial control systems for their ability to maintain output at a desired setpoint by minimizing error.
Following the PID calculation, an inverse kinematic model translates the required platform tilt-angle information and Z-translation into individual position targets for each of the three servomotors. Inverse kinematics is essential for parallel robots; it calculates the joint angles (or in this case, motor crank angles) required to achieve a desired end-effector (platform) pose in space. Without these calculations, precise control of the platform’s orientation and position would be impossible.
Synchronized Actuation via CANopen CSP Mode

Once the individual motor position targets are determined, the EZmotion servomotors enter Cyclic Synchronous Position (CSP) mode via the CANopen protocol. CANopen is a high-level communication protocol and device profile specification for embedded systems used in automation. It is built on top of the Controller Area Network (CAN) physical layer and is widely adopted in industrial automation due to its robustness, determinism, and ability to synchronize multiple devices.
In CSP mode, the MCU sends precise position setpoints to each motor at a fixed and deterministic update rate. This is critical for achieving tight multi-axis coordination and jitter-free motion. Rather than each motor generating its own trajectory, they rely on the central MCU to continuously feed updated position targets. To ensure continuity and smoothness between these discrete updates, each motor internally performs linear interpolation between consecutive setpoints. This means the motor shaft follows a seamless trajectory even though position targets are sampled at intervals. Process Data Object (PDO) messages, containing the absolute target positions, are broadcast synchronously across the CAN bus. This robust communication mechanism ensures that all three limbs of the platform move in perfect concert, allowing the system to stabilize the platform dynamically in response to fast-changing inputs.
Inside the EZmotion Servomotor: The Power of Integration

The EZmotion MMS740100-24-C2-1 servomotors are a testament to the benefits of integration in motion control. Each 40mm smart motor is a fully self-contained unit, integrating a permanent-magnet synchronous motor with its entire control and power electronics. This comprehensive integration includes:
- Built-in Servo Drivers: Efficiently provide power to the motor windings, precisely controlling current for smooth and accurate torque delivery.
- Embedded Motion Controller: Runs a nested control loop structure, regulating current, velocity, and position in real-time. This layered control ensures optimal performance across various operational demands.
- Onboard CAN Transceiver: Enables direct integration into the CANopen network, simplifying communication infrastructure.
- Dedicated Power Management Solution: Ensures stable internal voltages, crucial for the reliable and safe operation of all integrated electronic components.
- High-Resolution Magnetic Position Sensor: A 14-bit resolution sensor tracks the shaft’s position with sub-degree accuracy, providing the essential feedback for the internal control loops and precise external positioning.
By integrating the sensor, driver, controller, communication interface, and power management into a single compact device, these servomotors dramatically simplify system architecture, reduce wiring complexity, and eliminate the need for external boards and controllers. This "plug-and-play" solution significantly cuts down on integration time and potential points of failure, offering a robust and streamlined approach to complex motion control.
Dynamic Control Modes: Beyond Static Balancing

The demonstration platform showcases three distinct operational modes, each highlighting different facets of its real-time control capabilities:
-
Balancing: In this fundamental mode, the objective is to maintain the ping-pong ball precisely at the center of the platform. The PID controller continuously minimizes the positional error by adjusting the platform’s tilt angles (Θx and Θy) to counteract any movement of the ball away from the center. This mode demonstrates the system’s ability to achieve and maintain a stable equilibrium.
-
Circular Swirling: This mode introduces a dynamic trajectory. The target is no longer a fixed point but a predefined time-varying reference path forming a circle with a 100mm radius in the XY plane. The PID controller guides the platform to make the ball follow this circular trajectory smoothly for a duration of 30 seconds, showcasing the system’s ability to execute complex, continuous movements.

-
Bouncing: Perhaps the most challenging mode, bouncing requires precise vertical motion control. A target height is set, and the target location remains the center of the platform. To initiate bouncing, the system first enters an "oscillation phase," where the platform undergoes rapid vertical movements to impart sufficient mechanical energy to lift the ball off its surface. This phase is carefully designed to gradually increase the ball’s energy. Once a predefined energy threshold is reached (indicating consistent bouncing), the controller transitions to the sustained "bouncing mode." In this phase, the controller applies minimal, synchronized vertical motion to maintain the bounce, focusing on optimal energy efficiency rather than driving the ball higher. The ball’s total energy (kinetic and potential) and velocity are continuously estimated based on its current and previous heights over the timestep, allowing for precise energy management.
Operational Sequence and User Interaction
The system’s operation follows a well-defined sequence designed for ease of use and consistent demonstration. It begins with a torque-based homing routine for the servomotors. During this process, all three limbs retract inward at a controlled speed until they reach their mechanical hard stops, establishing a repeatable and accurate zero position for each motor. Once homing is complete, the platform automatically rises to a predefined mid-height along the Z-axis. A green status LED illuminates, signaling successful initialization and indicating that a user can safely place a ping-pong ball on the platform.

After the ball is placed, the manipulator enters its active sequence, starting with the balancing mode. It then transitions into the circular swirl mode for 30 seconds, followed by the bouncing mode for another 30 seconds. This sequence continuously loops as long as the system remains active, providing a comprehensive demonstration of its capabilities. Throughout the entire demonstration, a 7-inch screen provides live visual feedback of the ball’s motion and the system’s tracking performance.
Broader Impact and Real-World Implications
The technological prowess demonstrated by this ping-pong ball platform extends far beyond a mere exhibition. The principles and components showcased have profound implications for a wide array of real-world applications across multiple industries.

Medical Robotics: In the demanding field of medical robotics, architectures akin to this demonstration are vital for stabilizing delicate endoscopic instruments, guiding surgical tools with sub-millimeter precision, and assisting in minimally invasive procedures. The need for fine resolution, jitter-free motion, and real-time responsiveness is paramount to improve surgical outcomes, reduce patient recovery times, and enable new surgical techniques. Integrated servomotors simplify the design of complex robotic arms and manipulators that operate in confined spaces, enhancing both precision and reliability.
Industrial Automation: The industrial sector stands to gain immensely from such advanced motion control. Integrated servomotors are increasingly being adopted to impart motion to critical components like optical alignment stages, high-speed pick-and-place heads, and micro-assembly manipulators. In environments where throughput and accuracy directly translate to productivity and product quality, the ability to execute highly coordinated and deterministic movements is a game-changer. Delta 3D printers and certain delta pick-and-place machines, which utilize parallel kinematic structures, are prime examples of existing applications that benefit from servo-driven precision. The simplified wiring and reduced component count offered by integrated smart motors also contribute to lower maintenance costs and increased uptime in factory settings.
The Future of Motion Control: This demonstration by EZmotion, supported by the engineering insights of professionals like Charan Bhamra, underscores a significant trend in industrial technology: the move towards smarter, more integrated, and more autonomous systems. As industries push the boundaries of automation and precision, the demand for highly responsive and easily deployable motion control solutions will only grow. The ability to seamlessly integrate advanced sensing, processing, and actuation into compact, intelligent units represents a leap forward, promising to unlock new possibilities for robotics, manufacturing, and beyond. The successful control of a seemingly simple ping-pong ball, therefore, serves as a powerful metaphor for the sophisticated control capabilities now achievable in the most complex engineering challenges.