Pika Spark is a matchbox-sized high-performance micro robot control system combining an unprecedented amount of computing power and interfaces within an extremely small form factor. The Pika Spark has two (2) galvanically isolated CAN interfaces which can be used for communication with external devices. Galvanic isolation prevents ground-loops and increases overall system resilience and is an important feature in industrial-grade control systems.
This case stury explores the Pika Spark's CAN interface can be used to control various different robot types leveraging the Cyphal protocol:
Fig. 1: T07 - a two-wheel drive robot in tricycle configuration
In order to simplify control and automation all of those three robots share a very similar software and hardware architecture: they are all differential-drive robots whose actuators are DC motors fitted with hall encoders which enables RPM control. In order to control this type of robots a generic robot controller board called CyphalRobotController07/CAN has been developed.
The CyphalRobotController07/CAN is capable of driving up to two DC motors, capture and use encoder feedback for RPM control, evaluate the state of an emergency stop and many other features. The board communicates with other Cyphal nodes via CAN leveraging the 107-Arduino-Cyphal library. It can be extensively configured using Cyphal's register API, which is necessary even for such such architecturally similar robots, as the gear ratio and encoder ticks-per-revolution differ.
Fig. 2: 3D Rendering of the CyphalRobotController07/CAN done in KiCad
Each of the three different robot types mentioned in the introduction contain one CyphalRobotController07/CAN board - with the exception of T07-4WD which contains four DC motors and hence requires two CyphalRobotController07/CAN boards.
Fig. 3: T07-4WD - a four-wheel drive robot with two CyphalRobotController07/CAN boards
Like the hardware architecture the software architecture is quite simple: On the Pika Spark a ROS2 node called t07_robot is executed inside a Docker container. t07_robot is receiving motor velocity set points for the motors on the left and on the right side from another ROS2 node called t07_teleop which is executed on your PC and communicates with the Pika Spark via WiFi. t07_robot is then turning those set points into the required RPM targets for the motors, generates the required Cyphal messages and transmits those messages via Pika Spark's CAN interface to the CyphalRobotController07/CAN board(s).
Fig. 4: Software architecture for controlling various robots via Pika Spark
In order to ease installation and execution of the t07_robot ROS2 node on the Pika Spark a whole set of Dockerfile, docker build and run scripts have been prepared in the t07_docker package. Running the required ROS2 node on the Pika Spark is therefore as simple as executing the following commands:
git clone https://github.com/107-systems/t07_docker && cd t07_docker
./docker-build.sh
sudo ./docker-run-pika-spark.sh [t07.py | t07_4wd.py | t07_tracked.py]
Fig. 5: T07-Tracked - a differential-drive tracked robot with rubber tracks
With the introduction of all three robots as well as the underlying hardware and software architecture in place let's take a look at those robots in action:
Repository name | Repository description |
---|---|
107-systems/T07 | CAD and STL files for the T07 and T07-4WD differential-drive outdoor robots. |
107-systems/T07_threaded | CAD and STL files for the T07-Tracked differential-drive outdoor robots. |
107-systems/t07_robot | ROS control code for the CyphalRobotController07/CAN based mobile outdoor robots. |
107-systems/t07_teleop | Keyboard based teleoperation for the CyphalRobotController07/CAN based mobile outdoor robots. |
t07-systems/t07_docker | Dockerfile and scripts to run the requiredcontrol software on the Pika Spark. |