วันศุกร์ที่ 28 กันยายน พ.ศ. 2561

ARDUINO10 NANO BASED MICROBOT(https://www.instructables.com/id/Arduino-Nano-based-Microbot/)

This instructable was created to be entered in the Robot Challenge. If I win, the parts will of course, go into robots like this one. Notes on how to include some of the very components in the prize packages are given in the last step. I am 28, so of course, I'm not going for the student prizes.

I created this as a simple project for those just starting out in robotics. It is relatively inexpensive, requires minimal tools and is easy to build. Once finished you have an expandable robotic platform that fits in the palm of your hand and can be easily programmed in the Arduino environment.

Here is is driving in a triangle, without any special add ons

In the instructions I'll walk you through how to:

Modify the servos for continuous rotation

Fit the track hubs on to the servos

Make a custom battery pack

Wire it with a few connections

Assemble it

Program it

Customize

These and other additions can be mixed to make your own custom micro robot

For the basic platform the following supplies are needed:
an Arduino nano
a small rechargeable battery
a pair of 9 g servos, modified for continuous rotation
part of a Tamiya track set
a 40 pin dip socket
a rubber eraser
some zip ties

Step 1: Construction: Modify the Servos




2 More Images

Micro servos modified for continuous rotation are the heart of this design. They give you so much of the hardware; the motors, the gearbox, the driver and control circuitry, all in a tiny cheap package, and in this implementation they also act as the frame of the robot (seen in the next step). There are many instructables on modifying servos for continuous rotation. But here is how I did it for the micro 9g servos I am using.

Pictures:

  1. Remove the tiny screws and open the case
  2. Cut the potentiometer wires, these are where you will attach the resistors
  3. If you have surface mount resistors, place a 5k (1k to 10k should work) on the pad from each of the side pads to the middle pad, if you don't twist a pair of through hole resistors like this
  4. Break out the stop on the potentiometer with some small pliers, you need the pot for its use as a rotational bearing
  5. solder on the resistors, if you used the pair of through hole ones, I recommend bundling them in electrical tape like so. For the servo that will go on the front, cut a notch for the wire to exit through the side so it doesn't come from under the robot.
  6. (not shown) Before you close up, put a hole in the back part of the case opposite the spline to mount the idler (wheel with no teeth).
  7. Use some angle cutters or pliers to remove any mounting flanges from the cases and file or sand down the ridges they leave, these can get in the way later.   

    Step 2: Construction: Drill the Hubs to Size

    Picture of Construction: Drill the Hubs to Size
    Picture of Construction: Drill the Hubs to Size
    1. Cut the stems on the hubs so that they just stick past the inner edge of the tracks when installed. This can be done with a hobby knife saw or a coping saw. Be careful you don't slash your hand! For safety I held the hub on a cutting board on its side with my fingers on the other side of the wheel from the stem, and then I rotated it against the cutting board dragging the knife along it, this way if you slip you just hack the board.
    2. Drill the hole for the bolt that will hold it on to the servo in the cap of the drive wheel (the wheels with teeth). You may be using the hub screw that came with the servo. Whatever screw you use that fits in the servo spline, drill the hole to fit. 
    3. Since the small Tamiya hubs don't fit on the servo ends, you'll need to drill them to size. Since these are small and already have holes you don't need a drill press, but you will need something to clamp it down. Servos vary in spline size, so I can't give you an exact size to use. I would suggest you go a bit small, and step it up until the hub fits tightly, these will be transmitting the torque. You also must be careful with depth so the hubs don't rub against the servo body. Measure your servo spline and make the dept of the mounting hole just slightly less than this. I suggest the method of putting masking tape around your drill bit at the depth you want to stop. Then you can hold it next to the servo spline before you drill to confirm it is slightly less.
    4. To install the hubs, the idler should be attached using one of the screws from the Tamiya kit, or another screw of the right length, I got mine from my random hardware jar, and don't have a specific size. Tighten it just enough that it doesn't pinch the wheel down.
    5. On the other side, use one of the screws that comes with the servos through the hole in the driver wheel to snug it down.       //---------------------------StartCode#include <Servo.h>//Loads commands to create Servo objects which generate PWM signals

    6. Servo leftDrive;  // create servo object to control a servo
      Servo rightDrive; //another servo object for the left side

      void setup()
      {
        leftDrive.attach(11);  // attaches the servo on pin 9 to the servo object
        rightDrive.attach(10);  // attaches the servo on pin 9 to the servo object
      }

      void loop()
      {
        //here put commands which drive the servos                       //use the commands
        //rightDrive.write(any number 0-180);
        //leftDrive.write(any number 0 to 180);
        //to set the servos turning 0 is full one way, 180 is full the other, 90 should be near stop
        //which way is forward depends on your servos
      }

      //end code -------------------------------------


      So that gives you an idea how simple this can be.
      Here is a basic code example for just driving around in a square. Note that the video was with the delays set to 600, which resulted in a triangle, 450 gives you more of a square. (code starts after this line):

      //------------------------------------------------------------------------------------------               #include <Servo.h>//Loads commands to create Servo objects which generate PWM signals

      Servo leftDrive;  // create servo object to control a servo
      Servo rightDrive; //another servo object for the left side

      int pos = 0;    // variable to store the servo position

      void setup()
      {
        leftDrive.attach(11);  // attaches the servo on pin 9 to the servo object
        rightDrive.attach(10);  // attaches the servo on pin 9 to the servo object
      }

      void loop()
      {

      //example routine, drives in a square
      turnRight();
      driveForward();
      turnRight();
      driveForward();
      turnRight();
      driveForward();
      turnRight();
      driveForward();

      }


      //the following functions are examples, you could easily make the robot
      //move on curved paths or at varying speeds by changing these numbers
      //0 is full forward, 90 is stop and 180 is full reverse. The case may be the
      //opposite for your build                         //turns right about 90 degrees
      void turnRight()
      {
        leftDrive.write(0);
        rightDrive.write(180);
        delay(450);
      }

      //turns left about 90 degrees
      void turnLeft()
      {
        leftDrive.write(180);
        rightDrive.write(0);
        delay(450);
      }

      //drives straight for 1 second
      void driveForward()
      {
        leftDrive.write(180);
        rightDrive.write(180);
        delay(1000);
      }

      //drives straight backward for 1 second
      void driveBackward()
      {
        leftDrive.write(0);
        rightDrive.write(0);
        delay(1000);
      }

      //end code---------------------------------------------

ไม่มีความคิดเห็น:

แสดงความคิดเห็น