HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Feb 15, 2013, 10:52 AM
Thermite + ice = Big boom.
boaterguy's Avatar
Canada, ON, Ottawa
Joined Apr 2009
2,275 Posts
Build Log
Switching brushed ESC

After blowing up a brushless controller with 70A Fet's on it, I figured I would build a brushed controller with it.
Initially, the code isn't so complicated, but after adding a for loop to count through the FET's, I'm having a little trouble, here is what I have so far:
Code:
//initialize variables
int inpulselen = 0
int outpulselen = 0
int pin = 1
int tmin = 0
int tmax = 2000

void setup() 
{
  pinmode (12, INPUT) 
  tmin = pulseIn (12, HIGH) //set the 0 throttle point at the 
  //current throttle position
  
}

void loop ()
{
  for (int i = 8; i >8 ; i += 1)
    {
      if (i == 11) //loop through pins 8 to 11 and restart
      {
        i = 8
      }
      inpulselen = pulseIn (12, HIGH) //read pwm and map it
      outpulselen map (inpulselen, tmin, tmax, 0, 255)
      digitalWrite(i, HIGH)
      delay(outpulselen) //pretty self explanatory
      digitalWrite(i, LOW)
      delay(255-outpulselen)  
    }
I know there`s a better way to do this, but I don`t know what it is, any suggestions?
boaterguy is offline Find More Posts by boaterguy
Last edited by boaterguy; Feb 15, 2013 at 12:22 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Feb 15, 2013, 12:11 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,602 Posts
Hi boaterguy,

In this line: for (int i = 8; i >8 ; i += x)

Where is the x variable coming from, I don't see it initialized or used anywhere else in your program.

If you are incrementing the loop counter, I believe it should be: for (int i = 8; i >8 ; i += 1)

Or am I misunderstanding the problem?

Pete
blutoh is offline Find More Posts by blutoh
Last edited by blutoh; Feb 15, 2013 at 12:17 PM.
Reply With Quote
Old Feb 15, 2013, 12:22 PM
Thermite + ice = Big boom.
boaterguy's Avatar
Canada, ON, Ottawa
Joined Apr 2009
2,275 Posts
Oops, I was using a different strategy but I changed it, and forgot to change that, it should be i += 1.
Thanks for noticing, that could have been confusing if I came back a day later.
boaterguy is offline Find More Posts by boaterguy
Reply With Quote
Old Feb 16, 2013, 01:50 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
298 Posts
Why not just do: analogWrite(Pin, Value); Or send PWM commands.

A friend of mine drew this a few years ago:


The 5V can vary between 0 and 5v. Worth trying. Verbruiker is dutch for user (motor). We made this for a controller called Bitwhacker (early open-source unit).

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Last edited by Dutchraptor; Feb 16, 2013 at 02:02 PM.
Reply With Quote
Old Feb 16, 2013, 09:29 PM
Thermite + ice = Big boom.
boaterguy's Avatar
Canada, ON, Ottawa
Joined Apr 2009
2,275 Posts
I can do the single FET design no problem, I just thought it would be more efficient to do a switching design. I guess it's probably not worth the effort in the end.
Is the 1m resistor 1 megohm or is it dutch for 1k?
boaterguy is offline Find More Posts by boaterguy
Reply With Quote
Old Feb 17, 2013, 03:24 AM
Registered User
Joined Jun 2011
218 Posts
Hi,
There's a few changes I would make to the circuit shown.

Driving the gate with an analog voltage will produce very high dissipation in the FET and require a massive heatsink. For example if the FET is half on dropping 6 volts of the 12V supply and the motor at this voltage is drawing say 8A then that's 48W of heat the FET has to get rid of.

The diode in the gate would seem redundant and if used on PWM drive would be almost dangerous. PWM relies on the FET being hard on (current but no voltage drop) or hard off (no current but full voltage drop). Neither mode dissipates any energy so the FET stays cool. The mark/space of the switching waveform is varied to provide a variable average voltage and the motor inductance integrates the current pulses to a steady current.
With a diode and 1M resistor the drive can not turn the FET off quickly and the stored charge in the gate has to discharge via 1M which will be too slow and the FET will dissipate during the turn off ramp down.

The FET needs to be a logic level type device that is characterized for 5V drive.
Standard FETs need 8-10V of drive to turn on fully and would get hot if the drive was limited..

The motor needs to have a high current Schottky diode across it, reverse connected, to catch the back EMF spikes when the FET is turned off. It will work as is but the FET will go in to repetitive avalanche breakdown mode causing even more heat.

Cheers,
David
KiwiDavid is offline Find More Posts by KiwiDavid
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Reprogram a brushless ESC to get a brushed ESC with no delays / RC Switch kapteinkuk DIY Electronics 81 Jan 04, 2014 06:29 AM
For Sale NIB Futaba MC850C Brushed ESC Dallas101 Cars - Accessories (FS/W) 1 Jun 23, 2013 06:00 PM
For Sale Big lot of brushed goodies!!! Motors\ESC's\Integy auto com lathe!! Dallas101 Cars - Accessories (FS/W) 7 Feb 25, 2013 03:08 PM
Sold NIP E-flite 10-Amp Micro Brushed ESC Bryan's Flyin Aircraft - Electric - Power Systems (FS/W) 4 Jan 22, 2013 12:55 PM
For Sale 2 brushed ESCs and multiple motor/gearbox combo Kyle G. Aircraft - Electric - Power Systems (FS/W) 1 Jan 21, 2013 09:40 PM