At Phoenix Industries, we manufacture a wide range of products, and one of our key products is the toothbrush. From raw materials to the final toothbrush, we handle the entire production process in-house. Among the various steps involved in this process, one of the most significant and time-consuming tasks is the packing and sealing of the toothbrushes. To address this challenge, our team devised a solution - the creation of a machine capable of packing and sealing toothbrushes within a 3-second cycle time. Below, I'll explain how we achieved this.
In the successful completion of this project, two major teams collaborated: the mechanical team and the electronics and programming team. In my role as a mechatronics engineer at Phoenix Industries, I was primarily responsible for the electrical system and programming aspects of the machine. The following steps outline the process that enabled the machine to function efficiently:
As the main controller for this machine, we opted for the Arduino Portenta H7 board, featuring a high-performance chip based on the STM32 H7 series. This microcontroller boasts a dual-core processor, which proves exceptionally valuable when dealing with the intricacies of a complex machine like the one we were developing.
I utilized Visual Studio Code with PlatformIO for programming the Arduino Portenta. Additionally, this machine required the execution of multiple functions simultaneously, which added to the complexity of the project. To ensure the machine operated within the 3-second cycle time, it presented an extremely challenging task.
We employed two stepper motors in this project, one being the NEMA 23 stepper motor with a closed-loop system, and the other being the NEMA 32 stepper motor. These motors were controlled by the Arduino Portenta, which provided very high precision and accuracy
Additionally, I utilized the AccelStepper library to control the motors with acceleration and deceleration. However, during the implementation, I noticed that the library was not originally supported for the Arduino Portenta. As a result, I had to modify the library to make it compatible with the Arduino Portenta platform
I have used Python with Flask to create an HMI (Human-Machine Interface) for the machine. The HMI front end runs using JavaScript and HTML, while the back end runs on Python. I have utilized serial communication to communicate with the Arduino Portenta. This optimized communication protocol enables efficient data exchange between the user interface and the microcontroller. To run this HMI, I have used a Raspberry Pi Model B and the Chromium browser to automatically start the web application with the Python script at startup.
This HMI interface communicates data such as starting and stopping the machine, production statistics, error messages, and alarms, which help the machine operator understand what is going on.
In addition to these functionalities, this system is equipped with a manual override feature where the machine operator can manually operate the machine, adjust limits, and set offsets.