Simple rc esc

8man1320

New Member
I am quite inexperienced with electronics. But I like to play a bit.
So, I will ask for some input.

I wish to build an electronic speed controller for an rc truck.
My truck spends a lot of time at low speeds.
It is geared very low.
The motor whine at low speed is very annoying, and is my reason for
attempting this.

My requirements are:

16khz switching speed
(to remove some of the motor whine at low rpms)

As few components as possible.

I am wanting to use a relay for reverse. So there is only
one drive side. (hope that makes sense)

I am using an 8M chip, and I can write the code, but I need help
with the components.

Any suggestions on the transistors that I need.
I would like to drive it/them directly from my chip.

I'm using a
4.5v battery for the receiver and servos
and a separate 7.4v battery for the motor.
 

goom

Senior Member
Are you sure that the whine is due to the PWM frequency, and not the drive train?
Depending on the maximum current draw of your motor, there are many possibilities. Perhaps the simplest is to use a ready made H bridge driver. Simple to interface, and will give you reverse without the need for a relay. Take a look at the L293D, L298 or LMD18200.
I have used a -08M and relay as an ESC. I used a PWM frequency of about 4kHz (no audible whine), directly driving a logic level MOSFET. This works fine for modest currents, but a MOSFET gate driver would be a very good idea for higher currents (>1.5A), or the MOSFET will get hot (lots of threads can be found on driving MOSFET's).
Maybe you could even hack into your existing motor driver.
 
Last edited:

8man1320

New Member
I saw a schematic with an irf3706 being driven directly from a 12f675.
Another had it driving a pair of them.
Can I do this with my PICAXE 8M? At 16khz?
 
Last edited:

Haku

Senior Member
ESC whine can be very noticable and annoying, for the 08m I turned into an ESC I had to set the PWM frequency to 40khz so I wouldn't hear the motor 'squealing' at me when driving slowly. 16khz is still within most people's hearing range.

To get the 08m to output a 40khz PWM signal you need to add "setfreq m8" near the beginning of the code to make it run at 8mhz, then use "pwmout 2,49,b1" where b1 is between 0 and 200
 

Goeytex

Senior Member
I saw a schematic with an irf3706 being driven directly from a 12f675.
Another had it driving a pair of them.
Can I do this with my PICAXE 8M? At 16khz?
Probably not a very good idea.

For good high speed (16 Khz) switching the IRF3706 needs more current than the PIC can provide. The FET will likely get very hot in your case.
That would probably be OK at 100 hz, but NOT at 16 Khz, regardless of what you saw.

This is because the low current (25 ma) provided by the PIC will cause the FET to remain in its transition area too long.

To do it right you will need a FET driver.

Goey
 

Goeytex

Senior Member
Or a different FET. Mind, all of this depends on what current the motor draws.

If it is 500mA motor, with a 80A FET, I wouldn't expect too much heating.

A
That would depend upon the gate capacitance not the current rating.

In other words the current rating has little to do with gate drive requirements
for high speed switching. Regardless of the current rating or the load, if the
FET hangs out in its transition area between fully on and fully off it will heat
up. (unnecessarily)

It beats me as to why so many folks jump through hoops to avoid using a
$1 FET driver that can save the micro and provide adequate current for high speed switching of substantial loads via a microprocessor.

Goey
 
Last edited:

8man1320

New Member
I do not know the amp draw. I do know that it is an 85 turn 540 size motor.
It is geared very low. I have no way to check the amp draw.

A fet driver. O.K. what kind of specs do I need for that?
 

Goeytex

Senior Member
I do not know the amp draw. I do know that it is an 85 turn 540 size motor.
It is geared very low. I have no way to check the amp draw.

A fet driver. O.K. what kind of specs do I need for that?
If you are only driving 1 FET then the TC1411N ( Microchip) will work fine.
Since you are in the USA, you can order from Mouser or Digikey

Mouser Part number is ... 579-TC1411NCPA
 

8man1320

New Member
and if more than one? (just in case) tc4420cpa?
(found that while searching these forums)
I know it's a lot, but it doesn't cost much more.

Do I use that with the irf3706?
 

8man1320

New Member
I'd like to be able to handle 12A cont. If it need a heatsink, that's fine.
I just want to be able to munipulate the frequency, and other parameters to my own tastes.
 

Goeytex

Senior Member
I'd like to be able to handle 12A cont. If it need a heatsink, that's fine.
I just want to be able to munipulate the frequency, and other parameters to my own tastes.
Getting a Dual Driver is fine. Even if you only need 1 channel. FET selection
is your choice. If you want to handle 12 amps continuous then I would opt for
a 15 amp rated FET.

FET selection depends upon what you power the FET driver with. If you have 10-12 volts available then you are not limited to Logic Level FETs. IF you only power the Fet Driver with 5 Volts then your choices will be limited to FETs with a maximum gate threshold in 2 volt range.

The IRF530 is a good general purpose fast switching FET, with a low gate threshold and should work fine for your application. It will work well with a 5 volt gate drive up to a 20 volt (max) gate drive. It is rated at 14 amps continuous.

Good luck !
 
Last edited:

BeanieBots

Moderator
Or a different FET. Mind, all of this depends on what current the motor draws.

If it is 500mA motor, with a 80A FET, I wouldn't expect too much heating.

A
As Goeytex states, it's about gate capacitance and not current rating.
In general, the higher the current rating, the higher the gate capacitance. Hence, an over rated FET is more likely to get hotter than one which is only just good enough.
There really is no substitute for proper driving and this comes up so often.

EDIT:
A 540 motor can pull ~15A when stalled, so your FET should be rated for about 30A.
You might get away with a IRF530 but IMHO it's cutting it a bit fine.
 
Last edited:

8man1320

New Member
So....

1x TC4424 (not so much overkill)
2x IRF530 (to make sure the temps are low)

drive the 4424 with the 8M and it "should" work fine.
Voltage for the 8M and the other chips would be 5v.
I'm going to feed the 7.4V motor battery separately.
 

Goeytex

Senior Member
EDIT:
A 540 motor can pull ~15A when stalled, so your FET should be rated for about 30A.
You might get away with a IRF530 but IMHO it's cutting it a bit fine.
Boy does that drive the cost up! . The best deal I could find over 20 amps in a through hole FET.

Fairchild FCP22N60N 600 Volts / 22 amps $3.11 US Mouser
Low gate capacitance, low gate threshold.

Of course you could always parallel 2 cheaper 15 amp FETs if it is practical and cost effective

It's getting to where through hole FETs (T0-220) and other stuff are harder to come by and we will all have to start adjusting to SMD stuff.

My next project ? A Picaxe controlled "Toaster Oven" for SMD Reflow.
 

Goeytex

Senior Member
So....

1x TC4424 (not so much overkill)
2x IRF530 (to make sure the temps are low)

drive the 4424 with the 8M and it "should" work fine.
Voltage for the 8M and the other chips would be 5v.
I'm going to feed the 7.4V motor battery separately.
It "will" work fine ! LOL

If you can swing it, the bypass cap for the TC4424 should be a Ceramic
X5R or X7R 1 uf or 2 uf . Don't forget to order a couple of these as well.

Goey
 

boriz

Senior Member
My 2c.

In a simplified way (the only way I know ^_^ )...

Switching a MOSFET gate is much like charging/discharging a capacitor. Once you know the charge current and the capacitance, then you know how long it takes to charge/discharge. This is roughly how long the MOSFET is ‘dithering’ in its linear (heating) region. And depending on what losses are acceptable (% dithering time), limits your upper switching frequency. IE: If it takes T seconds to charge the gate, and you want that to be 2% maximum of your total cycle time, then your total cycle time must be at least T*50, giving an upper frequency limit of 1/(T*50). However, one cycle includes both a charge AND a discharge, so you have to account for T*2 seconds of dithering per cycle. Giving an upper frequency of 1/(T*2*50).

Or you could work it the other way. If you know the required frequency and the gate capacitance and the acceptable dither time, then you can work out the minimum required gate current.

Or, given the frequency and current, you can work out the max allowable capacitance.

Etc.

Of course it’s actually more complicated than that, with graphs and such. But it should be enough to get the job done.
 

8man1320

New Member
I was reading that and was thinking... OMG I'll never get it.

Then, at the end, "it's really more complicated than that.......
How embarassing.

I build high performance cars for a living. Tuning, engine building, easy.
This stuff, not so much.

Thank you so far, for all your help. I'm sure that I'll need more.
 

Goeytex

Senior Member
I was reading that and was thinking... OMG I'll never get it.

Then, at the end, "it's really more complicated than that.......
How embarassing.

I build high performance cars for a living. Tuning, engine building, easy.
This stuff, not so much.

Thank you so far, for all your help. I'm sure that I'll need more.
Aw, It's not that complicated in actual practice. All the formulas are nice to know but for the majority of applications ... Just slap down a good FET driver, slap down a good FET, use a minimal heat sink and let her RIP !

There should be very little heat generated ( at the FET) if all is working well.
Warm is OK.
 

Haku

Senior Member
On the subject of FET's, I just unsoldered 8 of them from an old ESC that got water damaged, 4x IRL3103 & 4x IRFZ34N, is there an easy/simple way of testing them?
 
Last edited:

Goeytex

Senior Member
the bypass cap... I don't know how to explain
http://www.robotroom.com/HBridge.html

the drawing on that page C1 + C2?
When dealing with electronics parts the Datasheet is like a "Motors Manual"
for the part. The Datasheet is your best friend. Look there first for answers.

Look at the Datasheet for your FET Driver and it will tell you what is recommended
for a Bypass Capacitor. The bypass capacitor will go across VDD to Ground as
close as possible to the VDD pin(s). If your Driver has 2 VDD pins use a separate
bypass Cap on each pin.

Generally speaking a 1 to 2 microfarad CERAMIC cap is specified. These are mostly
found as X5R or X7R types.

Follow the manufacturers recommendations for your device in the Datasheet.

Goey
 
Last edited:

8man1320

New Member
how bad is it??

The transistor in the input is for 2.4ghz compatability.
I may add a lipo monitor later.
This doesn't have the relay yet.

image deleted
 
Last edited:

BeanieBots

Moderator
You will want a clamp diode on the motor to protect your FETs from flyback voltage.
Apart from that, at a quick glance, looks OK.
I'd put a low value (10R) in series with the FET gate(s).
Layout will be an issue but common sense should get you most of the way.
 

Goeytex

Senior Member
how bad is it??

The transistor in the input is for 2.4ghz compatability.
I may add a lipo monitor later.
This doesn't have the relay yet.
Not bad at all. Well done.

Like BeanieBots said, you will need a clamp diode on the motor and a 10 ohm resistor from the Driver to the FET gate is a good idea.

I hope the -7.4 volts on the bottom rail is really 0 volts.
 

russbow

Senior Member
Does that 22k download resistor need to be moved? Looks like a voltage divider to me.
Would be if the voltage was applied to the top of R5.

Input voltage is developed across R6, R5 limits the current to the Axe
 

8man1320

New Member
a clamp diode

in rc a schottky diode would be used.

either way, I have no idea what to use there



as far as the schematic
I used 4 different ones as reference, and changed some of the things
for my own use. MS paint ;)
 

