Project showcase
Homework 7: Working Chassis Design

Homework 7: Working Chassis Design

With no choice left, I did the unthinkable: I glued the motors to the prototype :(

  • 369 views
  • 1 comment
  • 0 respects

Components and supplies

Ph a000066 iso (1) ztbmubhmho
Arduino UNO
×1
male-to-male wire
×8
male-to-female wire
×10
lollipop sticks
×1
rubber band
×2
rubber wheel
×2
DC motor (generic)
×2
Tens70
9V battery (generic)
×1
AA battery
×4
L298 motor controller
×1
09939 01
Rotary potentiometer (generic)
×1
button switch
×2
Mfr 25frf52 1k sml
Resistor 1k ohm
×2
12002 04
Breadboard (generic)
×1
arcylic
×1

Necessary tools and machines

Lasercutter
Laser cutter (generic)

About this project

A finished rolling chassis, working steering, working motors. Treat this as a final design, but without the polish of final presentation.

This homework was to continue on with our prototype chassis from the last assignment and make a working version, with full steering and motion.

Process

Out of the models from last week, I choose Model #1, since I felt it the most fleshed out of the three models I had. Once that was decided, I went forward with planning out the finer details of the project.

if (typeof(lightBoxImages) == 'undefined') { lightBoxImages = {}; } lightBoxImages[42090] = [{ URL: 'https://hackster.imgix.net/uploads/image/file/88774/IMG_0193.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Figuring out how to translate the potentiometer readings to direction.', type: 'image' },{ URL: 'https://hackster.imgix.net/uploads/image/file/88776/IMG_0195.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Writing out the measurements for the caster wheel.', type: 'image' },{ URL: 'https://hackster.imgix.net/uploads/image/file/88775/IMG_0194.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Drawing out how the components would be laid out, and a small diagram of the controller.', type: 'image' }];

The parts I had to work out were the caster wheel, the body, and the controller.

 

if (typeof(lightBoxImages) == 'undefined') { lightBoxImages = {}; } lightBoxImages[42095] = [{ URL: 'https://hackster.imgix.net/uploads/image/file/88784/IMG_0200.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Picture of the caster wheel.', type: 'image' }];

The caster wheel would have to be at most as tall as the height of the wheels I've chosen to drive the vehicle, such that either the body of the vehicle was even or at a downward tilt. This would prevent the car from tipping over (though in hindsight, the idea that my vehicle would tip over from a loss of balance would be laughable, given what I ended up stacking on the tail). I took the design of the driving wheel I had for Model #3 in the last assignment for the caster wheel, and it worked well. I also had the idea of using cable ties to perhaps give the wheel more traction, but in practice it was hard to get the cable ties flat. I also didn't consider where the clip part would go, so in the end, the idea didn't work. Unfortunately, the epoxy I used to keep the caster wheel on the chassis may have made the caster wheel less "swingable" as I would like it to have been, such that without manual manipulation, in practice the caster wheel will remain stationary in direction.

if (typeof(lightBoxImages) == 'undefined') { lightBoxImages = {}; } lightBoxImages[42093] = [{ URL: 'https://hackster.imgix.net/uploads/image/file/88781/IMG_0196.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Comparison of the first body type to the Model #1 prototype.', type: 'image' }];

The body was perhaps the most problematic part of this entire assignment. I wanted to use cable ties to keep the motors on the body, and after I had made the first prototype of the body, I realized that the cable ties I wanted to use were too short to close. Thus I had to make another one, only to find that the cable ties were too strong, ripping and cracking apart the body near the holes I made for the cable ties. I tried rubber bands, but they wouldn't keep the motors in place. In the end, I decided I was spending too much time trying to figure out how to attach these motors, so I just used epoxy to glue the motors on. 

if (typeof(lightBoxImages) == 'undefined') { lightBoxImages = {}; } lightBoxImages[42091] = [{ URL: 'https://hackster.imgix.net/uploads/image/file/88779/IMG_0187.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Giving up and gluing the motors on.', type: 'image' },{ URL: 'https://hackster.imgix.net/uploads/image/file/88778/IMG_0186.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Trying to use rubber bands to keep the motors on,', type: 'image' },{ URL: 'https://hackster.imgix.net/uploads/image/file/88782/IMG_0188.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Testing out the shield and battery pack holder.', type: 'image' }];

Another part of the body I hadn't fleshed out as much was how the rest of the components, the shield and the battery pack, would be placed. I had a defined placed for the Arduino, such that the design was built around the Arduino, but things like how the wiring would obstruct motion, the weight of the battery pack, or the length of the male connector for the battery pack to the Arduino weren't factored in. To address the weight, I used a spare body cutout to help strengthen it. I guess I was lucky everything else more or less fit as I hoped they would.

if (typeof(lightBoxImages) == 'undefined') { lightBoxImages = {}; } lightBoxImages[42092] = [{ URL: 'https://hackster.imgix.net/uploads/image/file/88783/IMG_0202.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Close up on the controller.', type: 'image' }];

I wanted to mimic a game console controller, so I went with a "joystick" on the left and two buttons on the right. The joystick would controller what direction the vehicle would move in, while the two buttons would be the forward and backwards motion. Of the components that came in our kit, I figured the potentiometer would be the best fit to play the role, and for the buttons, two simple button switches. Following our previous assignments, making the circuitry for the controller was pretty simple.

Results

if (typeof(lightBoxImages) == 'undefined') { lightBoxImages = {}; } lightBoxImages[42094] = [{ URL: 'https://hackster.imgix.net/uploads/image/file/88787/IMG_0199.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'How the motor is wired up.', type: 'image' },{ URL: 'https://hackster.imgix.net/uploads/image/file/88788/IMG_0201.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'View from the front.', type: 'image' },{ URL: 'https://hackster.imgix.net/uploads/image/file/88786/IMG_0198.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'The rubber band saved the day!', type: 'image' },{ URL: 'https://hackster.imgix.net/uploads/image/file/88785/IMG_0192.JPG?auto=compress%2Cformat&w=1280&h=960&fit=max', caption: 'Whole model.', type: 'image' }];

After all the close calls, it worked! Like I mentioned before, the caster wheel doesn't really work, and for some reason, the wheels seem to only have two speeds, full or stationary, despite deliberately coding in analog to get different speeds. Thus steering is a little tricky, but by doing it in segments (holding A only in short bursts on the controller :P), I can get the car to go where I want it to. 

And now to see it in motion:

Sorry for the messy apartment!

Conclusion

For the final model, I should probably consider 3D-printing the front of the body so I can have a more modular motor attachment method. Hopefully we could do a wireless controller, but otherwise I need longer wires. Soldering things together should clean up the model a lot. Maybe I can also fine tune the code so the steering is smoother. Better craftsmanship on the caster wheel could help too. But this is a good step forward!

Code

Driving CodeC/C++
const int LEFT_IN = 3;
const int LEFT_OUT = 5;
const int RIGHT_OUT = 6;
const int RIGHT_IN = 9;

const int POTENTIOMETER = 0;
const int BACKWARD_SWITCH = 11;
const int FORWARD_SWITCH = 12;

void setup()  {
  Serial.begin(9600);
  pinMode(POTENTIOMETER, INPUT);
  pinMode(BACKWARD_SWITCH, INPUT);
  pinMode(FORWARD_SWITCH, INPUT);
}

void loop() {
  int val = analogRead(POTENTIOMETER);
  int left_val = 255;
  int right_val = 255;
  if (val < 475) {
    left_val = (val >= 150) ? map(val, 150, 475, 0, 255) : 0;
  } else if (val > 525) {
    right_val = (val <= 850) ? 255 - map(val, 525, 850, 0, 255) : 0;
  }
  if (digitalRead(FORWARD_SWITCH) == HIGH) {
    move_wheel(LEFT_IN, LEFT_OUT, left_val, true);
    move_wheel(RIGHT_IN, RIGHT_OUT, right_val, true);
  } else if (digitalRead(BACKWARD_SWITCH) == HIGH) {
    move_wheel(LEFT_IN, LEFT_OUT, left_val, false);
    move_wheel(RIGHT_IN, RIGHT_OUT, right_val, false);
  } else {
    move_wheel(LEFT_IN, LEFT_OUT, 0, true);
    move_wheel(RIGHT_IN, RIGHT_OUT, 0, true);
  }
}

void move_wheel(int in, int out, int val, boolean forward) {
  analogWrite(in, (forward) ? val : 0);
  analogWrite(out, (forward) ? 0 : val);
  return;
}

Schematics

Cut Template
Circuitry
Circuitry

Comments

Similar projects you might like

Homework 8: Final Vehicle

Project showcase by Eric Chen

  • 3,486 views
  • 2 comments
  • 3 respects

BE∆ST: Bluetooth Vehicle Final Designed Chassis

Project showcase by Matthew Chiang

  • 4,729 views
  • 0 comments
  • 21 respects

Working with Shift Register

by SUMAN BARGAV R

  • 12,926 views
  • 4 comments
  • 12 respects

Arduino Burglar

Project showcase by paolo_cravero

  • 6,153 views
  • 2 comments
  • 9 respects

Banger BLE Car

Project showcase by Francesc0

  • 2,339 views
  • 0 comments
  • 12 respects

New Electronic Music Instrument Design

Project showcase by cpeckmusic

  • 9,276 views
  • 1 comment
  • 28 respects
Add projectSign up / Login