Thuswi
Posts: 3
Joined: Sun May 09, 2021 6:41 pm

Raspberry P1 3B Doesn't Drive The Brushless Motor

Sun May 09, 2021 6:58 pm

Hello All,

I'm new to Raspberry Pi. Therefore, my question/support might be mediocre.

I'm currently, trying to control a brushless motor using a Raspberry Pi 3B.

Basically, I want to control the speed of a propeller and stop the motor running when I wants to.

At the moment, on few occasions I managed to get the propeller running, but most of the times, I only here beeps coming from the motor; The ESC is calibrated as well.

Can someone kindly, suggest or explain what is happening with my code and/or equipment setup etc., so that I could get my motor running as long as I want. Please feel free to amend the code as well.

Below is the list of equipment I use here,
* Raspberry Pi 3B v1.2
* Brushless motor - https://hobbyking.com/en_us/propdrive-v ... motor.html
* ESC (this is calibrated) - https://hobbyking.com/en_us/blheli-s-30a.html


Code:
import RPi.GPIO as GPIO
from time import sleep

GPIO.setmode (GPIO.BOARD)
GPIO.setwarnings (False)

GPIO.setup (11,GPIO.output)

MOT1 = GPIO.PWM (11,100)
sleep (2)

print ('MOT1.start - 3% Duty Cycle of the 100hz...')
MOT1.start(3)
sleep(2)

print ('Duty Cycle up change...')
MOT1.ChangeDutyCycle(50)
sleep (10)

MOT.stop
GPIO.cleanup()
sleep (2)

User avatar
Gavinmc42
Posts: 5636
Joined: Wed Aug 28, 2013 3:31 am

Re: Raspberry P1 3B Doesn't Drive The Brushless Motor

Mon May 10, 2021 2:18 am

I think you need to use servo not PWM.
http://abyz.me.uk/rpi/pigpio/examples.html

While you can use PWM if you get something wrong it's harder to figure out.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Thuswi
Posts: 3
Joined: Sun May 09, 2021 6:41 pm

Re: Raspberry P1 3B Doesn't Drive The Brushless Motor

Mon May 10, 2021 9:04 am

Its going to be a difficult task then, as I need to control the BL Motors from a Raspberry Pi.

User avatar
joan
Posts: 15616
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Raspberry P1 3B Doesn't Drive The Brushless Motor

Mon May 10, 2021 9:20 am

pigpio works on a Raspberry Pi. In fact it only works on a Raspberry Pi.

pigpio only uses GPIO numbers. Pin 11 is GPIO 17.

As an example try.

sudo pigpiod

pigs s 17 1500

pigs s 17 1000

pigs s 17 2000

Thuswi
Posts: 3
Joined: Sun May 09, 2021 6:41 pm

Re: Raspberry P1 3B Doesn't Drive The Brushless Motor

Sat May 15, 2021 12:43 pm

Hello, I have tried the entries on a terminal with all the kit connected, but nothing happened.

boyoh
Posts: 1618
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Raspberry P1 3B Doesn't Drive The Brushless Motor

Thu May 20, 2021 9:31 am

If you are trying to run the motor directly from the Raspberry Pi power supply this might be your problem

The speed control pulsing signals impedance might be to high .to run the motor. Suggest you use a separate power supply as a buffer stage , Then use the speed control signal from the Pi to switch a low impedance buffer stage

to run the motor .( IMPEDANCE = RESISTANCE )

Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

Return to “Beginners”