MartinM57

Moderator
Some people might be ultra-cautious and put a 1n4001 immediately before the input side of the regulator (pointy end to regulator input) and then a 100uF to 470uF electrolytic to ground between the pointy end and the regulator.

Two advantages:
- reverse supply connection protection (to a certain extent - does not protect your FET driver, if that is needed)
- any power supply dips caused by the motor will be buffered by the electrolytic feeding into the regulator, meaning a more stable supply into the PICAXE. The diode stops the electrolytic feeding into the motor...
 

Wrenow

Senior Member
I do not know the amp draw. I do know that it is an 85 turn 540 size motor.
It is geared very low. I have no way to check the amp draw.

A fet driver. O.K. what kind of specs do I need for that?
If it is a standard 540, it can be up top a 70A stall draw. A 550 up to 85A.
And then, there are the lower draw, lower RPM 545 and and 555 series. The Mabuchi site has the specs for the standard motors. If they have been modded, of course, all bets are off. There are probably some hobby/racing sites with specs on the modded motors.

Cheers,

Wreno
 

Attachments

boriz

Senior Member
@8man1320

Sorry about that. Perhaps illustrations will make it clearer...

The three waveforms shown below are all the same frequency (cycle time). Wave [A] is one complete cycle of a nice square output from the Picaxe and represents the ideal waveform for power switching applications such as yours. However, because the MOSFETs gate acts like a capacitor, and because the Picaxe has limited output current, the voltage on the gate (observed with an oscilloscope) will look more like wave .

