Control a motor using the pwm output

Hi! I wanted to see if I could control a brushless motor via the pwm output on the board, I was just wondering if I could get some help of how to go about it.
As far as I know, for a brushless dc motor, the paramaters are usually:
50Hz Frequency.
1ms = zero throttle
2ms= full throttle

I tried to modify the code from the PWM example but when I hooked up the motor all that I got was a fast beeping sound.

I have a turnigy9x controller with pwm output, and when I use it with a brushless motor i usually have to put the throttle on the zero position and then lower it down to the max position for a few seconds to get control of it. So do I have to do something like that? should I send a timed 1ms pwm followed by a 2ms to gain control of the motor? Anyone that was able to set up a motor with the pwm output if you could help me I really appreciate it.
Thank you!

1 Like

It should be enough to send 1000us or less to make the ESC arm.

1 Like

hi! I was able to make it work! I did a pwm pulse of 1000ms for a few seconds (than a music tone ringed on the motor) and afterwards I just tested the speed setting the values of the motor to1.1ms and 1.25 ms. Here is the code to anybody that may want to try it out:

import sys
import time

import navio.pwm
import navio.util

navio.util.check_apm()

PWM_OUTPUT = 2
SERVO_MIN = 1.250 #ms
SERVO_MAX = 1.750 #ms
servo_set=1
servo_set2=1.1
pwm = navio.pwm.PWM(PWM_OUTPUT)
pwm.set_period(50)
pwm.set_duty_cycle(servo_set)
time.sleep(2)
while (True):
    pwm.set_duty_cycle(servo_set2)
    pwm.set_duty_cycle(SERVO_MIN)
    time.sleep(1)
1 Like

Hello
Well, I’m really new to these stuff and i have a basic question (or let’s say a stupid one), In which language you are programming? and there is another question on weather we have a default set for motors on the Navio+ ? Please answer

What are PWM parameters for RC switch (On / off state)?

below?

The PWM frequency (edge up to edge up) is 20ms

PWM duty-cycle ON - 2ms
PWM duty-cycle OFF - 1ms

Frankly, I’ve tested Navio2 with these and RC switch does not work

Please advice

Do you mean the RC switch that is used on Pixhawks? As a matter of fact Navio-2 doesn’t need those.

I do have flight Camera ECO FlyCamOneV2 - this is very old model 720x480 resolution which is pretty poor these days) but is has RC control feature.

When I connect to reciver I can start recording or if in picture mode - trigger taking picture.

I connect it to RC transmitter - switch channel - On/Off

I’ve been trying to test it in NAVIO2 using python code - with no sucess.