0
\$\begingroup\$

This question already has an answer here:

I just got the Turnigy Multistar 20 Amp Multi-rotor Brushless ESC 2-4S.

I have a motor and a battery hooked up to the ESC. On the three pin connector, I attached the brown ground wire to a ground pin, and yellow signal wire to a PWM-capable IO pin. I'm trying to figure out how to send motor signals to the ESC, with no luck. I know that I need to send PWM output through the yellow signal wire, but I don't know the frequency or high time of the PWM signal. Also, I've read that certain ESC's have an arming procedure, and I'm not sure how that works.

How do I control my ESC from a generic output pin hooked up to a microcontroller?

\$\endgroup\$

marked as duplicate by Vladimir Cravero, Daniel Grillo, Scott Seidman, Blup1980, Chetan Bhargava Aug 1 '14 at 0:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    \$\begingroup\$ You may want to build a pulse generator firmware driven by a potentiometer or something for testing/calibration, since these are designed with the idea that the user has transmitter sticks and trims to manipulate, sometimes in quiet complicated multi-step sequences. \$\endgroup\$ – Chris Stratton Jul 30 '14 at 22:02
  • \$\begingroup\$ I forgot to ask this, but what's the community opinion on self-answered questions? On Stack Overflow, they're technically encouraged but for some reason people tend to frown upon them. I just did this, and thought it would be really useful for other people. \$\endgroup\$ – Anubian Noob Jul 30 '14 at 22:19
  • \$\begingroup\$ It's not clear that there's much to this that hasn't been covered here several times before, so if it's a problem you had already resolved rather than an outstanding one needing assistance, I'm not such a fan for that reason. \$\endgroup\$ – Chris Stratton Jul 31 '14 at 1:02
  • \$\begingroup\$ Well that's the point of answering your own question, right? So you can help other people that have the same issues as you? \$\endgroup\$ – Anubian Noob Jul 31 '14 at 1:08
  • \$\begingroup\$ The problem is that what makes your question unique from existing ones is largely irrelevant. The next person with a similar problem may have a different brand esc and not recognize yours as relevant any more than you recognized the existing coverage of pwm-driven RC gadgets as relevant. \$\endgroup\$ – Chris Stratton Jul 31 '14 at 1:24
0
\$\begingroup\$

The PWM output on the signal wire usually uses a 50hz signal with 1-2ms high time. The arming procedure consists of a signal of the lowest power for a short period of time, followed by a beep from the ESC.

Using Propeller GCC and the simpletools library that comes with it, it would looks something like this:

// Arming:
pwm_start(20000);
pwm_set(4, 0, 1000);
waitcnt(CNT + CLKFREQ); // Wait 1 second.

// Spin at low speed.
pwm_start(20000);
pwm_set(4, 0, 1100);
waitcnt(CNT + CLKFREQ);

// Spin at high speed.
pwm_start(20000);
pwm_set(4, 0, 2000);
waitcnt(CNT + CLKFREQ);

If you want to make it a little easier, you can write a utility method:

// Speed should be between 0 and 1.
void motorSpin(double speed)
{
    pwm_set(4, 0, 1100 + 900*speed);
}

Good luck!

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.