The ‘charge curve’ on the leading and trailing edge is exactly what you would expect to see when charging or discharging a capacitor. On the rising edge, the voltage takes time to reach maximum, and during this time the MOSFET is not fully on. Similarly, on the falling edge, during the discharge curve, the MOSFET is not fully off. During these ‘dithering’ (my word) periods, the MOSFET is acting more like an analogue amplifier than a switch. It’s operating in its linear region. When fully on or off, the MOSFET dissipates very little power, just like a switch or relay, but in the linear region, it dissipates power just like a resistor, causing it to get hot and waste power. Wave [C] shows the same effect, but it’s obviously much worse. More than 50% of the cycle is spent in the linear region.

The time it takes to charge/discharge the capacitance depends basically on only two factors: The value of the capacitance (farads), and the charge current (amps). So with a fixed capacitance and a fixed charge current, the time spent in the linear region is also fixed. Call it Td (Time dithering).

Obviously you can choose whatever frequency you like, but the higher the frequency (shorter complete cycle), the greater PROPORTION of the cycle will be spent dithering. EG, if the dither is say 1mS, and you choose a frequency of 500Hz (a cycle time of 2mS) then 50% of your cycle is spent dithering, meaning the MOSFET is only fully on/off for only 50% of the time. The gate waveform will look a little like wave [C]. You will waste a huge amount of power and heat up the MOSFET.

