Duh-Vinci Surgical Robot

From LVL1
Jump to navigation Jump to search

Below is the Multi-Million Dollar Ultra-High Technology Da Vinci Surgical Robot.

JAC Da Vinci Surgical Robot.jpg

And this is the Cheap Low Technology Duh Vinci Surgical Robot.

JAC DV ARMS 1.jpg

There comes a time when medical advancements fall into the consumer market of things. The Duh-Vinci is that moment when medical technology meets the dollar store.

Creation Requirements

Parts List:

4 x Me Arm Open Source Robot

1 x Dissection Kit

1 x SparkFun Blynk Board

1 x 4 Line Voltage Level Shifter

1 x ESP32-Cam w/ OV2640 camera

1 x PCA9685 12-bit 16-PWM Servo Controller Board

4 x Cat6 RJ45 Surface Mount Box - 1 Port

2 x Cat6 RJ45 Surface Mount Box - 2 Port

4 x Cat5e Cables (3ft.)

1 x 5v/3.3V DC Power Supply

1 x 6v DC Power Supply (Servos)

Support Device:

1 x Android Tablet

Build Item List:

ESP32-CAM programming rig/FTDI

JAC DV CAMERA PROGRAMMER.jpg

Software Tools:

Arduino IDE

Blynk App for Android tablet

Overall System Layout

JAC DV SYSTEM OVERVIEW.jpg

Sub Systems

meArm

meArm Website

The robotic arms are meArm V0.3 possible V0.4 types. They were made several years ago and have been awaiting this opportunity to be of use to mankind.

This is one of four identical meArms. They differ in color to assist in identifying which arm is being used.

JAC DV meArm.jpg

Blue elements at base of arm are used to smooth rotation. This design had a gap between the stationary and rotating elements of the base.

The arms in this project use Tower Pro MG-90S Micro Servos. The servos are wired into the RJ-45 housing at the base of each arm.

JAC DV ARM SERVO WIRING.jpg

Socket Wiring
Servo Wire Color Servo Position RJ-45 Socket Layout
Base Brown 1 Right 2
Right Grey 2 Right 1
Left Purple 3 Right 4
Claw White 4 Left 3
Power + Red all Left 2
Power - Black all Left 1

Local Control System

The Control System can be visualized as below.

JAC-DV-Scheme-1.JPG

The controller displayed as a Fritzing Example.

JAC DV CIRCUIT-2.jpg

Note: Camera power supply is now separate because of current draw requirement.


JAC DV CONTROLLER-1.jpg

JAC DV CONTROLLER-2.jpg

meArm Cabling

meArms are connected to the controller via RJ-45 Cat5e cables. Cables are color matched to their associated arms.

Remote Control System

The remote control system consists of an android tablet running the Blynk App.

Blynk

JAC DV TABLET INTERFACE.jpg

Video System

Video for the system is provided by an ESP32-CAM with OV2640 camera. A generic ESP32-Cam from amazon was purchased. The device was found to be compatible with the AI Thinker variety of ESP32-Cams.

JAC DV CAMERA.jpg

Software

meArm Control Software

Basic software for controlling the meArms is from the GitHub Repository:

York Hackspace meArm GitHub Repository

Software was modified to allow control of multiple arms. The modification is primarily assignment of arrays for variable to select which arm is being manipulated.

ESP32-Cam Software

A video stream compatible with Blynk's video-stream widget was necessary. A RTSP stream would work with Blynk. An ESP32-CAM compatible GitHub library was found.

Geeksville Micro-RTSP GitHub Repository

The application used is under Examples: ESP32-devcam.ino

Modifications for the selection of correct camera type (esp32cam aithinker) were needed in the setup() function.

 
void setup()
{
  #ifdef ENABLE_OLED
    hasDisplay = display.init();
    if(hasDisplay) {
        display.flipScreenVertically();
        display.setFont(ArialMT_Plain_16);
        display.setTextAlignment(TEXT_ALIGN_CENTER);
    }
  #endif
    lcdMessage("booting");

    Serial.begin(115200);
    while (!Serial)
    {
        ;
    }


//////////////////////////////////////////////////////////////////////////////
//
// DUH-VINCI MODIFICATION
// SELECTION OF AITINKER CAMERA MODULE TYPE "esp32cam_aithinker_config"


    cam.init(esp32cam_aithinker_config);
//
//////////////////////////////////////////////////////////////////////////////


    IPAddress ip;


#ifdef SOFTAP_MODE
    const char *hostname = "devcam";
    // WiFi.hostname(hostname); // FIXME - find out why undefined
    lcdMessage("starting softAP");
    WiFi.mode(WIFI_AP);
    WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
    bool result = WiFi.softAP(hostname, "12345678", 1, 0);
    if (!result)
    {
        Serial.println("AP Config failed.");
        return;
    }
    else
    {
        Serial.println("AP Config Success.");
        Serial.print("AP MAC: ");
        Serial.println(WiFi.softAPmacAddress());

        ip = WiFi.softAPIP();
    }
#else
    lcdMessage(String("join ") + ssid);
    WiFi.mode(WIFI_STA);
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED)
    {
        delay(500);
        Serial.print(F("."));
    }
    ip = WiFi.localIP();
    Serial.println(F("WiFi connected"));
    Serial.println("");
    Serial.println(ip);
