1

I have connected an ESC (an electronic speed control) with a battery and a brushless motor. The Raspberry is connected to the ESC to control it. I know - when I turn on the program that is on the Raspberry - the battery and the ESC used to do some beeps, then I could turn the motor. I think I have a stupid problem, now with the same configuration the battery and the ESC doesn't want to beep anymore and I can't use the motor. Nothing happend. I'm suspecting GIPOs Pi to be "broken" and not send the signal but I already check them with a voltmeter and it's seems all GPIOs are OK.

Do you have any idea where the problem comes from ?

Here a drawing of the setup. I call Output the pin who send the right energy voltage to control the speed of the motor.

RPi, ESC and motor

Raspberry Pi b+
Ground on pin 9 (GND)
Output on pin 11 (GPIO17)
5V on pin 2

The ESC is control with PWM

Here the specs of the product : Details:
• Smooth and linear throttle control • Fast response to throttle input • Atmel MCU • Stalled motor protection • Throttle signal lose protection • Safe power-on (throttle lockout) • Support 480Hz+ high refresh rates (up to 499hz)

Specs ESC :
Constant Current: 20A
Input Voltage: 2-4 cells Lipo
BEC: None (OPTO)
PWM: 8 KHz
PCB Size: 41mm x 24mm
Weight: 25g

That's the link to download the datasheet.pdf (Beez2b send me that) : http://uplea.com/dl/5B9F54B59E9B9FB

Here the code I use :

main file :

#solenerotech 2013.09.06
from motor import motor


mymotor = motor('m1', 17, simulation=False)
#where 17 is  GPIO17 = pin 11

print('***Disconnect ESC power')
print('***then press ENTER')
res = raw_input()
mymotor.start()
mymotor.setW(100)

#NOTE:the angular motor speed W can vary from 0 (min) to 100 (max)
#the scaling to pwm is done inside motor class
print('***Connect ESC Power')
print('***Wait beep-beep')

print('***then press ENTER')
res = raw_input()
mymotor.setW(0)
print('***Wait N beep for battery cell')
print('***Wait beeeeeep for ready')
print('***then press ENTER')
res = raw_input()

cycling = True
try:
    while cycling:
        mymotor.increaseW()

finally:
    # shut down cleanly
    mymotor.stop()
    print ("well done!")

motor file :

class motor(object): """Manages the currect Angular rotation Implements the IO interface using the RPIO lib __init_(self, name, pin, kv=1000, RPMMin=1, RPMMax=100, debug=True, simulation=True):

def __init__(self, name, pin, kv=1000, WMin=0, WMax=100, debug=True, simulation=True):
    self.name = name
    self.powered = False
    self.simulation = simulation
    self.__pin = pin
    self.__kv = kv
    self.setWLimits(WMin, WMax)
    self.setDebug(debug)

    self.__W = self.__WMin
    self.__Wh = 10

    try:
        from RPIO import PWM
        self.__IO = PWM.Servo()
    except ImportError:
        self.simulation = True

def start(self):
    "Run the procedure to init the PWM"
    if not self.simulation:
        try:
            from RPIO import PWM
            self.__IO = PWM.Servo()
            self.powered = True
            #TODO Decide How to manage the WMax < 100
            #to keep anyhow the throttle range 0-100
        except ImportError:
            self.simulation = True
            self.powered = False

def stop(self):
    "Stop PWM signal"
    self.setW(0)
    if self.powered:
        self.__IO.stop_servo(self.__pin)
        self.powered = False

def increaseW(self, step=1):
    "increases W% for the motor"
    self.__W = self.__W + step
    self.setW(self.__W)

def setW(self, W):
    "Checks W% is between limits than sets it"

    PW = 0
    self.__W = W
    if self.__W < self.__WMin:
        self.__W = self.__WMin
    if self.__W > self.__WMax:
        self.__W = self.__WMax
    PW = (1000 + (self.__W) * 10)
    # Set servo to xxx us
    if self.powered:
        self.__IO.set_servo(self.__pin, PW)
  • Welcome to StackExchange, @Milow. Please explain what ESC is. We can't possibly help you without a schematic / drawing of your setup. There is a schematic button on the editor. – Transistor Jan 3 '16 at 17:10
  • sounds like a noise issue due to the switching of the ESC interfering with the Pi. Inadequate connections, decoupling etc... – Naib Jan 3 '16 at 17:15
  • You haven't given a part number and link for the ESC. We can't guess all this stuff. – Transistor Jan 3 '16 at 19:13
  • Sorry my english isn't fluent, what do you mean by "a part number" ? – Milow Jan 3 '16 at 19:17
  • The make, model, type number that you use when buying the part. It should be on the label on the ESC. – Transistor Jan 3 '16 at 19:24
0

You should not power the ESC through both battery and Pi's 5V pin 2, it may cause damage. Your BEC of the ESC may already be totally fried now. It happened to mine before.

Your motor battery is already powering the ESC's BEC, so you should never connect the ESC's red wire to anything, because double-powering will cause voltage confusion (amper overload, I don't know what the right term for it).

The white and ground cable are fine to be connected as per your diagram, but never connect the red one to any other power source.

  • I saw that not connecting the red wire on the raspberry has no effect on the ESC so I stop connecting it. Since the time I wrote this topic I finally arrived to make this whole system works. Thanks for your advice, I appreciate. – Milow Nov 16 '17 at 19:50
  • Milo, would you please write out what you did to make things work as an answer, and then accept this answer? This way you will help out others who have the same problem. – NomadMaker Jun 30 '18 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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