MPPV1 (Multipurpose Platform V1) (Created by Shounak Pallav)

by Shounak Pallav in Circuits > Remote Control

1800 Views, 30 Favorites, 0 Comments

MPPV1 (Multipurpose Platform V1) (Created by Shounak Pallav)

20220814_121244.jpg
20220814_121250.jpg
20220814_121311.jpg

Ever wanted a personal assistant robot? This is exactly what I have created, a robot that can do many different things that vary from cleaning the lawn to being used as a personal assistant at home. In its current state and progress I have made, it is fully remote controllable and I have implemented autonomous functions to it. It has a drivetrain/chassis, a multipurpose robotic arm & a bucket to carry things with it.

(Created by Shounak Pallav)

Supplies

RC Hobby Remote Control - https://www.amazon.com/RadioMaster-Gimbals-Transmitter-Control-TX16SMKII-4IN1-M2/dp/B09YH581GD/ref=asc_df_B09YH581GD/?tag=hyprod-20&linkCode=df0&hvadid=587557953115&hvpos=&hvnetw=g&hvrand=18260227112823008199&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9017002&hvtargid=pla-1658039420391&psc=1

Heavy Duty Tank Chassis - https://www.aliexpress.com/item/2251832514359024.html?spm=a2g0o.ppclist.product.2.2c6bKvIPKvIPyv&pdp_npi=2%40dis%21USD%21US%20%24155.77%21US%20%24155.77%21%21%21%21%21%402101d1b116601762776285119e29f7%2160733026270%21btf&_t=pvid:9163c177-03ab-43e6-8a2e-9877fbdcdf8b&afTraceInfo=32700673776__pc__pcBridgePPC__xxxxxx__1660176277

Robotic Arm - https://www.amazon.com/Programming-Powerful-Intelligent-Featuring-Unassembled/dp/B08FT31C5N/ref=sr_1_3_sspa?crid=32Y425MLBV3A7&keywords=robotic+arm&qid=1660176358&sprefix=robotic+arm%2Caps%2C100&sr=8-3-spons&psc=1

Arduino Mega - https://www.amazon.com/ARDUINO-MEGA-2560-REV3-A000067/dp/B0046AMGW0/ref=asc_df_B0046AMGW0/?tag=hyprod-20&linkCode=df0&hvadid=309743296044&hvpos=&hvnetw=g&hvrand=13126266143268222140&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9017002&hvtargid=pla-516265455074&psc=1

RC Receiver - https://www.getfpv.com/frsky-x8r-16ch-receiver-sbus-smart-port-amplified-pcb-antenna.html?gclid=Cj0KCQjwrs2XBhDjARIsAHVymmSKN1F8KLtlT-0bSLvyQ3hzFaS44ksRqzcVsfMGS4geFyjqag54LiEaAurwEALw_wcB

Motor Driver - https://www.amazon.com/DC5-12V-Dual-Channel-H-Bridge-Stepper-Controller/dp/B074TH1719/ref=sr_1_19?crid=3MCV2QYLYX26F&keywords=motor+driver+high+current&qid=1660176748&sprefix=motor+driver+high+current%2Caps%2C96&sr=8-19

2 3S Lipo Batteries (Make sure to get high C rating) - https://www.amazon.com/dp/B07DGSVNP5/ref=sspa_dk_detail_4?psc=1&pd_rd_i=B07DGSVNP5&pd_rd_w=Xs4hs&content-id=amzn1.sym.4d0fffec-3aba-4480-8fad-c6bd8f7f6b41&pf_rd_p=4d0fffec-3aba-4480-8fad-c6bd8f7f6b41&pf_rd_r=QVS46WD2V46362MXZMC5&pd_rd_wg=IqAbg&pd_rd_r=4962a051-8b67-40a3-8092-db13cced4e10&s=electronics&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWxfdGhlbWF0aWM&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEzVEpHQzY5UTRNSjhUJmVuY3J5cHRlZElkPUEwOTgyNjI2UVBMNFNPR1U1SVlaJmVuY3J5cHRlZEFkSWQ9QTA2MTkwODkyNzVQRDNYMkEzQUY1JndpZGdldE5hbWU9c3BfZGV0YWlsX3RoZW1hdGljJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==

