RoArm-M1 Tutorial II: Secondary Development Tutorial

From Waveshare Wiki
Jump to: navigation, search

RoArm-M1 Tutorial Directory

RoArm-M1 Secondary Development Based On ESP32

  • This tutorial is for learning how to upload the demo to RoArm-M1. As the demo of RoArm-M1 is open source, users can do the secondary development of the demo.

RoArm-M1 Second Development Tutorial

ESP32 Flash Download Tool

We provide an ESP32 download tool for RoArm-M1, using this tool, users can quickly restore the product to the factory demo.

  • Click here to download ESP32 Flash Download Tool. Once downloaded, extract the files and double-click on the "flash_download_tool_3.9.5.exe" program. After opening, two windows will appear. The UI interface of the download tool is the one you need to operate, while the other window serves as a terminal to display the working status of the download tool.
  • In the "DOWNLOAD TOOL MODE" interface, select Chip Type as ESP32 and WorkMode as Factory. When using Factory to call the binary file, it will use a relative path, eliminating the need for users to manually input the binary file path. After making these selections, click OK.

ST3020 SERVO esp.png

  • In this software interface, keep the "LockSettings" option checked. On the right side, you can simultaneously upload demos to 8 RoArm-M1 demos. Next, connect the RoArm-M1 to the computer using a USB cable. Click on "COM" and select the newly appeared COM port (in my case, it's COM3). BAUD is used to set the download speed, higher values result in faster speeds, with the ESP32 supporting speeds up to 921600.

Roarm SERVO esp2.png

  • After selecting, click START to begin uploading the demo. Once the upload is complete, "IDLE" will change to "FINISH". After completing this process, you can disconnect the USB connection between the servo driver board and the computer. Then, connect the servos to the servo driver board, provide power to the robotic arm, and start controlling the RoArm-M1 robotic arm.

Roarm SERVO esp4.pngRoarm SERVO esp3.png

Install Arduino IDE

  1. Download the latest Arduino IDE 2.1.0 package from Arduino website. The official IDE supports different operating systems, just download it according to your operating system. The one I downloaded here is for Windows. (If you have already installed it, just skip to the second step) The installation process is very simple, just keep clicking next step.
    Arduino IDE 2.1.0.png
    Note: It will prompt you to install the driver during installation, you can click to install.

Install ESP32 Plug-in In Arduino IDE

  1. Open Arduino IDE, click the File on the left corner and choose "Preferences".
    RoArm-M1 Manual01.png
  2. Add the following link in the additional development board manager URL, then click OK.
    https://dl.espressif.com/dl/package_esp32_index.json

    RoArm-M1 Manual02.png

    Note: If you need to add more than one development board URL, it is not necessary to delete the URL of the ESP32 development board support, you can directly add the other URL to another line, the default display is comma separated URL. For example, if you need to add the URL of the ESP8266 development board, add it directly to another line, it will be displayed as follows:

    https://dl.espressif.com/dl/package_esp32_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json
    

    RoArm-M1 Manual03.png
    RoArm-M1 Manual04.png

  3. Download the package, and copy the unzipped packages files to the following path:
    C:\Users\username\AppData\Local\Arduino15

    L76K GPS Module ESP32204.jpg

Install Dependency

  • Download libraries, unzip, and open the default installation position of Arduino: C:\Users\username\AppData\Local\Arduino15\libraries (please refer to your actual position), and copy these files to libraries.
    RoArm-M1 Tutorial II70.png
  • Download serial bus servo library, unzip it, and copy the SCServo file folder to \Documents\Arduino\libraries file folder to install the servo library.

Upload Demo

  1. Download RoArm-M1 demo, double-click RoArm-M1-ESP32\RoArm-M1-ESP32.ino.
    L76K GPS Module ESP32206.png
  2. Click Tools -> Port, and remember the existing COM, you don't need to click this COM (the COM displayed by different computers is different, remember the existing COM on your computer).
    RoArm-M1 Tutorial II90.png
  3. Connect the driver board and the computer with the USB cable, click Tools -> Port, and then click the new COM.
    RoArm-M1 Tutorial II91.png
  4. Click Tool -> Development Board -> ESP32 Arduino -> ESP32 Dev Module.
    RoArm-M1 Tutorial II992.png
  5. Click Tool, other settings as shown below (Partition Scheme is recommended to use Huge APP, PSRAM must be "Enabled".):
    RoArm-M1 Tutorial II93.png
  6. After setting, click "Upload" to upload the demo to the device.
    RoArm-M1 Tutorial II94.png
  • If you encounter problems during the period and need to reinstall or change the Arduino IDE version, you need to uninstall the Arduino IDE after uninstalling the software. Then, you need to manually delete all the contents of the folder C:\Users\[name]\AppData\Local\Arduino15 (Need to display hidden files to see) and then reinstall.