Hi all guys,
I have a very strange problem.
I bought an ESC to control the motor of my electric model, and I connected evertything to my Autopilot, but I realized the ESC makes strange noises and cannot understand which is the source.
So...I thought maybe something wrong with my autopilot, with the code itself.... but connecting the same output to a servo works greatly....even with and oscilloscope I can see perfect squared waves from my autopilot...
So I realized a simple program with arduino to try to control the controller
Here is the code...it basically reads an input in milliseconds from the input keyboard and forward it to the control, with a normal servo works perfectly....to tbe sure to work it displays back the input vie serial interface.
[quote]
#include <Servo.h>
#include <stdlib.h>
Servo myservo; // create servo object to control a servo
char servoPos[5];
long pos;
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
Serial.begin(19200);
Serial.flush();
pos = 1500;
Serial.println("Ok...started...");
Serial.print("Start position: ");
Serial.println(pos);
}
void loop()
{
int i = 0;
if(Serial.available()){
while(Serial.available()){
servoPos[i++] = Serial.read();
delay(1);
}
pos = atoi(servoPos);
Serial.print("You typed: ");
Serial.println(pos);
}
for(int i = 0; i < 5; i++){
servoPos[i] = NULL;
}
myservo.writeMicroseconds(pos); // sets the servo position according to the scaled value
delay(20); // waits for the servo to get there
}
[\quote]
Here some picture of the connection
the esc controller is simply connected like a servo to an arduino output and..again..it works greatly with all servos..(sending as input values from 500 to 2400)
BUT connecting it to my ESC controller and connecting the LiPo battery makes very strange noises...so strange I cannot explain that! for this reason I registered the sound and attached it to this email....since I cannot codify them...I would ask you for your help!!!
Further info...I dont know who produced the ESC controller, it was a combo kit, alread mounted and there is nothing on it, furthermore I m able to turn a servo but not to let the motor running!!!!!!!!
Thank you all in advance!!!
Dave
Replies