Ultrasonic Sensors (6x) - https://www.amazon.com/D-FLIFE-Ultrasonic-Distance-MEGA2560-ElecRight/dp/B07YXX52SC/ref=sr_1_5?keywords=Ultrasonic+Sensors&qid=1660176907&sr=8-5

Buck Converter - https://www.amazon.com/Converter-Adjustable-Regulator-Efficiency-Transformer/dp/B08L5VRBZS/ref=asc_df_B08L5VRBZS/?tag=hyprod-20&linkCode=df0&hvadid=475793181977&hvpos=&hvnetw=g&hvrand=13544166827023971170&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9017002&hvtargid=pla-1130173743967&psc=1

RPI 4 - https://www.amazon.com/Raspberry-Model-2019-Quad-Bluetooth/dp/B07TC2BK1X/ref=asc_df_B07TC2BK1X/?tag=hyprod-20&linkCode=df0&hvadid=380145854123&hvpos=&hvnetw=g&hvrand=873541967843904218&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9017002&hvtargid=pla-818643320764&psc=1&tag=&ref=&adgrpid=85982211068&hvpone=&hvptwo=&hvadid=380145854123&hvpos=&hvnetw=g&hvrand=873541967843904218&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9017002&hvtargid=pla-818643320764

RPI screen - https://www.amazon.com/Raspberry-Pi-7-Touchscreen-Display/dp/B0153R2A9I/ref=asc_df_B0153R2A9I/?tag=hyprod-20&linkCode=df0&hvadid=198093101467&hvpos=&hvnetw=g&hvrand=15602803741765816804&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9017002&hvtargid=pla-378617883326&psc=1

Power Bank - https://www.amazon.com/RETMSR-Portable-30000mAh-Charging-External/dp/B09NKVCJ15/ref=sr_1_2_sspa?crid=71RG2PBDUCTZ&keywords=power+bank&qid=1666564562&qu=eyJxc2MiOiI2Ljc1IiwicXNhIjoiNi40MyIsInFzcCI6IjUuOTIifQ%3D%3D&s=electronics&sprefix=poer+bank%2Celectronics%2C100&sr=1-2-spons&psc=1

In addition, get these spare parts:

Breadboard, Jumper Wires and XT60 male and female headers, Basket, Wood, Metal Standoff and screws

(Created by Shounak Pallav)

The Hardware

20220814_121402.jpg
20220814_121548.jpg
20220814_121611.jpg
20220814_121448.jpg
20220814_121459.jpg

