16 channel servo driver problem.

good day, i'm a beginner in arduino, but i used gizduino (arduino clone from e-gizmo company). my project is wireless robotic arm.. i use flex sensor to read the position of the finger. i also used APC220 for the transmission of data between two arduino. In order to control the multiple servo motors for my robotic arm, i used 16 channel servo driver (from e-gizmo company also). When i attached a single servo on servo driver, the servo motor work properly, but the problem is when i attach multiple servo on servo drivers, even a single servo didn't function. The basic setup maid by the said company is correct.

this is the sample code i've used:

/*
 e-Gizmo 16 Channel Servo Driver

  Sample codes function for
  16 Channel Servo driver.

  Codes by:
  e-Gizmo Mechatronix Central
  http://www.e-gizmo.com

*/

int x;

void setup(){
 
Serial.begin(9600);
}
void loop (){
// for(x=0;x>=100;x++){
  Serial.write(0x02);
  Serial.print("0,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("1,500,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("2,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("3,500,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("4,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("5,500,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("6,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("7,500,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("8,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("9,500,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("10,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("11,500,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("12,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("13,500,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("14,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("15,500,50");
 Serial.write(0x03);
 
 
 delay(1000);
 
  Serial.write(0x02);
  Serial.print("0,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("1,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("2,2200,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("3,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("4,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("5,2200,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("6,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("7,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("8,2200,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("9,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("10,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("11,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("12,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("13,2200,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("14,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("15,2200,50");
  Serial.write(0x03);
 
  delay(1000);
  
}

your suggestion/comment is highly appreciated. tnx

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

Hi everyone..

i'm a beginner in arduino, but i used gizduino (arduino clone from e-gizmo company). my project is wireless robotic arm.. i use flex sensor to read the position of the finger. i also used APC220 for the transmission of data between two arduino. In order to control the multiple servo motors for my robotic arm, i used 16 channel servo driver (from e-gizmo company also). When i attached a single servo on servo driver, the servo motor work properly, but the problem is when i attach multiple servo on servo drivers, even a single servo didn't function. The basic setup maid by the said company is correct.

this is the sample code i've used:

/*
 e-Gizmo 16 Channel Servo Driver

  Sample codes function for
  16 Channel Servo driver.

  Codes by:
  e-Gizmo Mechatronix Central
  http://www.e-gizmo.com

*/

int x;

void setup(){
 
Serial.begin(9600);
}
void loop (){
// for(x=0;x>=100;x++){
  Serial.write(0x02);
  Serial.print("0,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("1,500,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("2,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("3,500,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("4,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("5,500,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("6,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("7,500,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("8,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("9,500,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("10,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("11,500,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("12,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("13,500,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("14,500,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("15,500,50");
 Serial.write(0x03);
 
 
 delay(1000);
 
  Serial.write(0x02);
  Serial.print("0,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("1,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("2,2200,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("3,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("4,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("5,2200,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("6,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("7,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("8,2200,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("9,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("10,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("11,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("12,2200,50");
  Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("13,2200,50");
 Serial.write(0x03);
   Serial.write(0x02);
  Serial.print("14,2200,50");
 Serial.write(0x03);
  Serial.write(0x02);
  Serial.print("15,2200,50");
  Serial.write(0x03);
 
  delay(1000);
  
}

your suggestion/comment is highly appreciated. tnx

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

When i attached a single servo on servo driver, the servo motor work properly, but the problem is when i attach multiple servo on servo drivers, even a single servo didn't function.

Servos need an external power supply like in the attached pix. Also, #7 below:

http://forum.arduino.cc/index.php/topic,148850.0.html

servo-wire.jpg

tnx sir, i also tried that without 16 channel servo driver. every servo has own source and it work well. but the PWM output of standard arduino is limited. the total number of servo motor i'll use are 18 servos.. theats why i used servo driver. or else did u mean sir, even if i use 16 channel servo drivers, need also to separate each source? tnx sir for your quick reply.

---DO not call us 'Sir' :slight_smile:
---Post the connections YOU made, even if its the same as some other tutorial/video.
--- Try different methods. This article here, may help you.

ok tnx a lot.. i'll try to do this :slight_smile:

---DO not call us 'Sir' :slight_smile:

In some cultures "Sir" is a salutation of respect. You raised in a cave by wolves? 8)

zoomkat:
In some cultures "Sir" is a salutation of respect. You raised in a cave by wolves? 8)

HeHe :smiley: , Its just that friends dont call each other as 'Sir'.

There is quite a lot wrong with your coding in general...please do not take this offensively.

The for loop makes no sense.

for(x=0;x>=100;x++)

x is not equal to or over 100 to begin with, so the loop will not even run.

I think you may heave meant:

for(x=0;x<=100;x++)

As far as the rest...I have no idea about the module, the way it works, the communication protocol to the module etc. so could not comment.

You have cross posted this...

Anyway...my reply from the other thread:

There is quite a lot wrong with your coding in general...please do not take this offensively.

The for loop makes no sense.

for(x=0;x>=100;x++)

x is not equal to or over 100 to begin with, so the loop will not even run.

I think you may heave meant:

for(x=0;x<=100;x++)

As far as the rest...I have no idea about the module, the way it works, the communication protocol to the module etc. so could not comment.

Looking at the data sheet:

datahseet

You have the basic idea.

Right, first things first.

Go and read the instructions, then go back and modify your post to mark up the code as such so we can examine it comfortably and reliably.

Johnny010's correction will get you going for a start, but for various practical reasons, it needs to be modularised. You can for a start, incorporate the repetitive parts into a function, so that

    Serial.write(0x03);
    Serial.write(0x02);

is incorporated with the Serial.print command and that new function is then called repetitively with the corresponding argument. If that was the only thing your code ever needed to do, it could be further condensed into an array with a "for" loop indexing that.

[quote
You have cross posted this
[/quote]

Johnny010:
You have cross posted this...

Sorry sir for my cross posted because this is my first post :slight_smile:

Johnny010:
Looking at the data sheet:

datahseet

You have the basic idea.

Johnny010:
Looking at the data sheet:

datahseet

You have the basic idea.

thank a lot sir, but on the datasheet on this module, didn't give the exact current needed. only the voltage which is from 6v-7.5v

Johnny010:
You have cross posted this...

Anyway...my reply from the other thread:

There is quite a lot wrong with your coding in general...please do not take this offensively.

The for loop makes no sense.

for(x=0;x>=100;x++)

x is not equal to or over 100 to begin with, so the loop will not even run.

I think you may heave meant:

for(x=0;x<=100;x++)

As far as the rest...I have no idea about the module, the way it works, the communication protocol to the module etc. so could not comment.

Thank you sir
yes, the value of x will not run in this loop. this is only a basic code made by the company.

I made some simple code from flex sensor to servo motor using 16 channel servo driver. No wireless transmission attached.

here is my simple code:

#include<avr/io.h>

int flex = 0;
int val;
int pos;
void setup()
{
  Serial.begin(9600);
  pinMode(flex, INPUT);
  //myservo.attach(9);
}
void loop()
{
  val = analogRead(flex);
  //Serial.println(val);

  pos = map(val, 0, 1023, 100, 2200);
  //Serial.println(pos);
  String vals = String(pos, DEC);
  String id = "0,";
  String del = ",100";
  String deg = String(id + vals + del);
  //Serial.println(deg);
  Serial.write(0x02);
  Serial.print(deg);
  Serial.write(0x03);
}

@reynan, do not cross-post. Threads merged.