One of our latest demonstrators is focused around humanoid robots. More specifically, we have showcased a human-sized arm lifting a 2 kg dumbbell and highlighting position control performance as well as the compact 1kW inverter used as a motor driver. More info can be found here: https://community.infineon.com/t5/Blogs/Compact-1-kW-GaN-motor-drive-for-humanoid-robot-arms/ba-p/980886
As the demo drew a lot of attention, we wanted to make it possible for everyone to have their own tabletop humanoid demo. Here, the PSOC™ 4000T CAPSENSE™ prototyping kit comes into play, acting as both the base and human machine interface, allowing users to move the arm with touch commands.
By following this guide, and you will have your own small humanoid robotic arm on your table.
3D printingLet’s start with the necessary 3D prints, which can already print while we focus on the software environment. In total, there is 3 different parts that need to be 3D printed, the base, the forearm and the upper arm.
For the base, we decided to go for a Marble PLA to give it a nice finish without distracting too much from the arm itself, for which we used PLA Metal Oxide Green, both from Bambu Lab. In case you are using a different servo, don't forget to double-check the dimensions, as the opening or screws need to be adjusted to fit. Both the upper arm and forearm were printed in an upright orientation. Especially for the fingers, take some time to figure out the best placement for the support structure.
Eval BoardWhile the 3D printer is doing it's part, let's have a look at the Eval board. The CY8CPROTO-040T is our CAPSENSE™ prototyping kit and comes with a pre-flashed software and a lot of documentation, including a Quick Start Guide and a user guide. You can find all of this information here: https://www.infineon.com/evaluation-board/CY8CPROTO-040T
It is best to take 5 minutes to look through the Quick Start Guide found in the documents section of the page and familiarize yourself with the hardware and features of the board.
Before we get hands-on and connect the board to the servo motor, let's first get the software running so we only need to solder the servo motor to the board.
SoftwareTo develop the software for this project, we'll be using ModusToolbox: Infineon's development ecosystem, that supports a wide range of microcontroller devices. To get started, download and install ModusToolbox by following the instructions in the official ModusToolbox Software Installation Guide. Don´t forget to accept the default options during the installation process.
Once installed, launch the ModusToolbox Dashboard and open your preferred Integrated Development Environment (IDE). For this example, we'll be using the default IDE, Eclipse.
To create a new application, click the New Application link in the Quick Panel. This will launch the Project Creator tool in Eclipse, allowing you to start a new project.
With the Project Creator tool open, expand the PSOC 4 BSP category under Kit Name. Then, select the CY8PROTO-040T kit from the available options. This will configure your project for the correct hardware.
Click Next > to proceed to the Select Application page. On this page, you'll see a list of template Applications available for the selected BSP, organized by category. For this project, expand the Sensing category and select the CY8PROTO-040T Demo template application. This will provide a foundation for our project, which we can then modify and extend as needed. Before proceeding, change the New Application Name and New BSP Name to "MiniRobotArm".
With our project created, launch the Device Configurator from the Quick Panel to set up the peripherals.
First, disable the Serial Communication Block (SCB) 1, since it is not needed. Next, enable the resource TCPWM 16-bit Counter 0 and set its personality to PWM-1.0. This will be used to generate the control signal for the servo motor. In the parameter panel, make the following changes:
- Set the name of the resource to CYBSP_PWM.
- Configure the Clock Prescaler to Divide by 4.
- Set the Period to 48000 and the Compare value to 24000.
- Select 16-bit Divider 0 clk as the Clock Signal Input.
- Assign the PWM output to P2[2] digital_out.
Then, move on to the TCPWM 16-bit Counter 1 resource. This resource will be used to trigger an interrupt service routine, responsible for updating the duty cycle values for the servo motor. Rename it to CYBSP_TIMER and set its personality to Counter-1.0. In the Parameter panel, update the following settings:
- Set the Clock Prescaler to Divide by 4.
- Set the period to 48000 and the Compare value to 24000.
- Select Overflow & Underflow as Interrupt Source.
- Again, select 16-bit Divider 0 clk as the Clock Signal Input.
Last, switch to the Pins tab and configure the settings for pin P2[2], which is used to drive the servo motor. Set the Drive Mode to Strong Drive,Input buffer off.
Save your changes in the Device Configurator by going to File > Save. Then, close the Device Configurator. Next, locate the main.c file in the Project Explorer and open it. Replace the application template code with the code provided in the main.c file in the Code section. With the code updated, we're now ready to program the application to the microcontroller. To do this, click on MiniRobotArm Program in the Quick Start Panel. This will initiate the programming process.
Instead of setting up the project manually, the archive file MiniRobotArm.zip is attached for use. This file contains the complete ModusToolbox project. To use it, extract the contents of the zip file and follow the instructions outlined in the included readme file, which provides a step-by-step guidance on importing and setting up the project.
AssemblyOnce the firmware is flashed and the 3D-printed parts are ready, let's start with the assembly! In order to connect the servo motor to the board, we recommend to solder them directly to the respective pins on the PCB as indicated in the figure. As a first step, cut away the header of the servo connector right on the plastic connector so to keep the cables as long as possible. The final trimming will be done just before the assembly for a tidy cable management.
We are using Pin6 on connector j9, which is connected to P2.2, as the signal pin instead of the marked pins next to the CAPSENSE™ area, so that the touch area is not obstructed.
In order to P2.2 to be connected to the MCU, make sure the slider switch SW2 is in the left position at I2C. The power supply for the servo can be taken from j4 in the debug section of the board.
Now the servo motor should be mounted onto the base. To do this, place the servo into the opening in the base.
Afterward, feed the cables through the small opening to keep everything nice and tidy. Then, place the eval board into the base and check on how long the cables need to be. Depending on the model of the board, it may come with rubber feet attached. These should be removed first, but can be reused and attached to the bottom of the base.
For the cabling, we recommend a layout similar to the one in the picture. The cables do not need to be super stretched; it is better to have a few millimeters spare in case something goes wrong during soldering. Once the cables are cut to their final length, remove the isolation and solder them to the respective pins. Best to remove the eval board from the base, to avoid burning the plastic of the base.
Once this is done, the servo can be screwed onto the base and the board can be clipped in. Then, let's go ahead with the first functional test.
First TestBefore mounting the forearm, we need to make sure that the servo shaft is in the "lower" position, which is defined as the starting position for the robot arm. Therefore, simply make sure the switch SW2 on the board is set to the left (marked I2C), and then connect the board via USB-C. Depending on the position of the servo, you should hear it moving. Then you can already go ahead and test the CAPSENSE™ functionality.
Before mounting the arm, it is best to disconnect and reconnect the USB-C cable, after which the servo will move to its start position. Once this is done, you can go ahead and mount the forearm. Make sure not to rotate the servo while mounting, and fix the arm at a position where the back of the forearm is nearly touching the base and the switch SW2. As this will be the starting position, all movements will be based on it.
To wrap up the build, we still need to install the upper arm as well as, optionally, the acrylic housing and rubber feet. For the upper arm, the M3 threaded insert needs to be molded into the 3D print. In case you have never worked with this kind of insert, this a good starting point for information. As the upper arm doesn't need to be perfectly flush and the insert doesn't need to be at a specific angle, this may also be good practice for a first try. After the insert is in place, you can then use an M3x10 cylinder head screw to mount the upper arm to the base.
There are still two optional steps that one can do. First, it is beneficial to mount some rubber feet to the bottom of the base. You can either buy some of them cheaply online, or you can reuse the ones that were mounted on the back of the kit.
If you also have access to a laser cutter, we have uploaded the DXF files for an acrylic housing. It consists of 5 individual parts that need to be glued together at their edges. The last step is a bit tedious and one needs to work very cleanly in order not to get super glue where it doesn't belong.
Also, before gluing, it is best to do a dry run by placing the pieces onto the base and clearly identifying the face on which each part must be glued. The two small side walls are sandwiched between the two large panels, and the top surface is glued onto the sides of each wall, not the other way around.











Comments