Follow the manual and assemble the heavy duty tank chassis & robotic arm. Drill 4 holes into the front pad of the tank chassis and 4 corresponding holes into the robotic arm base. Connect the 2 parts by attaching 4 metal standoffs in between the parts that are one and a half inch in length with washers. Drill 4 holes into the front pad of the tank chassis that line up with raspberry pi 4B holes and attach a raspberry pi there (under robotic arm) which will be useful for automation purposes later. Then make a diamond shaped wooden plate (DiamondWoodPlate.dwg) and drill 4 holes corresponding to the pre drilled 4 holes on the back pad of the tank chassis and attack it to the chassis. This will be the base of the electronic chamber. The tank chassis is designed in a way that it has a special space under its main structural bars which we can use to conveniently hide the battery box and motor driver module in. Make a rectangular wooden plate (RectangularWoodPlate.dwg) that will fit perfectly inside the special space and drill 4 corresponding holes in the plate which will line up with predrilled holes in the tank chassis. Attaching this rectangular plate will make the support and base structure for the hidden battery box and motor driver module. As this rover is offroad and all weather capable, its a must to protect the battery and motor driver module which are closer to the ground as they will go in the special chamber under the tank. We can protect these sensitive components by 3D printing cases that I designed (TankBatteryHolderV2.stl & DBH-12V Waterproof Enclosure V2.stl), which fit inside the special hidden place and bolt on to the rectangular wooden plate. Now above the diamond shaped wooden plate we mounted earlier we will make the electronics chamber which is essentially support beams (TankBrace.stl) & hinge beams (TankHingeBraces.stl & TankHingeV1.stl) on the diamond shaped wooden plate and on top of those support beams is a partial diamond shaped wooden plate (DiamondPartialWoodPlate.dwg). The end of the partial plate is attached to hinge beams so the partial plate on top of chamber can swivel like a dump truck and enable access to the electronics chamber. On top of this partial swiveling plate attach a bucket which will act as our cargo container for multipurpose missions. At last 3D print the ultrasonic sensor mounts (UltrasonicSensorMountV2.stl & FrontUltrasonicSensorMount.stl) and attach the 6 sensors and mounts to various places on the tank as shown in the pictures: Front, Back, Back Left, Back Right, Front Left & Front Right, the 4 angled sides of the diamond wooden plate are angled for the non Front and Back ultrasonic sensors. Behind the bucket attach the RPI Screen and in the back of the bucket make a pocket for the power bank.

(Created by Shounak Pallav)

The Electronics

UpdatedElectricDiagram.png
20220814_121425.jpg
20220814_121521.jpg
20220814_121411.jpg
20220814_121625.jpg

Electronics can be best visualized by the pictures above:

The Arduino is like a brain in between the receiver/sensors(input) and the motors(output). It is programmable which means that values from the receiver can be multiplexed and modified in a way to operate all the robot's complex functions. This whole system is powered by 2 LIPO batteries that split the load in between themselves which makes them last longer as current is not being drawn above their C rating. The robotic arm controller board uses serial communication bus to operate 6 serial servo motors. I used thick wiring, XT60 connectors and heat shrinks for power distribution to make connections weather proof.

Below are the wiring connection details:

For 4 drive motors wire 2 up parallelly on each side, essentially making it a tank drive. Connect those wired pairs to motor driver motors A & B. Connect one battery to motor driver power supply as the drive system on its own is a high load system.

Then connect the following pins of motor driver to Arduino digital pins accordingly:

EN(A) --> 2

EN(B) --> 5

IN1(A) --> 6

IN2(A) --> 7

IN1(B) --> 3

IN2(B) --> 4

GND(A) --> GND(Arduino) (No need to connect GND(B) to another Arduino ground pin)

How you wire the motors up to motor driver affects the direction that they rotate in, so if they don't rotate in desired direction you can make changes in code instead of rewiring the whole thing.

Next, connect the RC receiver pins to Arduino digital pins accordingly:

CH1 --> 10

CH2 --> 9

CH3 --> 31

CH4 --> 33

CH5 --> 35

CH6 --> 37

CH7 --> 39

CH8 --> 41

VCC(+) --> Arduino 5V

GND(-) --> Arduino GND

After this connect the XARM Servo Controller Board pins to Arduino Serial Digital Pins accordingly:

GND(-) --> Arduino GND

RX(XARM) --> TX1

TX(XARM) --> RX1

Congratulations for getting to this stage, we still have more to go. The first battery powers the drive motors only so the second battery powers the 12V robotic arm and 5V circuitry like the Arduino itself and the ultrasonic distance sensor modules. Make a Y shaped splitter for the second battery cable in which one end of it goes to the 12V to 5V buck converter module and the other end plugs directly into the XArm Controller Board power supply. Take the 5V from the buck converter and utilize a breadboard to split the 5V & ground into many parallelly wired channels. Use one of the channels to plug 5V into Vin of Arduino and ground to GND. Once the Arduino is powered the brain is live!!! After powering the brain parallelly connect all ultrasonic distance sensor module, specifically each VCC should go to one of the 5V channels on breadboard and each GND should go to ground channels on breadboard.

Now we just have to wire the data pins of the sensors to Arduino digital pins accordingly:

The sides signify the placement of ultrasonic sensor on the tank body and their pins.

Front Trig Pin --> 44

Front Echo Pin --> 45

Back Trig Pin --> 24

Back Echo Pin --> 25

Back Left Trig Pin --> 22

Back Left Echo Pin --> 23

Back Right Trig Pin --> 26

Back Right Echo Pin --> 27

Front Left Trig Pin --> 42

Front Left Echo Pin --> 43

Front Right Trig Pin --> 28

Front Right Echo Pin --> 29

That's all for the arduino side of the electronics, obviously you don't have to follow the pinout as you can change a lot of these wires in code (except for power distribution wiring), but I recommend following it as this would be the least hassle.

The raspberry pi side of the electronics are way simpler. Attach a USB data serial cable to the RPI and then to the Arduino establishing a Serial connection. Then power the RPI with the power bank and also power the screen. Also connect HDMI cable to the RPI and Screen.

(Created by Shounak Pallav)

The Software

The final part of this puzzle is the code. The code sets up all the variables and GPIO headers to be either INPUT or OUTPUT. It also enables variable multiplexing and sends PWM values to the motors. For the manual RC control code called DriveMode.ino I used the mathematical unit circle concept to change receiver values to desired arcade drive values and then using my algorithm to make those values compatible with motor driver and then sending the PWM signals. You will also need to program the Radiomaster TX16S joysticks and buttons a little bit to get everything working. The main AIRECONTANKTX16SRXCode.ino handles variables and mainly does the job of switching between the different modes using a switch on the controller: Drive, Robo Arm & Auto. The mode switch is mapped to channel 8 on the controller. ArmandBucketMode.ino is the code responsible for taking in RC controller values, mapping them and then using my special logic algorithm to further modify values and using the serial bus to send those values to the Xarm Servo Controller. AutoMode.ino is incomplete but it will be using a combination of methods from both drive and arm mode to autonomously do tasks. The 6 ultrasonic sensors currently do work in auto mode and give distances. If you didn't follow the pinout I suggested then you can change the pin numbers in the code accordingly to your pinout, make sure to change them in all 4 codes when applicable. Now install OPENCV on the raspberry pi. Once you have setup the serial connection between the Arduino and RPI and uploaded Arduino code you can then upload the Python Raspberry Pi code (https://github.com/speedcode4ever/bananaopencv/blob/main/roveropencvobjectdetection.py) on the RPI and then select your HAAR Cascade file for the object you wise to detect, track & pickup using Computer Vision. In the end the activities you can do with this platform are limited by your imagination. I have linked 2 useful things I have used this platform to do. You don't have to have a use for it in mind you can build it just for fun and learning!!!

I have uploaded the following codes to github:

RPI Code Links:

https://github.com/speedcode4ever/bananaopencv/blob/main/roveropencvobjectdetection.py

Arduino Code Links:

https://github.com/speedcode4ever/bananaopencv/blob/main/AIRECONTANKTX16SRXCODE.ino

https://github.com/speedcode4ever/bananaopencv/blob/main/ArmandBucketMode.ino

https://github.com/speedcode4ever/bananaopencv/blob/main/AutoMode.ino

https://github.com/speedcode4ever/bananaopencv/blob/main/DriveMode.ino

https://github.com/speedcode4ever/bananaopencv/blob/main/MotionSmoothChannels.ino

(Created by Shounak Pallav)

Indoor House Cleaning:

Multipurpose Rover Indoor Cleaning
20220814_165929.jpg

https://youtu.be/-aGwLwEMvB8

(Created by Shounak Pallav)

Outdoor Lawn Cleaning:

OutdoorCleaning2XSpeedV2
20220814_162632.jpg

https://youtu.be/DPyRYtasKx4

(Created by Shounak Pallav)