Author Topic: Arduino for controlling brushless motor ?  (Read 5027 times)

0 Members and 1 Guest are viewing this topic.

Offline 3Good5UTopic starter

  • Newbie
  • Posts: 5
Arduino for controlling brushless motor ?
« on: February 01, 2015, 04:06:47 pm »
Would an Arduino be good/fast enough to generate phases for a brushless motor ? (Without a brushless controller) And also, I'm in doubt if I should buy a Raspberry PI or an Arduino. Arduino seems more suitable for this stuff.
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 951
  • Country: pt
    • My AVR tutorials
Re: Arduino for controlling brushless motor ?
« Reply #1 on: February 01, 2015, 04:40:31 pm »
Probably not using stock Arduino code, has you will need to play around with the timers, but yes an  ATmega has more than enought grunt, almost all cheap 30A ESC's use an Atmega8 running the show, albeit all the code being done in assembly, there is lots of firmware for those, to allow them to speak i2c instead of the silly PPM RC when using them in quad's and other multi-rotor flying machines.

There is also AfroTech mods ESC that you can find all the information, source, schematic, even gerbers.
 

Offline 3Good5UTopic starter

  • Newbie
  • Posts: 5
Re: Arduino for controlling brushless motor ?
« Reply #2 on: February 01, 2015, 04:53:01 pm »
Probably not using stock Arduino code, has you will need to play around with the timers, but yes an  ATmega has more than enought grunt, almost all cheap 30A ESC's use an Atmega8 running the show, albeit all the code being done in assembly, there is lots of firmware for those, to allow them to speak i2c instead of the silly PPM RC when using them in quad's and other multi-rotor flying machines.

There is also AfroTech mods ESC that you can find all the information, source, schematic, even gerbers.

What would you recommend instead of "stock Arduino code" then ?
And also, I assume Arduino can't handle high currents, which may occur, should I use a transistor or something for that ? (How should I create a sine though, or is it fine just to use a square wave ?)
 

Offline Puffie40

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ca
  • Irregular Logic
Re: Arduino for controlling brushless motor ?
« Reply #3 on: February 01, 2015, 08:48:52 pm »
Look up H-bridge ICs.  They will allow PWM control of a DC motor.
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Arduino for controlling brushless motor ?
« Reply #4 on: February 01, 2015, 08:55:15 pm »
What would you recommend instead of "stock Arduino code" then ?
Assembler, or "machine code".  Arduino/Wiring is a high-level, compiled code noted for its ease of use. But the downside is size/speed efficiency. It is quite possible that Arduino high-level code may not be fast enough for your design.


Quote
And also, I assume Arduino can't handle high currents, which may occur, should I use a transistor or something for that ? (How should I create a sine though, or is it fine just to use a square wave ?)
No microcontroller can handle anything but the most trivial loads. Most certainly you will need external power semiconductors to do the actual power switching. Exactly what kind of devices, and what the circuit might look like depend on the details of your motor which you have not disclosed here.
 

Offline 3Good5UTopic starter

  • Newbie
  • Posts: 5
Re: Arduino for controlling brushless motor ?
« Reply #5 on: February 01, 2015, 09:31:38 pm »
What would you recommend instead of "stock Arduino code" then ?
Assembler, or "machine code".  Arduino/Wiring is a high-level, compiled code noted for its ease of use. But the downside is size/speed efficiency. It is quite possible that Arduino high-level code may not be fast enough for your design.


Quote
And also, I assume Arduino can't handle high currents, which may occur, should I use a transistor or something for that ? (How should I create a sine though, or is it fine just to use a square wave ?)
No microcontroller can handle anything but the most trivial loads. Most certainly you will need external power semiconductors to do the actual power switching. Exactly what kind of devices, and what the circuit might look like depend on the details of your motor which you have not disclosed here.

Would the compiled program be fast enough for say a maximum of 50Hz ? (With transistors, can I create a sine somehow though, or is it good enough to use a square wave ?)
I'm fine with assembler, though it's easier to program in C and find bugs.
Would inline assembly speed it up ? That'd still need compiling I guess...
« Last Edit: February 01, 2015, 09:34:31 pm by 3Good5U »
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Arduino for controlling brushless motor ?
« Reply #6 on: February 01, 2015, 09:36:08 pm »
Would the compiled program be fast enough for say a maximum of 50Hz ?
Maybe. Much depends on other factors not known here.
50Hz sounds way too slow for a motor.

Quote
(With transistors, can I create a sine somehow though, or is it good enough to use a square wave ?)
Maybe. Much depends on other factors not known here.
Most motors don't care about the shape of the power cycle.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6190
  • Country: us
Re: Arduino for controlling brushless motor ?
« Reply #7 on: February 01, 2015, 10:31:28 pm »
Controlling a brushless motor is not that easy because the passes need to match the angle of the motor. You will have better chance using a dedicated ESC, either one that accepts analog pulse width signal or a one with digital interface such as i2c.
 

Offline FreddyVictor

  • Regular Contributor
  • *
  • Posts: 164
  • Country: gb
Re: Arduino for controlling brushless motor ?
« Reply #8 on: February 02, 2015, 10:49:16 am »
there's some code in existence which will run on ATmega328 - written in c
can't see a .ino or .pde file so will need tweaking to import it into arduino ide (!)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf