Blog 17

From BitWizard Wiki
Jump to navigation Jump to search

2 Wheel controlled car

I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.

Stepper motor version

Hardware I used on my Raspberry Pi:

Programming:

  • Bash

3D printed wheels code

I made the wheels in OpenSCAD and let them be printed out on a 3d printer. The OpenSCAD code:

$fs=0.2; $fa=2;

module stepperas(d=5, l=25, t=3) 
{
  difference()
  {
    cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1])   cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1])  cube([10, 20, l+2]);

  }
} 

difference()
{
  union () {
    difference () {
      cylinder (r=60/2 ,h=12);
      translate ([0, 0, 1.5])
        cylinder (r=50/2, h=20);
    }
    cylinder (r=6,h=6);
  }  

  translate ([0, 0, -1]) 
    stepperas(5.2, 20, 3.2);
}

The full car just went to be a carton box, with everything attached to it with tieraps.

'electric wheels' version

Hardware I used: