Arduino for controlling brushless motor ? - Page 1
Forum section: electronics / beginners

author: 3Good5U
author_rank: Newbie
timestamp: February 01, 2015, 04:06:47 pm
content: 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.

author: senso
author_rank: Frequent Contributor
timestamp: February 01, 2015, 04:40:31 pm
content: 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.

author: 3Good5U
author_rank: Newbie
timestamp: February 01, 2015, 04:53:01 pm
content: Quote from: senso on February 01, 2015, 04:40:31 pmWhat 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 ?)

author: Puffie40
author_rank: Regular Contributor
timestamp: February 01, 2015, 08:48:52 pm
content: Look up H-bridge ICs. They will allow PWM control of a DC motor.

author: Richard Crowley
author_rank: Super Contributor
timestamp: February 01, 2015, 08:55:15 pm
content: Quote from: 3Good5U on February 01, 2015, 04:53:01 pmAssembler, 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.QuoteNo 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.

author: 3Good5U
author_rank: Newbie
timestamp: February 01, 2015, 09:31:38 pm
content: Quote from: Richard Crowley on February 01, 2015, 08:55:15 pmWould 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...

author: Richard Crowley
author_rank: Super Contributor
timestamp: February 01, 2015, 09:36:08 pm
content: Quote from: 3Good5U on February 01, 2015, 09:31:38 pmMaybe. Much depends on other factors not known here.50Hz sounds way too slow for a motor.QuoteMaybe. Much depends on other factors not known here.Most motors don't care about the shape of the power cycle.

author: zapta
author_rank: Super Contributor
timestamp: February 01, 2015, 10:31:28 pm
content: 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.

author: FreddyVictor
author_rank: Regular Contributor
timestamp: February 02, 2015, 10:49:16 am
content: there'ssome codein existence which will run on ATmega328 - written in ccan't see a .ino or .pde file so will need tweaking to import it into arduino ide (!)