Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

control brushless motor (+ controller) with pwm


  • Please log in to reply
9 replies to this topic

#1 Freeman4gu

Freeman4gu

    Member

  • Members
  • PipPip
  • 17 posts

Posted 19 August 2011 - 04:18 PM

Hello,

I am new to that hole electronic world and at the moment I am trying to control a brushless motor with my netduino.
The controller has a kind of handshake:
  • full speed (needs at least 1.5ms duration)
  • connect akku
  • zero speed
    {*]beep beep beep! ;)
  • ready

so i use the following code, but it did not seem to work, I already tried other ways, but nothing seems to work :(

PWM Servo1 = new PWM(Pins.GPIO_PIN_D5);
Servo1.SetDutyCycle(1);
Servo1.SetPulse(20000, 1800);
Thread.Sleep(300);

while (true)
{
    Servo1.SetDutyCycle(1);
    Servo1.SetPulse(20000, 1500);
    Thread.Sleep(300);
}

it would be nice if any of you could help me ;)

Attached Files



#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 19 August 2011 - 04:36 PM

Hi and welcome to the Netduino community!

Perhaps the best way to drive DC-motors is through a motor driver IC. The most common one is the SN754410 H-Bridge Motor Driver.
It's the same used on a motor shield I wrote some code for:
https://stefan.co/ne...rshield-driver/

You could also build up this schematic:
http://wiki.netduino...itor-Motor.ashx

Good luck!


-edit- wait, appairently it has Electronic speed control. Itsdan is already helping you out in Chat I see ;)

Edited by Stefan, 19 August 2011 - 04:40 PM.

"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 Freeman4gu

Freeman4gu

    Member

  • Members
  • PipPip
  • 17 posts

Posted 19 August 2011 - 04:46 PM

ok so far I got some help in the chat :) there are already a library for esc :) http://forums.netdui...ino-esc-driver/

#4 Freeman4gu

Freeman4gu

    Member

  • Members
  • PipPip
  • 17 posts

Posted 20 August 2011 - 09:33 AM

wohooo i made it :) works fine, thank you for your help

#5 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 20 August 2011 - 06:43 PM

Hi and welcome to the Netduino community!

Perhaps the best way to drive DC-motors is through a motor driver IC. The most common one is the SN754410 H-Bridge Motor Driver.
It's the same used on a motor shield I wrote some code for:
https://stefan.co/ne...rshield-driver/

You could also build up this schematic:
http://wiki.netduino...itor-Motor.ashx

Good luck!


-edit- wait, appairently it has Electronic speed control. Itsdan is already helping you out in Chat I see ;)



Brushless motors are 3 phase AC motors, and thus cannot be controlled as a brushed DC motor.

The ESC already acts as the motor controller, so I think he just needs help with generating the proper waveform in proportion to the proper throttle setting, for which I do have a library out for (As linked)...

Hope it works for you, enjoy! :)

#6 netdontknow

netdontknow

    New Member

  • Members
  • Pip
  • 6 posts

Posted 11 September 2011 - 02:47 PM

ok so far I got some help in the chat :)

there are already a library for esc :)
http://forums.netdui...ino-esc-driver/


Freeman4gu,

How did you get it to work?
I have tried this driver on both Netduino & Netduino Plus, It seems like it almost works, I can hear the gearbox makes clicking noise, and when it is... I measured the voltage on the motor using my voltage meter it reads 0.14 to 0. it seems that the gearbox was attempting to spin the wheel to sastify me... but it couldn't for some reasons.

Here is my connecting diagram, + code solution, see if anyone see anything wrong with that code? it was coppied straight out of Chris's post.

Thanks!

Attached Files



#7 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 11 September 2011 - 04:34 PM

Connection diagram looks fine, make sure you calibrate the ESC.

#8 netdontknow

netdontknow

    New Member

  • Members
  • Pip
  • 6 posts

Posted 11 September 2011 - 04:44 PM

Connection diagram looks fine, make sure you calibrate the ESC.


Chris,
could you give me the step to calibrate this ESC

Thanks

#9 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 11 September 2011 - 05:32 PM

This is some very old code (lots of bad form), but it should give you an idea of what needs to be done. You will need to adapt this for the Netduino as it is currently meant for the GHI boards. http://files.chrisseto.com/bhF

#10 ocram

ocram

    New Member

  • Members
  • Pip
  • 1 posts

Posted 26 October 2013 - 05:20 AM

wohooo i made it Posted Image works fine, thank you for your help

how? I not can! :(






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.