Confused how to set up and control ESC motor on Arduino - Page 1
Forum section: electronics / beginners

author: Seaofdep
author_rank: Regular Contributor
timestamp: August 13, 2017, 08:08:14 pm
content: (Arduino Duemilanove/v5 sensor board)Hi, can you please help me with some Advice/Tips on Esc Brushless motor. A while back I found a pretty damaged Phantom v2 that I would like to rebuild when I acquire more experiemce. Meanwhile I would like to check(play)for functionality of the Esc motors(p1:1khz, p2:gnd, p3:motor control from flight controller 400hz p4:motor control from flight controller 400hz/..37%duty cycle=off, 47%=idle, 71%=full throttle ). Researching has left me confused and not sure where to begin and would appreciate any advice sent my way.Thank you

author: Seaofdep
author_rank: Regular Contributor
timestamp: August 13, 2017, 08:49:15 pm
content: Sent from my iPhone using Tapatalk

author: brucehoult
author_rank: Super Contributor
timestamp: August 13, 2017, 10:19:03 pm
content: I never drove an ESC from An Arduino but I've done a few servos. It should be just the same.On the ones I've tried they don't actually care about the duty cycle or exact frequency of the pulses, but about the length of the hi pulse: 1000 us = 50% or centralized. And based on your figures 37% -> 740 us equals off, 71% -> 1420 us -> full throttle.Or, maybe as it says 400 Hz not 500 Hz then it's 592 us for off and 1136 us for full throttle. Would not take much experimentation to find out. It won't break.

author: Seaofdep
author_rank: Regular Contributor
timestamp: August 13, 2017, 10:31:24 pm
content: Quote from: brucehoult on August 13, 2017, 10:19:03 pmThere is 100s of different ways and what pins to connect too on arduino. Tried a few but most I got out of it was a hiccup affect on the motor . Im not quite sure why the esc has the 4th pin when 3&4 seem to connect to each other on the main board ,Any chance you have a link of a guide I can follow. Thank you for helping outSent from my iPhone using Tapatalk

author: retrolefty
author_rank: Super Contributor
timestamp: August 13, 2017, 10:45:02 pm
content: Most ESCs emulate a standard R/C servo and there are several arduino servo libraries available that will drive ESCs.Note that for safety reasons most ESCs require an initial signal sequence provided before they will turn on their output, one example might be to apply 100% servo signal (2 msec) for > 2 seconds, wait for ESC tone signal and then apply 0% signal (1 msec) and then ESC will follow any servo signal value from 0% to 100%. Without first performing this 'arming' procedure the ESC will appear to be dead.

author: Seaofdep
author_rank: Regular Contributor
timestamp: August 13, 2017, 11:09:02 pm
content: Quote from: retrolefty on August 13, 2017, 10:45:02 pmI got them to the on directly threw the motor but more of a twitch than anything else. 3/4 seem to be in good condition the 4th Esc was cracked off at the v gnd and control pins. Would it help and if possible connecting the 3 motors to the main board and connecting Arduino to the main? My knowledge on said subject is limited if none. But would be a nice project to rebuild/repurpose this sidewalk salvage..I will post pictures of the rest of the phamtomSent from my iPhone using Tapatalk

author: brucehoult
author_rank: Super Contributor
timestamp: August 13, 2017, 11:13:56 pm
content: Quote from: Seaofdep on August 13, 2017, 10:31:24 pmAhhh .. are you not actually writing the program for the Arduino? You found the Arduino along with the rest of the thing?In that case, there is no way at all to know what pins are correct. Whoever programmed it could have done anything at all.

author: Seaofdep
author_rank: Regular Contributor
timestamp: August 13, 2017, 11:14:33 pm
content: Sent from my iPhone using Tapatalk

author: Seaofdep
author_rank: Regular Contributor
timestamp: August 13, 2017, 11:27:09 pm
content: Quote from: brucehoult on August 13, 2017, 11:13:56 pmYea a side walk find . I have no experience at all with motors or drones at all. You really think there is no way at all, I'd like to think that any enthusiast that does their own programming wouldn't trash something of this quality allbbecause one damaged esc thusly I am thinking that the functionality is that of factory settings . But on the other hand I don't no much at all about this subject lolSent from my iPhone using Tapatalk

author: tpowell1830
author_rank: Frequent Contributor
timestamp: August 14, 2017, 12:13:20 am
content: Great Scot! just did a 2 part video.

author: Seaofdep
author_rank: Regular Contributor
timestamp: August 14, 2017, 12:41:38 am
content: Quote from: tpowell1830 on August 14, 2017, 12:13:20 amNow I understand why the motor appeared stuck and only had lla hiccup like movement, this project might be a bit advanced for where I'm at, but you only fail if you don't try .. I can't wait till I get a full on oscilloscope , have a dso138 that I won here which I have fun with. Thanks a lot. The amount of information and the way you explain is  I'll def be subscribingOne question , every video and article I read uses three pin esc. And the Esc I have has 4 ( although research has led me to pin 3&4 connecting with one another at the main boare)Sent from my iPhone using Tapatalk

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 14, 2017, 03:10:07 am
content: Looking at your pictures I would bet that your ESCs are actually a fairly standard configuration. Three control wires. There just isn't any real justification for Phantom or any of the other drone makers to not buy a standard design. In your case one of the three standard wires is doubled for some reason. The connector back to the main board is a four pin connector with only 3 pins populated. My guess would be that the darker brown wire is ground, the adjacent wire is the PWM signal and the next one is + 5V. You could do a little verification of this if you have retained the original battery leads for the Phantom. Just measure continuity between the dark brown wire (when everything is plugged together) and the battery negative.With this information and reading the Arduino documentation for the SERVO you should be able to get electrically hooked up. Note that the motors might turn if powered just by the Arduino 5V, but they really need their own high current supply. This is supplied by the wire on the corner opposite the signal connection. Since they didn't use a standard color code you will have to find continuity to the ground to see which one is positive and which is negative.As others have said before, most ESCs have a safety feature. They won't turn on until a sequence of throttle commands is sent. This helps prevent an unexpected spinning propeller when the battery is plugged in. This feature has reduced but not eliminated the parade of gory pictures of people with hands, arms, stomachs or faces chewed up by a poor quality circular saw.A typical sequence is to require a zero throttle position, followed by full throttle, followed by a return to zero throttle before arming and making the motor operate. Usually once armed a few cycles of a sine wave is sent to the motor to make it beep warning you that it is armed and dangerous.Different makers use different interpretations of full throttle. Some use max pulse width, others use minimum. This combined with variations in the arming sequence mean that trial and error to find the right sequence will take a while. Again, google for ESCs and read the manuals for a few to get some ideas for sequences to try. You might try googling phrases like "Phantom motor arming" and the like to find specific directions, although on drones this is likely done in the control software and considered proprietary.

author: Seaofdep
author_rank: Regular Contributor
timestamp: August 14, 2017, 11:36:20 am
content: Quote from: CatalinaWOW on August 14, 2017, 03:10:07 am@Catalina....WOW thank you I appreciate you taking the time and writing out such a detailed and informative reply..Update : After utilizing everyone's advice and after many trials and errors, i started to make some progress. First after fooling with pin sequences and sketches, managed getting the binding red leds to start followed by the start up tone and green white leds. Lastly each nanometer after nano... of a turn on a potentiometer the motor began to throttle. I'd say max was just above idle and minimum speed was half below idle .I'll post pics later todaySent from my iPhone using Tapatalk