Simple bending car with servo's


#1

Another very simple car to test the servo motors. This one is rather minimalistic, the idea was to have (powered) wheels that could turn using the servo motors.

Here is the code (as before, this source code is NOT optimized! and heavily based on the sample makeblock code) :

#include <Makeblock.h>
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>

MeDCMotor motor1(M1);
MeDCMotor motor2(M2);
MeInfraredReceiver infraredReceiverDecode(PORT_4); 
MeServo servoDriver1(PORT_1,DEV1);
MeServo servoDriver2(PORT_1,DEV2);

int rightturn = 65;
int straight = 90;
int leftturn = 115;

uint8_t motorSpeed = 100;

void setup()
{
    infraredReceiverDecode.begin();
    servoDriver1.begin();
    servoDriver2.begin();
}

void loop()
{
    if(infraredReceiverDecode.available())
    {
        switch(infraredReceiverDecode.read())
        {
            case IR_BUTTON_PLUS:     servoDriver1.write(straight) ; servoDriver2.write(straight) ; motor1.run(-motorSpeed) ; motor2.run(-motorSpeed); break;
            case IR_BUTTON_MINUS:    servoDriver1.write(straight) ; servoDriver2.write(straight) ; motor1.run(motorSpeed) ; motor2.run(motorSpeed); break;
            case IR_BUTTON_PREVIOUS: servoDriver1.write(leftturn) ; servoDriver2.write(rightturn) ; break;
            case IR_BUTTON_NEXT:     servoDriver1.write(rightturn); servoDriver2.write(leftturn); break;
            case IR_BUTTON_PLAY:     motor1.stop() ; motor2.stop() ; break;
            default:break;
        }
    }
}

cheers,
paul


#2

I put a video of this car on youtube:


#3

Cool! I have been working on a camera vehicle project, I think the structure is very appropriate for my project. I used DC motor rather than servo, but it’s difficult to control angel. I am considering to replace them.

My next plan. I want to adjust the angle (a) by its turning radius®. When I put a camera on this vehicle, I think I will already know which route I want the camera go along. In the other hand, the angel is not very visualized. I need to change the code.


#4

Hi, paulcobbaut, I made another servo bending system last Saturday. The wheel of each side is independent. So it got a little complicated of it. I use connecting rod between the servo and wheel. I will shoot a video later.


#5

Looks nice!

Next time I will need to add some of those very small beams to my order. The shortest ones I have now have six holes in a row. Also, are those small tires for sale ?


#6

They are slicks. We have a lot of them. Our people need time to put them on the website. So if you make an order, please tell me and I will put some slicks in your package for free.


#7

Nice designs !

Here are some photos from a 3-Wheel car (or a 3 wheel moto) i made some time ago also with one servo


#8

Great photos! Could you upload a video to show its movement?

And I think maybe you could move the motor to the back wheel. It seems a little abrupt :slight_smile:


#9

Sorry i’ve not any video, i made it some months ago and forgot to make a nice video. I have to build it and then i’ll upload some video.

The motor is font for several reasons:

  • Like this we only use 1 DC motor, if it goes back we’ll need 2 motors, one in each wheel.
  • If we put 2 motors back the 3-wheel car doesn’t turn with the servo and it only drag the front wheel with no effect
  • With this desing the car is very good manageable

i’ll try to mount it and show you the results :slight_smile:

I made this other video, it’s very old and perhaps you’ve already seen it


#10

As you will discover in this session, closed loop systems—which are frequently utilised in industrial and commercial applications—are where servo motor applications are most frequently used. you should keep a brand winches for your simple bending car with servo’s.