7/8/19 – First Prototype of the Driving Robot

7/7/19: Planning

During tomorrow’s lab I want to use my newly learned laser-cutting and electronics skills to make a rudimentary prototype of the car part of my final project. My idea is to have the car part consist of a few separate parts: a breadboard holder, two angular wire management panels, and two side panels to mount the motors and wheels onto. These parts will be held together by similar press-fit techniques with angular connectors. The whole shape will look like an upside-down U, with wheels and motors on the side and wires running underneath from the top of the chassis to the motors. Tonight (7/7), I was mocking up the design of some of the pieces I plan to cut tomorrow, so I used this resource I found to get a general idea of the dimensions of the breadboard. I want to check the measurements with a caliper tomorrow, though. I also need to choose the right type of motor and wheels, and measure those dimensions so I can accurately create mounts for them.

A first attempt for the breadboard panel made in fusion, need to fix dimensions: Breadboard panel attempt

For my circuits, I plan to use an Arduino Nano that can be plugged into my breadboard, and motors that can be powered directly from the Arduino (and if necessary, I can switch to an UNO). I will thread wires through the sides of my chassis to connect to the motors. After the lab tomorrow and when I get the mechanical parts done, I will try to code the Arduino on my own so the car can drive via pre-programmed code.

Game plan for tomorrow:

  1. Measure dimensions of the breadboard, pick motors/wheels and measure. Adjust design accordingly.
  2. Laser cut the pieces I need to assemble the car.
  3. Assemble, use hot glue/other glue to keep pieces together.
  4. Wire up a circuit connecting 4 motors/wheels to breadboard/Arduino. Solder if needed.
  5. Code the Arduino so when it’s turned on the robot can drive.

7/8/19: Building the Prototype

Today, I made great progress on my actual prototype! When we first got into the lab, we had a micro-lecture on transistors and motor circuits, which was actually very helpful for what I wanted to accomplish today. To wire up a motor circuit that we can switch on and off through code, we need to use a transistor, which is just a fancy switch controlled by the amount of voltage you give through a “gate”. Here are some helpful diagrams from class: Transistor diagram Motor circuit diagram

Next, I used the information that we learned about motor circuits to build my circuit for my prototype. Instead of connecting four motors to four wheels, I decided to use two motors connected to two wheels and then have two free-spinning wheels in the front of the robot. In my circuit, I first hooked up the two transistors, using the datasheet for the part to know which pin was which. Transistors in the circuit I picked out two geared DC motors to wire up because as we learned, the gearing gives the motor more torque, which is better for driving. There were 4 holes on the surface of the motor for mounting, so I also found proper screws to use later. Motors and screws I had to solder the wires onto the motors first before completing my circuit. Soldering motors Here’s my final circuit: Final circuit

After wiring my circuit, I moved towards working on my laser-cut pieces for the chassis. I first measured the breadboard with a caliper to find the proper dimensions, and my original guess was actually pretty accurate. I then laser-cut the test base for the breadboard I had designed last night. Laser cutter view The spots for the connectors were slightly too far in (they interefered with the breadboard), so I adjusted my design and cut it again. In the end, my breadboard base ended up being two centimeters wider than I had originally designed, but with the guard rails I also cut, it holds the breadboard securely. Breadboard panel final

I then worked on making mounts for the motors I chose earlier. I first designed a test version to mount one motor before incorporating the hole pattern into the actual side panels. Screenshot of test mount First, I took measurements with a caliper of the diameter of the motor, the center-aligned holes and their distances from the edge, and the width of the motor shaft so it could fit through. Here are the measurements I took: Measurements The test worked out very well, and the screws and shaft fit perfectly! Motor mount and motor Screwed in mount

Next, I had to find the proper wheels to use for my chassis. I looked in the LEGO® bin because I couldn’t find any other wheels, and I found two small, rubber wheels, some axles, and some axle collars to use to make my free spinning wheels. I also found two bearings in the bearings bin to put the axles through. Parts for free-spinning wheels This is how it turned out– the wheels spin pretty nicely! Wheels mounted Now, I need to find proper wheels I can mount onto the motors (or even make my own wheels) next time.

I finished cutting out all the parts for the chassis in the laser-cutter, and I hot glued the edges together for stability. I added in slots for wire management. One problem I noticed, though, is that cardboard is very flimsy and is a wobbly material, so my next prototype needs to be much more robust and stable. I mounted in the motors, as well. Here is the final product of all I got to assemble and do today: Mounted motors Top view Side view

Click to download my breadboard base file Click to download my motor plate file Click to download my connector file Click to download my wire management plate file Click to download my breadboard guards file

7/10/19: Wheels, Electronics, and Code

During the lab today, I mounted on the motor-controlled wheels, fixed my electronics, and wrote some basic code that all resulted in the car part being able to move!!

My first task was finding a valid solution for wheels to mount onto my DC motors. At the end of yesterday’s class, I had found some extra LEGO® wheels that I used for the free spinning wheels in the LEGO® bin. I also found two shaft collars that perfectly fit around the motor shaft, so I attached those to the motors. Shaft collars The LEGO® wheels consist of two parts: a rubber tire exterior and a plastic center, which was removable. Luckily enough, the plastic center was almost the exact diameter as the shaft collar, so I was able to put the tire around the shaft collar. To attach the tire to the shaft collar, I used a quick-drying, two-part epoxy. Epoxy and tired I cut the epoxy package open, squeezed the two parts out onto a small piece of cardboard, and then mixed together with a popsicle stick. I put epoxy on the circumference of both the shaft collar and the tire, and fit the tire on. I used these instructions to help since it was my first time using epoxy: Epoxy instructions I let it cure for twenty minutes according to this guide (click to view). When I came back, the tire was bonded tightly onto the shaft collar. Tire front Tire side

After I got the wheels to work, I wanted to write code to drive the car, but when testing with a sample “blink” code, I noticed that the motors were not stopping when the code told it to. I then spent the next hour trying to figure out what the issue was and fixing it with the help of Professor Melenbrink and Andrei. We tried poking around with multimeters and changing the code, but it still didn’t work. Multimeter testing Andrei suggested that I add resistors from the gate to ground to give the current a path of less resistance when the gated current was high, and to add flyback diodes between the motor leads. New circuit Turns out, the problem was just that I had mixed up which pin was “drain” and “source” in the transistor, and after switching the wires, the car drove perfectly!

I hooked up the motors to PWM digital pins 5 and 6, and I used the specs for the Arduino Nano on their website to find out which pins were PWM. The code I wrote to drive the car consisted of different movement functions for the directions, and these methods were called in the void loop. The functions also took in an int for time, “t”, and that was the length that the function would run until the “stop” function was called to stop the motor. Move functions I added in a simple series of movements in the void loop to test the driving, and it worked well! It will be a good structure for integrating the communication between the glove and the car into. Here’s a video of the robot driving:

Click to download my code

(You can see my final project page for an overview of my prototype and reflections for the future.)