Mobile Arm Robots combine the advantages of mobile platforms and robotic manipulator arms. The extra degrees of freedom from the mobile platform provide user with more workspace and accessibility. Such robots find their place in industrial, health-care and home-care sectors.
This project shows how to build a basic WiFi remote controlled 4 wheeled mobile robot with a 4 axes robotic arm manipulator mounted on its chassis. It has an on-board WiFi camera mounted on the robotic arm. This robot is completely controlled by the user manually from host PC through WiFi.
Getting StartedStep 1: Build the hardware as described in the ‘Hardware Development’ section.
Step 2: Install latest version of CASP from this link: https://aadhuniklabs.com/?page_id=550. Please go through this link: https://aadhuniklabs.com/?page_id=554 for video tutorials on CASP.
Step 3: Download example project on ‘Remote Controlled Mobile Arm Robot with on-board Camera’ at this link: https://aadhuniklabs.com/casp/casp_web_projects/robotics/03_rc_mobile_arm_robot.zip and follow the steps mentioned in the ‘Software Development’ section.
Step 4: Some adjustments as described in ‘Adjustments’ section are required for tuning the software to match your developed hardware. You may also further enhance the performance of the robot by modifying the source code from the custom blocks.
Step 5: Keyboard and mouse controls to control the robot are described in ‘Control Methodology’ section.
Step 6: Finally, safety precautions to be followed are described in 'Safety' section.
Hardware DevelopmentFour DC motors along with wheels are fitted to a suitable base frame. A 4 axes servo driven robotic arm assembly is mounted on the base frame. ESP32 camera is mounted on the end-effector of the robotic arm. High torque servo motors are used for robotic arm axes rotation. These servos are carefully mounted to get the desired arm movements.Required electronic modules are suitably placed on the base frame and are connected as per the connection diagram shown in ‘Schematic’ section.Typical arrangement is shown in above figures.
The electronics part consists of Arduino Nano RP2040 or Raspberry Pi Pico W acting as the main controller for controlling all required robot functions and communicating with the host PC through the on-board WiFi module. It controls the 5 servos of the robotic arm and the 4 wheels of the robot.
ESP32 Camera module is mounted on the arm for capturing live video and stream to the host PC. Flashlight present on the ESP32-CAM module is controlled manually from the host PC during low light conditions.
A 9V to 12V battery mounted below the base frame is used to power the entire circuitry on the robot. A 9V/12V to 6V DC step down converter is used to provide required voltage to power the micro-controller, servos and ESP32 camera module.
Software DevelopmentA) Configuring ESP32 Camera
ESP32 Camera shall be properly programmed with valid IP address before using it in the project. Please refer to our ESP32-CAM example for details on how to program the module. User may also refer to abundant material available on the internet regarding this subject.
B) Software for micro-controller and host PC
CASP software is used to quickly create models and generate binary code for the on-board micro-controller target and native PC. This software enable users to graphically visualize the signal at any point of the model in real time. This feature is extensively used during adjusting robotic arm joint block parameters.
A part from normal CASP blocks two custom blocks are used in the native model. One block is used for navigation control and the second block is used to generate robotic arm targeted co-ordinates based on the user mouse movements. These blocks also reduces total block count in the model. Source code for the custom blocks is available to the user. User can go through our video tutorial on how to create a custom block at this link: https://aadhuniklabs.com/casp_res_videos#custom_block.
Two models are developed to achieve desired objective.
B.1) Target Model that runs on Arduino Nano RP2040 Connect and Raspberry Pi Pico W consists of
1) Blink logic that indicates the system is running.
2) WiFi101 block that receives required control signals from host PC.
3) PWM and servo blocks that are mapped to the pins of the micro-controller.
4) Time delay block to reset the outputs of the PWM blocks during a communication error or when the host is not connected.
Following are the steps to properly program the target board.
1) Connect the target to the host PC via a USB cable.
2) Note the serial port number to which the board that is connected to the host PC, from the host operating system.
3) Run CASP and load project ‘rc_arduino’ for Arduino RP2040 target or ‘rc_picow’ for Raspberry Pi PicoW target.
4) The WiFi101 block WiFi is set to Station mode. User may need to enter SSID and password of the network to which the device should be connected. The Local IP address parameter shall be configured as assigned by the network DHCP client of the network.
5) Open Home->Simulation->Setup Simulation Parameters menu item. Under TargetHW->General tabs set ‘Target Hardware Programmer Port’ parameter to the serial port to which the board is connected.
6) Build the model and program the board by clicking on Run button.
B.2) Native Model that runs on Host PC consists of
1) Camera block that receives live video from the ESP32 Camera. IP address of the ESP32 Camera shall be entered in block parameters of this block.
2) Image display block to display the live video received from the camera. It is also configured to output keyboard and mouse signals.
3) RC control block: It is a custom block that receives keyboard and mouse signals from the image display block and generates suitable control signals for controlling the robot motion.
4) 4 number of robotic arm axes blocks that represents 4 axes of the robotic arm including the end-effector. The parameters of these blocks shall be carefully adjusted to match with the respective arm dimensions/parameters. These blocks calculate forward kinematics of each axis.
5) Robotic Arm Inverse Kinematics block that does inverse kinematics to calculate each axis angle.
6) Robotic Arm control block. It is a custom block that generates required set points (x, y, z) and control signals to the robotic arm based on user keyboard and mouse inputs.
7) GPIO blocks that maps to the target model via the WiFi communication channel.
Following are the steps to run the native model on the host PC
1) Before continuing, the host PC shall be connected to the same network as the device is connected.
2) Load the ‘rc_native’ project.
3) Click on Home->Simulation->Configure Simulation IO menu item.
4) ‘Configure Simulation Hardware’ window will open. Under Native Nodes and GPIO Device Nodes, change the IP addresses marked in the below figure (by double clicking on the item) to respective local and device IP addresses.
5) Click on ‘Connect Device’ button and check the ‘Online Data’ check box. The program should now communicate with the target with cycle time around 30msecs. Target board is now available as end point ‘EP0’ to the native model. Native model can use this end point to connect to respective IOs on the target.
6) Click on ‘Save’ button to save the configuration and close the window.
7) Run the model by clicking on the Run button. A simulation panel window should open and communicate with the board.
8) Screen shot of the output simulation panel running on host PC is shown below.
Adjustments
1) Wheel motor connections may be reversed to get forward or backward movement when W and S are pressed.
2) Robotic arm servos require adjustments to match with corresponding axis block parameters in the model. The parameters are carefully adjusted to achieve desired pose of the robotic arm immediately after powering up and during running.
3) Base speed, speed limits and other parameters related to the navigation are adjustable from the ‘nav_control’ block parameters.
4) On some systems where graphics hardware cannot display the 3D plot correctly, user is advised to disable the 3D block
Control Methodology1) User can use keys W – to move forward, S – to move backward, A – to rotate left on center and D – to rotate right on center.
2) Combination of keys W/S & A/D can be used to take left and right turns while moving forward or backward.
3) Speed can be adjusted by using Page Up & Page Down keys.
4) Mouse movement (while pressing the right mouse button) controls the robotic arm in polar co-ordinates. Moving the mouse side wards controls the arm angle (theta) with respect to robot forward position and its center. Moving the mouse forward and backward controls the arm radius. These are then converted to rectangular co-ordinates to calculated x and y co-ordinates. Mouse wheel rotation controls the arm z-direction movement. Key ‘E’ can be used to enable/disable the robotic arm control from mouse.
5) Key ‘P’ is used to position the robotic arm at default angles (parking mode).
6) Keys ‘T & Y’ are used to turn the wrist servo of end-effector.
7) Keys ‘J & K’ are used to control the end-effector jaw open and close movements.
8) Key 'L' is used to ON/OFF the flash LED light of the ESP32 camera.
SafetyAt times the robotic arm manipulator can go out of control. One way to slow down the arm movement is to adjust the servo block parameters (in the target model) to limit the rate of change of axes angles.
Take adequate precautions to avoid injuries. Keep the piece out of reach from children at least during the development stage.
Related VideoPlease write to us at https://aadhuniklabs.com/contact for any queries & suggestions related to this project.
Comments