Raspberry Pi Asked by Milow on January 21, 2021
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.
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 :
#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!")
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)
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.
Answered by www.linuxcircle.com on January 21, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP