Create an FPV 4WD Robot

by guibot in Circuits > Robots

1460 Views, 20 Favorites, 0 Comments

Create an FPV 4WD Robot

bTT0
IMG_0051-825x510.jpg

This project shows a walk through the process of creating a robot with an FPV (first person view) system. Sometimes people ask how does a robot ends with this or that shape of feel, and I just tell them that this is like a painting, it evolves regarding the tools and materials available, according to the spare time wich is not much and of course, it evolved regarding my mood.

I am showing here simple ways to create fun stuff with available pieces of technology, like chassis, motors, servo motors, camera, PVC sheets and FPV components (radio tx-rx and a screen).

Create an FPV 4WD Robot - Step 1

22091185611_f6c4b9b1b0_z.jpg
21460042393_9c12d90e2e_z.jpg
21460042863_870de27847_z.jpg

I started with a 2WD chassis and assembled a Motoruino, a Camera and a Pan and Tilt servo, plus a Radio Remote Control.

This hacked chassis wasn't performing the way I wanted, besides the caster wheel was freaking out my wife because it was making a lot of noise on the apartment’s pavement, and luckily I had another brand new 4WD chassis.

The Turnigy controller works just fine, and to get the sticks values I am using the very well documented code from Sparkfun Nick Poole.

Create an FPV 4WD Robot - Step 2

22949317302_e3e8496bca_z.jpg
22936709586_95be704b5b_z.jpg
22973872341_b9fc916d85_z.jpg

I decided to swap all the electronics to the new chassis, and the result is great, glad I did it!

With 4WD it moves really quickly and motion is much more stable now, besides I am feeding the motors with a 3S Lipo battery witch gives a great pump.

I still don’t like the way it is, with the battery exposed on the top, makes the gravity center high, besides the pan/tilt is very shaky when it moves in full speed.

Create an FPV 4WD Robot - Step 3

23218673655_63cfbdae93_z.jpg

After completed the assemble of the 4WD chassis, I started by placing the battery on the lowest level, this is one of the heaviest components of the robot, and it will make the center of gravity low witch is always good.

Create an FPV 4WD Robot - Step 4

23218672625_511fb47366_z.jpg

with the electronics all looks good

Create an FPV 4WD Robot - Step 5

22590222144_566af18e72_z.jpg

I added a power switch and a Sharp Infra Red sensor, this sensor will act as a fail safe to avoid collisions.

Create an FPV 4WD Robot - Step 6

22923441590_936fbed7fb_z.jpg

I also wanted to create some kind of a shell, so went to 3D to design the plates and this is the result.

Create an FPV 4WD Robot - Step 7

22922856120_c47d6fb43c_z.jpg

The plates will be cutted in laser or CNC, but meanwhile I will just print them and manually cut PVC sheets.

Create an FPV 4WD Robot - Step 8

22824515947_4c36a3f878_z.jpg

using graphite pencil to transfer the plate drawings to the PVC sheets.

Create an FPV 4WD Robot - Step 9

22850720059_4d58264158_z.jpg

All the plates are transfered and ready to be cutted.

Create an FPV 4WD Robot - Step 10

22591587003_f522358a42_z.jpg
22591586103_c7e2461067_z.jpg
23192547316_e2856bdba9_z.jpg
23192546476_9d5623b93c_z.jpg

The plates are cutted, now I will just sand a bit to give a final touch

Create an FPV 4WD Robot - Step 11

22824506617_270788aec9_z.jpg

Time to start with the supports for the plates, I will go to these small L shape brackets.

Create an FPV 4WD Robot - Step 12

22824505617_77725093fe_z.jpg

All the supports are fitted, when we have lots of screws, an electric screwdriver might be very handy, this one is the cheapest I could find and works great.

Create an FPV 4WD Robot - Step 13

22591576843_99f2883fd4_z.jpg
22922840830_5ba1c197ba_z.jpg
23218655795_48a109002c_z.jpg
22590204294_3a0007b1b5_z.jpg

Now to fit the plates I will use this selftap screws, they come together with the servos motors, and I always harvest them because they are hard to find in hardware stores.

You can also see a hinge, this will actually make a door to swap batteries.

And this is how the plates are securelly fitted.

And a look on the inside.

Create an FPV 4WD Robot - Step 14

22824497837_cc2c3171ca_z.jpg

This is how I managed to hold the power button in place, it is just PVC pieces fitted to the chassis, and then hold the power button with self tap screws.

Create an FPV 4WD Robot - Step 15

23218650365_1b917d2593_z.jpg
22591568043_2c6d84e562_z.jpg

Testing everything, all look good.

I was doing another quick test when suddently smoke started to come out, it was the L293D that got smoked.. well, I couldn’t expect better since I was pushing 12V to 4 motors and the L293D only handles 600 mAh per channel.

I will swap the board to the new Artica's Motoruino2, it has an L298 witch handles 2 amps per channel.

Create an FPV 4WD Robot - Step 16

23234720856_cc077c8832_z.jpg

Motoruino2 is a great board, has a built-in IMU, motor encoder connections and an L298 for more power demanding motors, there is a dedicated low-level Arduino (uno) to handle all the raw data from this sensores and actuators. Then, there is a high-level Arduino (Leonardo) that is totally available to whatever we want to do. Both microcontrollers communicate via I2C. There is also a speaker and a microphone that I intend to use later on this project. Also an xbee socket, 1S lipo charger and a mosfet output capable of driving about 2 amps.

Enough said, its a great board and I hope Artica manage a way to put it into the market. Just see for yourself :)

Create an FPV 4WD Robot - Step 17

22964460480_84656b303d_z.jpg

This is how the bot is looking now, the Motoruino2 is slightly bigger than the previous version, but it just fits perfectly.

Create an FPV 4WD Robot - Step 18

22633179983_f9e3d28ab0_z.jpg
22633176813_d814b94313_z.jpg

I want to have some lights and I found this little 12v LED lights on the hardware store, this little things in full power completely blind you! To drive the LEDs I am using the mosfet output on the board.

And the shell of course, I changed the pan and tilt system, this is a much robust solution and I removed the pan, if I want to pan I just move the bot side to side.

Create an FPV 4WD Robot - Step 19

22892786609_8614840899_z.jpg
22632299144_e25f98a5ef_z.jpg
22866167117_2cecc2156d_z.jpg

Et voilá… :D

Thanks for watching this walkthrough, I hope you find it useful!

Happy creations!!

21460042863_870de27847_z.jpg
23200501136_d0ab35dd95_z.jpg

About the controller, I want it to have something we see in the drone industry, a controller with the screen, all-in-one. There is always the option to connect the receiver to the TV, but I really want it to be standalone, independent of power wallets, just something that I can carry anywhere I go.

First step was to find a way to hold the screen to the remote, so I added zip ties to the back of the screen.

23226631355_35529084be_z.jpg

I also added a compartment to hold the receiver, battery and wires (collecting acrylic stuff is a good habit I guess)

22858677029_18acfd6f7b_z.jpg
22930814860_0200678ec2_z.jpg
22832467457_6b60d42b91_z.jpg

Not bad I think!

The back side is still messy, but I will live with it for now.

Screen Shot 2015-11-28 at 23.17.13.png
Screen Shot 2015-11-28 at 23.17.32.png
Screen Shot 2015-11-28 at 23.17.43.png
Screen Shot 2015-11-28 at 23.17.48.png

The programming.

To capture the RC data I am using a simple Arduino function called pulseIn(). You can see all the reference on the Arduino site. I discovered this function while googling "radio control joystick to arduino" and found this great example from Sparkfun.

All the code is available in github.

There is a folder called "RC_reader" with a program that captures all the 6 RC channels and prints RAW values to the console. Using this code, I am reading raw data from the RC, now we just need to map this data to an usable format (0 - 1023) or (0 - 255) or (0 - 180).

--

The actual code have three important functions:

// map RC RAW values to usable values
rc_mapper();

// map usable values to PWM values
motionMapper();

// controls motion with IR sensor and RC control
motionControl();

--

rc_mapper() - maps the joystick to a differential drive, and once again google made my day, otherwise I would still be struggling with this component. This function will give two values 'left_vertical' and 'right_horizontal' that will be used later to assign speed to the motors.

motionMapper() - all the source for this function can be seen here. I had to hack this bit of code to use with the Motoruino2, because the motors are on a Slave uC, I am using a function to set PWM for both motors.

motionControl() - just uses the values that comes from the motionMapper() and sends them through the function setPWM(leftMotor, rightMotor).

--
I am also using the right knob on the remote controller to set maximum velocity.

--
There is also a Sharp Distance Sensor that is being used to avoid collisions. On the motion control I am testing the distance, and if it is below 100 the bot runs normally, if it is beyond 100 and below 200 it moves slowly, and if it is beyond 200 stops. It can always move backward, there is still some tweak I want to do here, for instance, I want to be able to enable or disable this feature in runtime.

For the light I am using one of the sticks with 3 positions. Each position gives a value, each value will correspond to a light state.

Not to much to say about the servo control. I just need to verify the course limits to avoid collisions with other components on the bot.

All the code is available and commented on GitHub.