Offline
Newbie
Karma: 0
Posts: 6
|
 |
« on: May 16, 2011, 03:29:35 am » |
Hey All,
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)
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #1 on: May 16, 2011, 03:31:43 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #2 on: May 16, 2011, 04:35:07 am » |
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. If this is an R/C ESC, you should be sending PPM, not PWM. Try using the Servo library.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #3 on: May 16, 2011, 10:30:34 am » |
Hey AWOL, 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 
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
Full Member
Karma: 0
Posts: 134
|
 |
« Reply #4 on: May 16, 2011, 10:37:56 am » |
This is how did it, I found that out by reading through this thread. You could probably swap in the standard servo library as well.
|
|
|
|
|
Logged
|
|
|
|
|
0
Online
Tesla Member
Karma: 50
Posts: 6549
Arduino rocks
|
 |
« Reply #5 on: May 16, 2011, 11:46:33 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #6 on: May 17, 2011, 04:34:50 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #7 on: May 17, 2011, 04:39:07 am » |
Do you know how to arm it using the transmitter? Have you got any material on this ESC?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #8 on: May 17, 2011, 04:54:27 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #9 on: May 17, 2011, 05:02:43 am » |
of the arduino using pulse in i get that it is High for 1479 and Have you tried: myServo.writeMicroseconds (1479); ?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #10 on: May 17, 2011, 05:14:06 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #11 on: May 17, 2011, 05:15:51 am » |
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
0
Online
Tesla Member
Karma: 50
Posts: 6549
Arduino rocks
|
 |
« Reply #12 on: May 17, 2011, 12:07:39 pm » |
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=""; } }
|
|
|
|
|
Logged
|
|
|
|
|
|