#endif

    lcdMessage(ip.toString());

#ifdef ENABLE_WEBSERVER
    server.on("/", HTTP_GET, handle_jpg_stream);
    server.on("/jpg", HTTP_GET, handle_jpg);
    server.onNotFound(handleNotFound);
    server.begin();
#endif

#ifdef ENABLE_RTSPSERVER
    rtspServer.begin();
#endif
}


Modified OV2640.cpp from Micro-RTSP

Modification reduces the video stream to QVGA size (320x240) in the camera_config_t esp32cam_aithinker_config structure variable values.


camera_config_t esp32cam_aithinker_config{

    .pin_pwdn = 32,
    .pin_reset = -1,

    .pin_xclk = 0,

    .pin_sscb_sda = 26,
    .pin_sscb_scl = 27,

    // Note: LED GPIO is apparently 4 not sure where that goes
    // per https://github.com/donny681/ESP32_CAMERA_QR/blob/e4ef44549876457cd841f33a0892c82a71f35358/main/led.c
    .pin_d7 = 35,
    .pin_d6 = 34,
    .pin_d5 = 39,
    .pin_d4 = 36,
    .pin_d3 = 21,
    .pin_d2 = 19,
    .pin_d1 = 18,
    .pin_d0 = 5,
    .pin_vsync = 25,
    .pin_href = 23,
    .pin_pclk = 22,
    .xclk_freq_hz = 20000000,
    .ledc_timer = LEDC_TIMER_1,
    .ledc_channel = LEDC_CHANNEL_1,
    .pixel_format = PIXFORMAT_JPEG,
    // .frame_size = FRAMESIZE_UXGA, // needs 234K of framebuffer space
    // .frame_size = FRAMESIZE_SXGA, // needs 160K for framebuffer
    // .frame_size = FRAMESIZE_XGA, // needs 96K or even smaller FRAMESIZE_SVGA - can work if using only 1 fb

//////////////////////////////////////////////////////////////////////////
//
// DUH-VINCI MODIFICATION RIGHT HERE 
// MODIFIED OUTPUT FRAME SIZE TO QVGA

    .frame_size = FRAMESIZE_QVGA,
//
//
/////////////////////////////////////////////////////////////////////////


    .jpeg_quality = 12, //0-63 lower numbers are higher quality
    .fb_count = 2       // if more than one i2s runs in continous mode.  Use only with jpeg
    
};




ESP32-CAM Programmer

JAC DV CAMERA PROGRAMMER.jpg

ESP32-CAM in Enclosure

JAC DV CAMERA.jpg

Blynk Application Information

JAC DV TABLET INTERFACE.jpg

Video Stream

The video stream is supplied by the ESP32-Cam. It is configured as a RTSP stream. The video-stream widget is configured as :

URL Address: rtsp://192.168.1.19:8554/mjpeg/1

Output : V7

You will replace "192.168.1.19" with the IP address generated from the ESP32-devcam application. The IP address is displayed via the serial monitor in the Arduino IDE. This IP address will change as you change the WiFi network you connect.

Arm Selection

A Styled_Button-widger is used to traverse the list of me Arms (total of four).

Four LED-widgets are used to display which meArm is active. A LED-widget for each arm is "turned on" representing that arms color. Only one arm is active at anytime. The arms are labeled: SCAPEL, PROBE, TWEASERS and CAMERA.

Arm Control

Two Joystick-widgets are used to control an arm. The left Joystick-widget controls the X-Y position of the claw. The right Joystick-widget controls the Z position and the Open/Close claw function.

CAD Render

MeArm - 3D

meArm CAD model from GrabCAD with following attributes:

meArm

Nemanja Petkov

December 21st, 2014

MeArm - Pocket Sized Industrial Robotics for Everybody

by Benjamin Gray

Model was modified for this rendering to match the V0.3 variety I have.

PCA9685 Module - 3D

Module from GrabCAD with following attributes:

16 channel PCA9685

Ali ZAHI

September 22nd, 2016

16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685

Model was modified for this rendering to match the variety of PCA9685 Module I have.

ESP32-Cam - 3D

Module from GrabCAD with following attributes:

ESP32-CAM

Jan Jezek

May 6th, 2019

ESP32-S module with camera Geekcreit diymore.cc. iges, step, stp

Model was modified for this rendering to match the variety of ESP32-Cam I have.

Sparkfun Blynk Board

Module from SparkFun website. Converted from Blender file for this rendering.

JAC DV CAD RENDER.jpg

System Schemes

JAC-DV-Scheme-1.JPG


JAC-DV-Scheme-2.JPG