RC India

RC Models => Self-designed, DIY and College Projects => Topic started by: mohsinbashir64 on May 14, 2013, 08:30:46 PM

Title: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: mohsinbashir64 on May 14, 2013, 08:30:46 PM
Hello Friends,

I am a newbie in RC Hobby, currently working on my final year degree project, where i am required to design a RC Heli, and control it with a single frequency.

I am using an ATmega320 mcu, with 6 PWM Channels, out of which i require 4 - 2 for controlling 2 servo motors, 2 for main, tail motors.

For the Hardware part, I brought a Walkera 250 Size heli, Provided by a heavenly friend, alongwith a Walkera CP ESC.
Pertinently, the heli uses 2 brushed motors- One main and one tail.

I was searching on the type of signal required by the ESC, and learn that these require 1ms-2ms pulse width, repeating every 20 ms. meaning 1ms = Zero Throttle, and 2ms = full Throttle.

To test this, i designed a circuit with a 555, providing 0ms to 2.5ms signal at 20ms repitition.

to my surprise, i find the following results:

1) at 1ms pulse width, the motor is not at zero speed, but rotating at a fair enough speed.
2) at 2 ms pulse width, the motor is at a good speed, but i am sure its not full throttle, because when i connect this motor directly to the battery, the speed is quite higher.

Please, could anyone of you help me with the signal required by the esc for proper operation? I shall be grateful for the favour.

Warm regards,
Mohsin Bashir
Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: santhosh-r on May 14, 2013, 08:45:17 PM
For some extended signal bandwidth the signal high time is from 0.5mS to 2.5mS. It varies with different makes.
Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: mohsinbashir64 on May 14, 2013, 09:06:19 PM
Thanks for replying, bro.
I modified the ckt to give pulse width upto 4ms, but even then i didnt get the speed as high as when connected directly.
as for zero throttle, when the pulse width is around 0.5ms, the motors only vibrate, implying threshold of rotation, beyond that they rotate.
I assume 0.5ms is the zero throttle, but what about the maximum throttle? ???
Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: santhosh-r on May 14, 2013, 09:52:21 PM
The ESC may have internal current limiting using a low resistance in series like 1 ohm or 0.5 ohm.. may be thats why you cannot get full throttle....

But in RC pulse width range is only from 0.5mS to 2.5mS and not more than 2.5mS.
Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: mohsinbashir64 on May 14, 2013, 10:12:30 PM
So should I assume that the heli will take off just fine with 2.5ms?
actually i have to program the ATmega for the same :)

I thought the esc might be working on different PWM frequency, or i might be grossly missing out somewhere  :(

Regards,

Mohsin
Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: santhosh-r on May 15, 2013, 08:23:32 AM
All normal RC ESC work in pulse width of 0.5mS to 2.5mS @ 50Hz...but high speed ESC with Simon K flashed for Multirotors works @ 400Hz...

But your ESC operates @ 50Hz ....
Program the ATmega...
ALL TH BEST.
Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: girishsarwal on May 15, 2013, 12:22:58 PM
Mohsin,
the ESC input signal for various ESCs can range from anywhere between 0.5ms to 2.5ms. It depends on the make. Your best best is to either read the data sheet for the ESC, beyond the acceptable range the motors will only twitch, like you correctly mentioned. Also you need to take slight care of the inter signal time..close to about 300us should help.

555 RC based oscillators might not give you a good resolution. Program a microcontroller for better results. Here's something that can give you a head start http://code.google.com/gt-jtx. Check out how to setup an atmega in CTC mode and use the hardware interrupt to drive down a signal on the OC1A pin repeating 20 times a second. The concept is simple, set the timer to required ms, enable the interrupt. When the interrupt happens, mask the interrupts, set the timer to the inter signal time and re-enable the interrupt. Repeat.

GS

Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: mohsinbashir64 on May 15, 2013, 12:35:31 PM
Quote from: girishsarwal on May 15, 2013, 12:22:58 PM
Mohsin,
the ESC input signal for various ESCs can range from anywhere between 0.5ms to 2.5ms. It depends on the make. Your best best is to either read the data sheet for the ESC, beyond the acceptable range the motors will only twitch, like you correctly mentioned. Also you need to take slight care of the inter signal time..close to about 300us should help.

555 RC based oscillators might not give you a good resolution. Program a microcontroller for better results. Here's something that can give you a head start http://code.google.com/gt-jtx. Check out how to setup an atmega in CTC mode and use the hardware interrupt to drive down a signal on the OC1A pin repeating 20 times a second. The concept is simple, set the timer to required ms, enable the interrupt. When the interrupt happens, mask the interrupts, set the timer to the inter signal time and re-enable the interrupt. Repeat.

GS




Thankyou for the reply, Girish, thats exactly what i have been looking for-the datasheet for the ESC, which, till now i am unable to find. I dont understand 300us inter signal time :( was it not 20ms?
So far as i could infer, i thought i would just put a value in the timer registers (TCNT) to set a particular frequency and OCR to set a particular duty cycle. Will that work? I am planning to use phase correct mode, but so far no success with finding  the correct duty cycle :p

warm regards,

Mohsin
Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: girishsarwal on May 15, 2013, 01:22:06 PM
Here, I drew up a small diagram for your understanding. (annotated a screenshot)

If you were making the ESC, a PWM generator would've made sense. You're instead trying to control an ESC by giving an input, you only need to create the right signal. What the ESC takes as input is essentially a single channel value from the PPM the radio receives.

Receivers typically have Johnson counters that separate the ppm (demultiplex) the individual value of channels in the PPM frame to dedicated pins to be connected to ESCs/Servios

Bigger question, now if you're planning to use a TX/RX in the final setup, why do all this. If it's about learning, feel free to ask, will be glad to share

PS: When you program the uc, keep in mind the frequency and the prescaler
Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: mohsinbashir64 on May 15, 2013, 06:28:31 PM
Thanks a lot for the info, Girish :)
I am designing the TX myself, and using the normally available PLL FM RX board.
The TX i have designed works on the 88-108Mhz band, again pll, with a typical rf power output of 5W, covering a range of abt. 5Km in the line of sight.
As regards the control signal, i am transmitting DTMF tones over the link, and decoding them at the heli end. the decoded output is fed into an input port of ATmega328, and depending upon the value at the port, appropriate actuation is executed.

I am attaching herewith a proposed algorithm for control by the ATmega, for your kind reference. The image was long so i cropped it into 3 parts... 1 2 and 3.

Now i am a little confused. I am already separating the different control channels on the ATmega itself; since the 4 PWM channels work simultaneously and independantly, do i have to incorporarte the 300us inter signal spacing? as i guess that is required only for serial transmission, whilst the transmission  i am using is analogue in free space, and parallel at decoding end.

Warm regards,

Mohsin
Title: Re: PWM Signal for ESC (WALKERA MASTER CP Brushed ESC)
Post by: girishsarwal on June 21, 2013, 05:29:17 PM
Hi Mohsin
sorry for the late reply. the 330us signal spacing is only required for serial data. Since yorus is parallel data, that is not required. PM me your phone number/contact info, lets talk