Servos won't work


#1

I build the 4-legged allbot. I used a arduino mega 2560. I connected the VRSSM shield and placed the blue shunts as indicated in the manuals. I connected the servos to the pins mentioned in the building manual (pins A1-A0-9-4-11-2-10-3).
When I upload an example program the allbot chirps, but the servos don’t do anything. I wrote a very simple program to let the allbot stand up, but he doesn’t. I connected the servos to the VRSSM shield to center them, as indicated in the manual, and that worked fine.

Can anybody help me?


#2

could you post a picture of the VRSSM shield?


#3

Here is an image of my VRSSM:

https://drive.google.com/file/d/0B4ayhXjzTNotaThWYlpoaDhPc00/view?usp=sharing

I hope this worked. I have never shared a picture in this manner.


#4

Thank you, can you explain how you power your allbot?

Can you post your arduino sketch?


#5

Here is my sketch:

[code]#include <Servo.h>
#include <ALLBOT.h>

ALLBOT BOT(8); //number of motors

enum MotorName {
hipFrontLeft,
hipFrontRight,
hipRearLeft,
hipRearRight,
kneeFrontLeft,
kneeFrontRight,
kneeRearLeft,
kneeRearRight
};

int sounderPin = 13;

void setup() {

//INIT sounder
pinMode(sounderPin, OUTPUT);

// Chirp for begin
chirp(2, 25);
chirp(3, 200);

//NAME.attach(motorname, pin, init-angle, flipped, offset-angle);
BOT.attach(hipFrontLeft, A1, 45, 0, 0);
BOT.attach(hipFrontRight, A0, 45, 1, 0);
BOT.attach(hipRearLeft, 9, 45, 1, 0);
BOT.attach(hipRearRight, 4, 45, 0, 0);

BOT.attach(kneeFrontLeft, 11, 45, 1, 0);
BOT.attach(kneeFrontRight, 23, 45, 0, 0);
BOT.attach(kneeRearLeft, 10, 45, 1, 0);
BOT.attach(kneeRearRight, 3, 45, 0, 0);

//wait for joints to be initialized
delay(500);

// Chirp for ready
chirp(1, 50);
chirp(1, 255);
chirp(3, 0);

}

void loop() {
// put your main code here, to run repeatedly:

}

void chirp(int beeps, int speedms){
for (int i = 0; i < beeps; i++){
for (int i = 0; i < 255; i++){
digitalWrite(sounderPin, HIGH);
delayMicroseconds((355-i) + (speedms2));
digitalWrite(sounderPin, LOW);
delayMicroseconds((355-i) + (speedms
2));
}
delay(30);
}
}[/code]

I used the VRBS1 shield and I also tried an external 9 V, 6 W power supply.
There was no difference in the working of the program.


#6

Thank you,

Can you specify where you powered your ALLBOT? On the powerconnector on the VRSSM shield of the powerconnector on the battery VRBS1 shield or the powerconnector on the Arduino?

The only connector that will power the Arduino and the servo is the powerconnector on the VRBS1 shield but 9V is to high for the servo’s.


#7

I used the VRBS1 shield with new batteries. Still no reaction from the servos.


#8

Can you hear the beeping sound (like R2D2) when you start your ALLBOT? This indicates that the software has been loaded correctly and the arduino is getting power. If you hear this but the servo’s are not working we can work from there but if you do not here this on startup it means either your arduino is not getting power or the software was not loaded correctly.


#9

Hello! We have almost the same problem as the other guy. But our allbot makes sound(like R2D2) but it doesnt move when we are using the app to controll it. It doesnt move by itself either.
Best Reagards
We are knoobs


#10

Could you post a photo of the VRBS1 with batteries included?


#11

Also check the position of the shunts (blue pieces on top of the VRSSM)


#12

The port numbers are wrong.

According to the shield manual, when using an arduino mega and if configured for arduino mega, ports are not 1-12 but 22-33!

Because of the wrong port numbers, the bot won’t move.

Before actually running this code, make sure you realy centered the servos because even that code is wrong! You need to use port 22 instead of 1 there.

Change the port numbers in bot.attach and it will run (I just tried that).
When you initialise the bot this way :

  BOT.attach(hipFrontLeft,   A1,  45, 0, 0);
  BOT.attach(hipFrontRight,  A0,  45, 1, 0);
  BOT.attach(hipRearLeft,    30,  45, 1, 0);
  BOT.attach(hipRearRight,   25,  45, 0, 0);
 
  BOT.attach(kneeFrontLeft,  32,  45, 1, 0);
  BOT.attach(kneeFrontRight, 23,  45, 0, 0);
  BOT.attach(kneeRearLeft,   31,  45, 1, 0);
  BOT.attach(kneeRearRight,  24,  45, 0, 0);

it will stand up quickly :wink:

I wonder if someone at velleman ever tried theire samples? Because also the routine for centering the servors will not work with a arduino mega!


#13

Yes currently the sketches are for the UNO only we will update them to be capable with the MEGA


#14

thank you very much for this post


#15

is it correct that the servo’s go in some kind of lock when centered correctly?


#16

Yes but you have to keep power on them to hold.


#17

I’ve centered them again while assembled. and it is pretty straight. now im gonna shoot the program in in it with the changes from Auo


#18

Still not standing up, but a lot more movement. Some servo’s seems to go contra, what the supposed to do. one step closer of a standing robot. :laughing:

I’ve connected them wrong as in the manual. and I have to use the mega pin out ofcourse. But I can’t find pin 31, 32, and 33 on the VRSSM SHIELD.


#19

I don’t know how much help I can be.
Make sure you are using quality batteries and they are good.
The VR408 needs a lot of power.
Since you are using a Mega did you move these jumpers?
3104


#20

Yes I’ve good batteries, the servo’s move really good. only not in the right direction. And I moved the shunts to the mega.
I really hoped that post from Auo would solve the problems. withe centering the servo’s on point 22 works good. but using the axemple scetch. with the changes Auo made. it still moves strange. And I can’t find pin 31 and 32 on my VRSSM SHIELD.

I’ve got it. I’d changed the pinout physically, that’s why couldn’t find pin 31 32 and 33. The only thing I had to change was the pinout in the software. so I’d never centered the servo’s correctly to begin with.

now everything makes sense. :raised_hands: