|Jan 18, 2004, 09:28 PM|
To drive the gates from Gnd to Vbatt or back needs some time. During a big part of this time both the P and N Fets are open, and a very high current flows from Vbatt to Gnd. However the Fets probably survive it, better to avoid the high current spikes, the reasons are obvious.
With 6 outputs you drive every Fet separately. So, first turn off the currently open fet, then after a short delay turn on the other. With several cycles delay you can easily compensate the additional delay of the P channel driver too (the P Fets usually need a driver transistor or IC as the battery voltage higher then the uC Vcc.)
|Jan 19, 2004, 01:40 AM|
Joined Dec 2003
Each output has to be in 3 states :
3. disconnected / high impedance / sensing
you can see that on drive waveforms that found in BL ESC threads
therefore you have to use 2 output pin for each power output
|Jan 19, 2004, 04:33 AM|
London Heathrow, Great Britain (UK)
Joined Sep 2001
I am even more confused now.
My idea was to have 3 FETS on the outputs going to the 3-phases that are on the coils. So I would have 6 coils and 2 poles so only 1 coil would be on at a time. Why do I need more 6 outputs ? HEEEEELP
Perhaps I should stick to buying a ready made controller I just fancied writing some assmbler again - I have 12yrs coding experience in financial institutions and haven't written assembler since university. Thought it might be fun.
|Jan 19, 2004, 06:07 AM|
You cannot drive both the top and bottom drivers (p-channel, n-channel) with the same output. As danyra said there are three states. Look at the 2nd page of An857 application note (talked about earlier) to see what I mean.
If you really think about it if both high and low sides are driven off the same output what would happen when you PWM this output!!! The wrong fet is switched on during the pwm low point.
You would be better driving 2 N-channel fets each phase with 2 outputs.
But then again I am no E-engineer, Just my own jibbering
|Jan 19, 2004, 06:15 AM|
The usual driving scheme:
1. step: a=+, b=-, c= open
2. step: a=open, b=+, c=-
3. step: a=-, b=open, c=+
As seen, every pin connected first to the V+, later to V-. So every motor pin needs 2 fets.
|Jan 19, 2004, 07:37 AM|
Joined Dec 2003
its is not a short time project.
i am trying now to start playing with C language on 16f628.
you and i both know that assembler is not much fun and when time is limited , it wont finish at all.
when i'l have to some relevant parts of code i'l post it here.
i hope we can share code between us all.
|Jan 19, 2004, 03:29 PM|
Joined Dec 2003
Hello , i am trying to design the software structure of BL ESC.
first the software componnents:
measuring Batt voltage
acceleration & slowing
cycle time calculation
cycle states , pwm setting
adjusting phase , cycle time , pwm
open loop slow running
tx pulse measurement
if i am right , with pic medium series , to manage power all we need is to set
the pwm parameters on active cycle phase.
so the only interrupt is for tx pulse measurement which will take tens
to hundreds of microseconds once in a 20 ms.
i will be happy to see comments on this .
|Jan 19, 2004, 04:16 PM|
- normal run
In a sensorless controller there is no phase oinformation until the rotor is spinning faster then a treshold (depends on the back emf sensor circuit).
Not too much possibilities, try to turn solwly the magnetic field with minimal amplitude (low current) and check if the rotor follows. If not, slightly higher current etc. It is a complex part, as very different motors are there, what is proper start current for one, smokes the other.
The pwm is not an independent value, not a number in the "PWM register", but a sw controlled on/off/on/off procedure in the main loop.
The sw is a loop with the necessary procedures inside:
- switching on and off the proper pins
- check back emf
- set phase and calculate cycle time again (based on the emf phase), set the count numbers in the delay loops
- delay loops everywhere, the delay is a function of the above count numbers
In such a program C can't help too much, just slows down the procedure. Nothing there what is C like: bit sets, bit clears, increments, decrements, every action manipulates hw register bits, every variable is static and most of them in special registers etc. The code is not readable, only the detailed comments.
The receiver input is the IT routine, but must be as fast and simple as possible, I mean no more then 10-15 cycles...
|Jan 19, 2004, 04:55 PM|
Joined Dec 2003
in pic medium series ( 16f628 and similar ) there is a pwm module
you have to set cycle time and duty cycle , then it rolls by itself
about C you maybe right but i will check the possibility that it can
be done clearly.
do you know how much idle time there is ? on what xtal freq ?
what is a proper pwm freq ?
is it matters when you sence the emf : during on or off ?
thanks , Dany
|Jan 19, 2004, 06:31 PM|
You have to synchronise the "pwm" to the rotor position, and have to turn on and off the fets one by one multiple times in every loop cycle.
The draft code is something like this:
-switch on Pfet1
-switch on Nfet2
-check emf on A/D
-if the result is far from estimation do some unusual correction...
-turn off Pfet1
-turn off Nfet2
... do it several times from a: to this line, this is your handmade pwm :-)))
turn on that damned fets again
check emf again, but now you detect more or less the proper emf as estimated, so...
do a fast calculation, modify slightly the estimated phase angle, recalculate the cycle time, calculate the x,y etc values for the delay loops, use the appropriate throttle value in this calculation too
turn off your beloved fets
do the pwm delays according to the x,y etc constants
this is the end of the first 1/3 of a full turn and your main loop
* repeat this nice procedure but with other fets and emv input
* and again for the 3/3...
goto label1 :-)
Not really objectum oriented...
|Jan 19, 2004, 06:48 PM|
If you really try to write a code:
- read first carefully the Microchip code
- check the oscillograms of a good commrcial controller in different working points: different throttle and load etc.
- the code is simple, the devil in the details, the "pwm" is not really pwm, the efficiency at low throttle depends on how many times and when you turn on and off (at what angle) the current
- so steel as many ideas from the oscillograms as possible
- probably the hard part is the startup procedure, you solved it for your motor and propeller, but it failed on another drive system, voltage etc...
|Jan 21, 2004, 01:42 AM|
Ok .. its time to add my 2c here.
What is being discussed here is all the things I had to learn the hard way. Prior to starting development with my own design, I knew very little about motor control. I can now help by steering you chaps in some sort of direction.
The Microchip app note: Fantastic for gaining knowledge of brushless theory … but that is all. Totally useless for model motors. You cannot do the sampling with an ADC unless you have a very high-speed device … like a suitable DSP device. Anyway, it is a lot simpler to use a very cheap LM324 and a bunch of resistors to provide the feedback… as done on mmormota original circuit. This same type of circuitry is used on the Texas Instrument DSP speed controller app notes.
Choice of micro. As already pointed out, you do not need a super fast micro. However, if you wish to do everything with one micro, it does help to have a faster device. I found that the time taken to carry out interrupt procedures doing the PWM messed me around. Yea it worked, but I was unable to get smooth PWM on the very low power range. My current design can do 1% PWM absolutely smoothly. I solved the problem by taking away as much of the PWM processor overhead by utizing an Altera logic device to handle all the high-speed stuff. That way, the Atmel Mega 8 device running at 8MHz, with its internal clock, can do everything without any speed problems at all. Hell .. I can almost run into the MHz range with this controller. Oh yes .. the logic device allows numerous different PWM frequencies (a must have with any decent design) and also different PWM resolutions (a luxury) The Mega device also has an on board 8 channel ADC which is used for checking voltages (like my switch mode supply that supplies the high side FETs gate drive) bec and other things. So the ADC is a must, but not for feedback sampling.
Some other points. The Altera logic has it code written in VHDL. The Atmel code is in C. (the free compiler from AVR Freaks) Yes, that’s right… writing in assembler is not mandatory. Once you become efficient with ‘C’.. Goodbye to assembly languages forever.
Attached are photos of my second test PCB. I am currently on my final version (hopefully) As you can see, everything is in surface mount using caps and resistors in 0603. The second board is the FET board, which at present does not have the correct FETs .. hence the heatsink. Note the logic device and FET driver Ics on the bottom of PCB. The fan unit to test controller is a Mega 3 turn Mini fan combo .. for which you need high PWM frequency to work … otherwise poof goes your FETS. That 3 turn motor has a very low impedance.
|Jan 21, 2004, 12:25 PM|
Baltimore Bwi Rr Stn, Maryland, United States
Joined Oct 2003
I have finally taken a look at Takao's code and have the following comments. The program hangs in a loop to beep the motor when power is first applied. It then waits for the following things to happen: throttle signal detected, battery check (LVC?), and throttle pulse width => 1.1msec. If none of these checks are passed the code hangs in the motor beep segment. I suggest checking your breadboard to make sure all these things are OK. The 1.1msec minimum pulse width is reasonable to me, but if you want to reduce it change line 485 from:
cpi temp,uS1100 ;Shorter than 1100uS?
cpi temp,uS1000 ;Shorter than 1000uS?
This is the minimum pulse width the receiver should output. Let me know how you make out.
|Category||Thread||Thread Starter||Forum||Replies||Last Post|
|Brushless speed control problem||TomL||Sport Planes||8||Jun 08, 2003 02:23 AM|
|TMM-18-3ph Brushless Speed Control||nelsonjo1||Power Systems||5||Apr 04, 2003 01:33 AM|
|FS: Model Motors 40 amp Brushless Speed Control.||Jim McPherson||Aircraft - Electric - Airplanes (FS/W)||3||Dec 10, 2002 06:02 PM|
|Dragon 35 brushless speed control||Steve H.||Aircraft - Electric - Airplanes (FS/W)||0||Aug 17, 2002 01:29 AM|
|Hooking up a Jeti Brushless Speed Control to a Jeti Pashor 15/4 motor. HELP!!!||Rob R||Power Systems||3||Jan 10, 2002 07:37 PM|