Officially i am new to this forum, though i have been looking through this, and the old forum for quite some time lol.
However I have recently run into a problem with trying to control an ESC with my uno that i have been unable to solve even after looking through all the forums. I mean I have been playing with this for quite some time trying to replicate the signal that should be sent to the ESC with the Arduino. I know what PWM values are sent from the original receiver, however I dont seem to be able to use this to make the motor work.
Is there some form of start up siginal that i have to send to it first, or is my understanding of how to produce a PWM for it fundamentally wrong? Is there anyone who could take the time to walk through this with me, or supply me with some well documented source code? It would really be appreciated.
The ESC is a SP-03058 from HSP if that helps (it didnt help me as i couldnt find any info on it lol)
Oh and i realise i forgot to say that as a side note the reason i put this in robotics and not hacking was because i plan on combining this(and motor) with an ultrasonic sensor and GPS to create a small object avoiding robot, which will navigate to a given co-ordinate.
Thanks for that. Your right it is an rc one and Yea I read a few things about ppm. But I don't really understand what it is. And how do I set it up so that the servo library controls the esc? I'm sorry I'm still a little stumped. Could you tell me a bit more about it. Or maybe give me an example. Thanks again
Hey guys so i think i have an understanding of how the ESC works now, thanks heaps for that. It appears now that i still need to get the arming value. Can you give me some idea about how to find this value either online or through code? thanks guys
Yeah when I turn on the ESC while its plugged in to the transmitter it arms it. and if i read this value of the arduino using pulse in i get that it is High for 1479 and Low for 18131. But i dont know how to replicate this properly. thanks
hahaha oh wow thanks so much man i didnt know that command existed. Again thanks so much. It was great cause i wasnt expecting it to work and then all of a sudden it ran half way across the room, perhapes i should slow it down a little lol. oh well i am incredibly happy thank you.
Below is some simple servo test code you can use with the serial monitor that should allow you to test your ESC.
// zoomkat 10-4-10 serial servo test
// type servo position 0 to 180 in serial monitor
// for writeMicroseconds, use a value like 1500
// for IDE 0019 and later
// Powering a servo from the arduino usually DOES NOT WORK.
String readString;
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
Serial.begin(9600);
myservo.writeMicroseconds(2000); //set initial servo position if desired
myservo.attach(7); //the pin for the servo control
Serial.println("servo-test-21"); // so I can keep track of what is loaded
}
void loop() {
while (Serial.available()) {
delay(1);
if (Serial.available() >0) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the string readString
}
}
if (readString.length() >0) {
Serial.println(readString); //so you can see the captured string
int n;
char carray[6]; //converting string to number
readString.toCharArray(carray, sizeof(carray));
n = atoi(carray);
myservo.writeMicroseconds(n); // for microseconds
//myservo.write(n); //for degees 0-180
readString="";
}
}