0

So i am building a RC car that i can control with a atmel atmega32A.

I have a brushless motor + ESC, but instead of a remote i am controlling the ESC with the microcontroller. I just found out that controlling the ESC is as easy as controlling a servo. (50Hz and pulse from 1ms (off) and 2ms(full throttle).

But then how can you drive backwards?

I know this maybe not the best forum to ask. But hey, it is still software ;)

Vinka
  • 11
  • 4
  • 2
    It will depend on the motor controller and the wiring itself. Do you have an H-bridge or similar setup that lets you reverse the polarity of the leads where they contact the motor taps? In any setup, the microcontroller sends logic level (ie: 5V or 3.3V low current) signals to a motor controller, which pumps out a higher power signal (ie: 12V or 5V at higher currents) and actually drives the motor. This depends almost entirely on the type of motor controller. If you can provider the model number or a link to the ESC's data sheet, I could help more. – Cloud Jul 29 '14 at 14:17
  • The motor controller (ESC) will be something like this: http://www.hobbyking.com/hobbyking/store/__22404__Turnigy_100A_Water_Cooled_ESC.html I have not ordered yet, this ill do when i have my uC software and other hardware parts ready. – Vinka Jul 30 '14 at 06:17
  • Forward limit (50%, 60%, 70%, 80%, 90%, 100%), Reverse limit (50%, 60%, 70%, 80%, 90%, 100%), Rotation reverse (Normal, Reverse), It looks like the controller is capable. Here's the datasheet: http://www.hobbyking.com/hobbyking/store/uploads/Turnigy%20Aquastar%20ESC%20Manuals.pdf – Cloud Jul 30 '14 at 12:34
  • I have 2 questions then: In the datasheet they are speaking of 8KHz frequency, i hope this is not what i have to provide as PWM frequency right? I can just use 50Hz like on a servo? And knowing it can be reversed is one thing, but how does the signal look going into reverse? I mean when 1ms till 2ms is forward, then how do you go backwards? – Vinka Jul 30 '14 at 13:38
  • I haven't gone into the data sheet much, but it looks like 8kHz is the **output** frequency of the motor controller. Are you familiar with what a duty cycle is? The output of the controller is a PWM (http://en.wikipedia.org/wiki/Pulse-width_modulation) signal with varying duty cycle (http://en.wikipedia.org/wiki/Duty_cycle) to control the average power delivered to the motor. Reversing the signal is still the exact same signal, except the two terminals of the motor (ie: V+ and GND) are reversed (it uses some sort of switch to re-route the wiring internally). – Cloud Jul 30 '14 at 15:40
  • I am aware of duty cycle and PWM. So going forward i have a frequency of 50Hz (20ms) and a duty cylce of 5%(1ms) till 10%(2ms). So reversing this means a duty cycle of 90%(18ms) and 95%(19ms)?? I think im going to buy myself the cheapest ESC + motor there is and just give this a try before destroying a ESC costing around €35,- ;) – Vinka Jul 31 '14 at 06:07
  • Reversing doesn't mean inverting the duty cycle. If you want a simple motor to run in one direction, you can connect the positive terminal of the battery to terminal `A` on the motor, and the negative terminal of the battery to terminal `B` on the motor. If you swap these connections, the motor will run in reverse. Some motor controllers (ie: H-bridges) allow you to not only control the duty cycle and frequency of the power provided to a motor, but they actually let you reverse the **voltage** itself, which causes the motor to spin in the opposite direction. – Cloud Jul 31 '14 at 16:44
  • Also, look up the L293D chip (http://www.ti.com/lit/ds/symlink/l293d.pdf). I use it for motor control circuits. It consists of two half-bridge circuits. You can just toggle the input control pins to determine if the current is going through the motor in the "forward" or "reverse" direction. You can then modulate the signal going to the input control pins via PWM to control the average speed of the motor. What's better is the chip is only a couple bucks, so all you need is the chip, some wire, and a 5V LDO regulator and a power supply. I've used this chip to handle over 30 unique motor circuits – Cloud Jul 31 '14 at 16:48

0 Answers0