Smiling Robo Logo

SmilingRobo

Smart robotic-arm

By peng-zhihui

robotic-arm

Share this project to show your support

Dummy-Robot: Super Compact Smart Robotic-Arm

My Super Mini Robotic Arm Robot Project.

Video Introduction: [Homemade] I built a mechanical arm of Steel Iron Man! [Hardcore]

Video: I made a DUMMY ROBOTIC ARM from scratch! - YouTube

Information Note (Updated on 22-2-9)

  • A 3D model design source file has been added.
  • Gripper hardware design files and LED light ring PCB have been added.
  • A Wireless Spatial Positioning Controller PCB file has been added.
  • Added Wireless Teach Pendant Peak Hardware and Software Project (as submodule).
  • The hardware design file for REF has been added.
  • DummyStudio host computer has been added.
  • The firmware source code of the Dummy core controller has been added (see below for instructions on how to use it).
  • 42 stepper motor driver hardware engineering has been added.
  • Added 20 stepper motor driver hardware engineering.
  • The firmware source code for the 42/20 stepper motor drive has been added.
  • Added command-line debugging tool RefTool (based on the OdriveTool framework).
  • A model file for the carrying case has been added.
This is the complete design scheme of the original version of the robotic arm in the video, the cost and production difficulty of the scheme are relatively high, so the students who want to reproduce it suggest waiting for the Dummy Youth Edition that I will release later, this version will have the following improvements:
  1. The structure of the whole machine is redesigned, and 3D printing is used as the manufacturing scheme (the original version is aluminum CNC), which greatly reduces the manufacturing cost.
  2. Replace the original harmonic reducer with a small cycloid pinwheel reducer designed by myself, which greatly reduces the cost of parts.
  3. All software and firmware are the same as the original, and the functions are exactly the same.
  4. Add my own design of the PC host computer and mobile APP (strive to add the user initial setting guide to it).
  5. Improve the wiring method of the original motor driver, the original power wiring adopts the form of welding, which is not easy to install and disassemble, and the youth version will use 4P connector (power supply + CAN bus) connection.
  6. The cost of the whole machine should be within 2000.
  7. Most importantly, will find someone to come up with a babysitter-level video tutorial!

About Structural Design

The original design of the 'stepper motor' + Harmonic's 'harmonic deceleration module' used in the original version of my video, of which the latter has a higher cost (the second-hand I bought is about 600 yuan a), so in order to let everyone reproduce this project as much as possible, I will add one later 'A low-cost solution for self-made cycloid reducer '+ '3D printing'.

At present, the cycloid reducer has been designed and is being verified, and it is expected to use PC (or acrylic) cutting combined with 3D printing, the accuracy has decreased but the functions remain the same, and the hardware cost of the whole machine is expected to be controlled within 2000 yuan.

The designed cycloid reducer is shown in my other warehouse: peng-zhihui/CycloidAcuratorNano

About Circuit Modules

In order to realize the main robotic arm motion control function, the core of the circuit is actually 4 boards:

  • REF core board
  • REF backplane (i.e., the controller circuit board inside the base of the robotic arm)
  • Stepper motor drive
  • Peak Teach Pendant

The first two of them and Peak are both open sourced by me, and I referred to the following when designing the stepper driver: https://github.com/unlir/XDrive This project, which is an open-source closed-loop driver of mine by a friend, is based on STM32. The driver is divided into open source version and closed source version, the closed source version is based on the discrete MOSFET performance is extremely strong and the function is very complete, the open source version of the ADC+ chopper driver chip, with basic functions, without CAN protocol.

I redesigned the PCB circuit of the driver (this project uses 20 and 42 steps respectively, and the file of 57 is just for you to expand), added hardware support for the CAN bus, and completely refactored the original core code, provides compiled binaries can be burned directly:

The main improvements are as follows:
  1. The code is refactored in C++11, introducing many high-level language features, and the underlying part is mixed with C without affecting the code performance.
  2. The hardware dependence is completely decoupled, which can be easily ported to the MCU of other platforms in the future, removing redundant code and making the structured logic clearer.
  3. Added custom templates for CAN protocol and UART protocol.
  4. Added analog EEPROM parameter storage, which can save data when power off.
  5. Added any position to set to zero, and ensure that the two-way half-turn is zeroed (instead of one-way zero).
  6. Fully compatible with STM32-HAL libraries, configuration code can be generated directly using STM32CubeMX.
  7. For other improvements, you only need to pay attention to the files in the UserApp folder for secondary development.

The use of Ctrl-Step driver is relatively simple, after downloading the firmware, the encoder calibration will be performed on the first power-on, if it is successful, then press the button 1 after the next power-on will enter the closed-loop mode, and the motor can be controlled by sending instructions through CAN or serial port, and the instructions for instructions can be found in the source code 'UserApp' folder 'interface_can.cpp' and 'interface_uart.cpp':

Other Keys Do:
  • Press and hold both buttons at the same time to power on, the encoder will be calibrated automatically, and if the first calibration fails, you can recalibrate it this way.
  • Short press button 1 to switch between Enable Closed Loop/Disable Closed Loop.
  • Long press button 1 to restart the board.
  • Short press button 2 to clear the locked-rotor protection.
  • Press and hold button 2 to reset the target value to zero (e.g. if it is in position mode, the position will be reset to zero).
Other functions should be set by code or communication protocol, such as setting home zero point, PID parameters, CAN node ID, various motion parameters, etc., you can study the code by yourself.

Of course, the other way is that you can also use the GRBL type of driver modification to drive the robotic arm, the problem of this solution is that the GRBL firmware coupling is relatively strong (after all, it is not designed for robotic arms but CNC applications) is not easy to expand, and the pulse form of control makes the wiring extremely inelegant (each joint has to pull the 'step/dir' line to the controller separately, resulting in long traces of the last few joints).

I can connect all the motors in series in the form of a series connection with the CAN bus, so that the overall wiring only needs four wires (power supply + CAN bus) and adopts the ring architecture, which is more stable in terms of physical form and control reliability (error feedback).

In addition to the driver, the other three core circuit boards are not highly difficult to design, the circuit form is mainly the CAN bus + DC bus + encoder collection, but the form of the design is very different, first of all, the peak will also be added later, the main function is to achieve wireless motion teaching, using STM32 core board + MPU sensor solution, the core of the control algorithm refers to the following: https://github.com/nerianys/MotionControl

It is currently expected to use MPU9250/MPU6050 (from many friends, it is easy to make and very mature), combined with wireless transmission module (direct ESP8266 WiFi), or can be based on the previous NRF24L01, wireless transmission is more stable, and the receiving end is also very simple, ESP8266/ NRF24L01 data is sent directly to REF through the UART port.

The two boards of the REF controller can be regarded as the main components of the robotic arm's core control, which are also very different from the previous designs. The two boards are designed for the REF control system, so you can refer to my other project: peng-zhihui/REF

Firmware Design

The firmware of the robotic arm is actually very simple and divided into two main sections:

  • Stepper driver: This part has been mentioned above, mainly used for motor motion control.
  • REF system: It is actually a very general CAN bus node, the main role is the management of instructions from the host computer and the forward/reverse parsing, and the conversion of mechanical signals into bus communication signals and vice versa. The source code of REF is as follows:

Host Computer https://github.com/peng-zhihui/REF

The code is based on the STM32-HAL framework, and the source code and engineering are both shared, so you can study them by yourself if needed.

About Reference Information

Wiring Diagram

The overall wiring diagram is shown as follows:

Firmware Design

In the process of writing this article, I also open-sourced the reference project of the self-developed harmonic reducer, and the mechanical drawing of the overall design of the self-developed harmonic reducer is as follows:

The detailed instructions can be found in the following two warehouse:

In addition, the following two video introductions can be referred to:

SmilngRobo

SmilingRobo, a platfrom of opensource robotics

Opensource Robotics Platform with opensource tools and resources. We are on a journey to advance and democratize robotics through opensource.