So for a dither of 1mS, you really need to use a lower frequency (longer cycle time) to make the design pay off. Say 100 Hz (10mS cycle). Then the gate waveform will look more like wave . Now the MOSFET is on/off for about 90% of the time and only 10% is wasted during the dither. This is much better, but still fairly wasteful and far from ideal.
As you can see, for a fixed dither time, the higher the frequency, the more power is lost heating the MOSFET. So for higher frequencies you need to reduce the dither time. This can be done by using a gate with lower capacitance, or by using a higher charge current (such as provided by a MOSFET driver like Goeytex suggested).

Either way, as in most electronics, it’s a compromise which needs to be established at design time. My usual approach is to generalise, estimate, test, then revise. Keeps the maths to a minimum (not my strong point).

Hope that’s helped a little.

 

BeanieBots

Moderator
That's looking better.
The diode on your motor does not need to be a schottky but it does need to be quite fast. It also needs to be able to cope with current spikes which will be the same order of magnitude than the current drawn by the motor, so it will need to be quite a hefty device.

In addition to the diode, it might also be a good idea to fit some suppression to the motor. Try 100nF directly across the motor terminals and 100nF from each terminal to the motor case.
 

hippy

Technical Support
Staff member
Excellent diagrams, and adapted to show the issue of 'dithering'. The time taken to rise and to fall, the non-linear region, is shown in red.

For a slow frequency there will be a lot more non-red to red than there will be at higher frequencies because the width of red generally remains constant regardless of frequency.
 

Attachments

BeanieBots

Moderator
Nice addition to the diagram Hippy. The red clearly shows when the FET gets hot.
Will have to ask EC to bookmark this for the next time FET driving comes up;)
 

8man1320

New Member
those diagrams tell the whole story. I got the idea before, now it's obvious.

Motor suppression diodes are a given. They're already on the motor.
Changed the 100uf to 0.1uf

Do I really need that many caps?? I guess they're all for a purpose,
and I would like some measure of reliability. So be it.


 
Top