Design and Implementation of a Smart Cloud Video Companion Robot

The increasing integration of robotics into domestic life has opened new avenues for interactive systems aimed at enhancing daily living. Among these, companion robots designed for remote interaction and monitoring present significant practical value. This paper details the design and implementation of a smart cloud video companion robot. The primary objective was to create a robust platform capable of remote environmental surveillance and real-time interactive pet companionship, leveraging stable wireless communication and low-latency video streaming.

The core of this companion robot is built around a multi-controller architecture for optimal performance. The main computational unit is an NXP i.MX 8 application processor, featuring a quad-core ARM Cortex-A53 cluster, which runs a embedded Linux operating system. This powerful core handles high-level tasks such as video capture, encoding, network communication, and system orchestration. For time-critical control functions, a subordinate STM32F103 microcontroller is employed. This MCU is dedicated to real-time closed-loop control of the mobility system and the pan-tilt mechanism, ensuring precise and responsive motion. The overall system can be segmented into three primary layers: the robot本体, the data transmission链路, and the user terminal device.

The mobility of the companion robot is a critical feature, achieved through a Mecanum wheel chassis. This four-wheel configuration, with each wheel controlled by an independent DC geared motor and incremental encoder, enables holonomic movement—allowing the robot to translate in any planar direction and rotate simultaneously. To achieve accurate speed control for each wheel, an improved incremental Proportional-Integral-Derivative (PID) algorithm is implemented on the subordinate controller. The control law for the incremental PID is given by:

$$ \Delta u(t) = K_p[e(t)-e(t-1)] + K_i e(t) + K_d[e(t)-2e(t-1)+e(t-2)] $$

where \( \Delta u(t) \) is the control output increment, \( e(t) \) is the current error between the target and measured wheel speed, and \( K_p \), \( K_i \), \( K_d \) are the proportional, integral, and derivative gains, respectively. This algorithm calculates the necessary adjustment to the motor’s PWM duty cycle, allowing the companion robot to execute smooth and accurate trajectories based on velocity vectors received from the user.

For panoramic viewing, the companion robot is equipped with a camera mounted on a motorized pan-tilt unit. The horizontal rotation is powered by a brushless DC (BLDC) motor controlled via Field-Oriented Control (FOC). FOC, or vector control, decouples torque and flux production, enabling smooth, efficient, and precise control similar to a DC motor. The core of the FOC algorithm involves Space Vector Pulse Width Modulation (SVPWM). The three-phase voltages are represented as:

$$
\begin{aligned}
U_A(t) &= \sqrt{2}U_m \cos(2\pi f t) \\
U_B(t) &= \sqrt{2}U_m \cos(2\pi f t – 2\pi/3) \\
U_C(t) &= \sqrt{2}U_m \cos(2\pi f t + 2\pi/3)
\end{aligned}
$$

The SVPWM technique synthesizes a desired reference voltage vector \( U_{ref} \) by strategically switching between the eight fundamental voltage space vectors (U0-U7) over a modulation period \( T \), following the principle of volt-second balance:

$$ \int_0^T U_{ref} \, dt = \int_0^{T_x} U_x \, dt + \int_{T_x}^{T_x+T_y} U_y \, dt + \int_{T_x+T_y}^{T} U_0^* \, dt $$

Here, \( U_x \) and \( U_y \) are the active adjacent vectors defining the sector where \( U_{ref} \) lies, and \( U_0^* \) represents a zero vector. The microcontroller calculates the active times \( T_x \) and \( T_y \) to generate the appropriate PWM signals for the three-phase inverter driving the BLDC motor, resulting in precise 360-degree camera positioning.

Module Key Component Primary Function
Main Controller NXP i.MX 8 (Cortex-A53) Linux OS, Video Processing, Network Stack
Subordinate Controller STM32F103 (Cortex-M3) Real-time PID & FOC Motor Control
Mobility 4x Mecanum Wheels with DC Motors & Encoders Holonomic Plane Motion
Vision Camera with BLDC Pan Motor 360° Horizontal Rotation, Video Capture
Communication Intel 9260 AC (Wi-Fi/Bluetooth) Wireless Data & Command Transmission
Power Custom Switching Regulators (based on TPS54531) Provide 5V, 7.2V, 3.3V Rails

The hardware design of this companion robot emphasizes reliable power delivery and robust motor control. The power system utilizes three independent switching regulator circuits based on the TPS54531 buck converter IC to generate stable voltage rails for digital logic (5V/3.3V), analog circuits, and the pan-tilt servo (7.2V), each capable of delivering up to 5A with high efficiency. The four DC motors for the Mecanum wheels are driven by A4950 full-bridge driver chips. These chips receive PWM and direction signals from the STM32F103 and provide the necessary current to the motors, while the integrated encoders provide feedback for the PID loops. Wireless connectivity is achieved via an Intel Wireless-AC 9260 module connected through a Mini PCIe interface, providing both Wi-Fi for high-bandwidth video and Bluetooth for potential accessory connectivity.

The software architecture is designed to leverage the strengths of both processors. The main controller runs a Linux stack where the video pipeline is a critical component. Video frames are captured from the camera using the V4L2 (Video for Linux 2) framework. These raw frames are then encoded using the FFmpeg library, typically into H.264 format, and packaged into an FLV container. The encoded stream is pushed to a remote media server using the Real-Time Messaging Protocol (RTMP). A separate TCP socket connection handles the bidirectional transmission of control commands (e.g., movement vectors, pan angles) and status data between the companion robot and the server.

On the subordinate STM32F103, two main control routines run. The mobility control software continuously reads quadrature encoder counts to calculate actual wheel speeds, compares them to the target speeds received via UART/Modbus from the main controller, and executes the incremental PID algorithm to update the PWM outputs to the A4950 drivers. Concurrently, the pan-tilt control software receives target angle commands, processes them through the FOC (SVPWM) algorithm to control the BLDC motor, and manages any optional servo-based interaction modules attached to the robotic arm.

The performance of the complete companion robot system was rigorously tested. The end-to-end video latency was measured by pushing a stream from the robot to a cloud server (Alibaba Cloud, Beijing) and pulling it from a client. The stream was configured at 720p resolution, 20 fps, and 2 Mbps bitrate. The results from a sample test run are summarized below:

Test Sequence 1 2 3 4 5 6 7 8 9 10 Average
Latency (ms) 130 160 150 160 150 150 160 140 150 150 150

The average latency of approximately 150 ms provides a responsive, near real-time video feedback for the user. Command and control latency over TCP was negligible. Furthermore, the companion robot maintained a stable connection and responsive control within a radius of approximately 10 meters from the Wi-Fi access point, demonstrating robust wireless performance suitable for typical home environments.

In conclusion, this project successfully demonstrates the development of a fully functional smart cloud video companion robot. The design integrates advanced embedded processing, real-time closed-loop control algorithms for precise mobility and positioning, and efficient multimedia streaming. The hybrid architecture using a Linux-based main controller and a real-time subordinate MCU proves effective for managing complex, concurrent tasks. The system achieves low-latency remote interaction, making it viable for applications in home monitoring and interactive pet companionship. Future enhancements for this companion robot platform could focus on integrating more advanced computer vision for autonomous navigation or object tracking, developing more sophisticated interactive modules for the robotic arm, and implementing stronger security protocols for data transmission. The modular design of this companion robot provides a solid foundation for such expansions.

Scroll to Top