Not simple BLDC controller It RUNS! :)

Arlo1

1 TW
Joined
Apr 26, 2009
Messages
8,459
Location
Nanaimo
So As you can see on Jeremy's Simple BLDC thread I am starting my own build with a pic18f2431 for the brain. I will use most of the rest of the info and bord design from jeremy for the brain and move his fet drivers to a seprate bord driving the igbts I have on order right at the igbt it self. I have also ordered 12v-12v isolated dc-dc converters to isolate the controller from the drivers and not need to bootstrap. I have also looked at a cheeper programing chip one might be able to use from these guys. http://www.robotshop.com/ca/arduino-uno-microcontroller-2.html
I will have to get a pickit3 programer to program the PIC18f2431 and its ~$50

This thread will be dedicated to building an optimal Digital controller from scratch on a budget of 100-200 pluss what ever fets or igbts someone will run. It will also be dedicated to writing the code to program it. I will post code as I update it here. This is just what got the motor running.
Code:
#define   __dsPIC30F4011__
#include "p30F4011.h"
//Configuration bits
_FOSC(CSW_FSCM_OFF & FRC_PLL4);
_FWDT(WDT_OFF);
_FBORPOR (PBOR_OFF & PWRT_16 & MCLR_EN);
_FGS(CODE_PROT_OFF);
//-----------------------------------------------------------------------------
//Program Specific Constants
//Fcy = cycle clock = Fosc/4 = (XTAL * PLLmultiplier)/(4*PostScaler)
#define FCY 5000000        // 5 MHz Xtal*PLLof4/(4*Postscalerof1)
#define MILLISEC       FCY/10000       // 1 mSec delay constant
#define FPWM 50000       // 50 kHz, for low inductance
#define Ksp 1200
#define Ksi 10
#define RPMConstant 60* (FCY/256)
/* PWMCON1 */
#define _PEN1L PWMCON1bits.PEN1L
#define _PEN2L PWMCON1bits.PEN2L
#define _PEN3L PWMCON1bits.PEN3L
#define _PEN1H PWMCON1bits.PEN1H
#define _PEN2H PWMCON1bits.PEN2H
#define _PEN3H PWMCON1bits.PEN3H
#define _PMOD1 PWMCON1bits.PMOD1
#define _PMOD2 PWMCON1bits.PMOD2
#define _PMOD3 PWMCON1bits.PMOD3
#define _PTMOD PTCONbits.PTMOD
#define _PTCKPS PTCONbits.PTCKPS
#define _PTOPS PTCONbits.PTOPS
#define _DTBPS DTCON1bits.DTBPS
#define _DTAPS DTCON1bits.DTAPS
void InitTMR3(void);
void InitADC10(void);
void AverageADC(void);
void DelayNmSec(unsigned int N);
void InitMCPWM(void);
void CalculateDC(void);
void GetSpeed(void);
struct {
unsigned RunMotor : 1;
unsigned Minus : 1;
unsigned unused : 14;
} Flags;
unsigned int HallValue;
int Speed;
unsigned int Timer3;
unsigned char Count;
unsigned char SpeedCount;
int DesiredSpeed;
int ActualSpeed;
int SpeedError;
int DutyCycle;
int SpeedIntegral;
/*************************************************************
Low side driver table is as below. In this StateLoTable,
the Low side driver is PWM while the high side driver is
either on or off. This table is used in this exercise
*************************************************************/
unsigned int StateLoTable[] = {0x0000, 0x1002, 0x0420, 0x0402,
0x0108, 0x1008, 0x0120, 0x0000};
/****************************************************************
Interrupt vector for Change Notification CN5, 6 and 7 is as below.
When a Hall sensor changes states, an interrupt will be caused which
will vector to the routine below.
The user has to then read the PORTB, mask bits 3, 4 and 5,
shift and adjust the value to read as 1, 2 ... 6. This
value is then used as an offset in the lookup table StateLoTable
to determine the value loaded in the OCDCON register
*****************************************************************/
void _ISR _CNInterrupt(void)
{
IFS0bits.CNIF = 0; // clear flag
HallValue = PORTB & 0x0038; // mask RB3,4 & 5
HallValue = HallValue >> 3; // shift right 3 times
OVDCON = StateLoTable[HallValue];// Load the overide control register
}
/*********************************************************************
The ADC interrupt loads the DesiredSpeed variable with the demand pot
value. This is then used to determing the Speed error. When the motor
is not running, the PDC values use the direct Demand value from the pot.
*********************************************************************/
void _ISR _ADCInterrupt(void)
{
IFS0bits.ADIF = 0;
DesiredSpeed = ADCBUF0;
if (!Flags.RunMotor)
{
PDC1 = ADCBUF0; // get value ...
PDC2 = PDC1; // and load all three PWMs ...
PDC3 = PDC1; // duty cycles
}
}
/************************************************************************
The main routine controls the initialization, and the keypress to start
and stop the motor.
************************************************************************/
int main(void)
{
LATE = 0x0000;
TRISE = 0xFFC0; // PWMs are outputs
CNEN1 = 0x00E0; // CN5,6 and 7 enabled
CNPU1 = 0x00E0; // enable internal pullups
IFS0bits.CNIF = 0; // clear CNIF
IEC0bits.CNIE = 1; // enable CN interrupt
SpeedError = 0;
SpeedIntegral = 0;
InitTMR3();
InitMCPWM();
InitADC10();
while(1)
{
DelayNmSec(10);
// read hall position sensors on PORTB
HallValue = PORTB & 0x0038; // mask RB3,4 & 5
HallValue = HallValue >> 3; // shift right to get value 1, 2 ... 6
OVDCON = StateLoTable[HallValue];// Load the overide control register
PWMCON1 = 0x0777; // enable PWM outputs
Flags.RunMotor = 1; // set flag
T3CON = 0x8030; // start TMR3
while (Flags.RunMotor) // while motor is running
   {
if (HallValue == 1) //IF in sector 1
{
HallValue = 0xFF; // force a new value as a sector
if (++Count == 5) // do this for 5 electrical revolutions or 1
// mechanical revolution for a 10 pole motor
{
Timer3 = TMR3;// read latest tmr3 value
TMR3 = 0;
Count = 0;
GetSpeed();// determine spped
}
}
Flags.RunMotor = 0;// reset run flag
DelayNmSec(10);
}
} // end of while (1)
}
/*******************************************************************
Below is the code required to setup the ADC registers for :
1. 1 channel conversion (in this case RB2/AN2)
2. PWM trigger starts conversion
3. Pot is connected to CH0 and RB2
4. Manual Stop Sampling and start converting
5. Manual check of Conversion complete
*********************************************************************/
void InitADC10(void)
{
ADPCFG = 0xFFFB; // all PORTB = Digital;RB0 to RB2 = analog
ADCON1 = 0x0064; // PWM starts conversion
ADCON2 = 0x0000; // sample CH0 channel
ADCHS = 0x0002; // Connect RB2/AN2 as CH0 = pot.
ADCON3 = 0x0080; // Tad = internal RC (4uS)
IFS0bits.ADIF = 0; // clear flag
IEC0bits.ADIE = 1; // enable interrupt
ADCON1bits.ADON = 1; // turn ADC ON
}
/********************************************************************
InitMCPWM, intializes the PWM as follows:
1. FPWM = 16000 hz
2. Independant PWMs
3. Control outputs using OVDCON
4. Set Duty Cycle using PI algorithm and Speed Error
5. Set ADC to be triggered by PWM special trigger
*********************************************************************/
 void InitMCPWM(void)
   {
   PTPER = FCY/FPWM -1;
   _PTOPS = 0x0;   // Postscale (1:1)
   _PTCKPS = 0x0;  // Prescale Tcy (1:1)
   _PTMOD = 0b11;   // PWM continious up/down with dual up dates
   _PMOD3 = 0x0;  // PWM pair is complementary
   _PMOD2 = 0x0;
   _PMOD1 = 0x0;
   _PEN1H = 0x1;   // enable for output
   _PEN2H = 0x1;
   _PEN3H = 0x1;
   _PEN1L = 0x1;
   _PEN2L = 0x1;
   _PEN3L = 0x1; 
   _DTBPS = 0x0;     // Dead time unit B  1 Tcy
   _DTAPS = 0x0;     // Dead time unit A 1 Tcy
 #define  FLTACONbits.FAEN3 = 0x0;   // PWM pins not controlled by fault A input.
 #define  FLTACONbits.FAEN2 = 0x0;
 #define  FLTACONbits.FAEN1 = 0x0;
 #define  FLTBCONbits.FAEN3 = 0x0;   // PWM pins not controlled by fault B input
 #define FLTBCONbits.FAEN1 = 0x0;
 #define FLTBCONbits.FAEN2 = 0x0;
 #define  OVDCONbits.POVD1L = 0x1;   // PWM pins controlled by PWM generator
 #define  OVDCONbits.POVD2L = 0x1;
 #define  OVDCONbits.POVD3L = 0x1;
   PDC1 = 50;                 // init PWM to 50
   PDC2 = 50;
   PDC3 = 50;
   PTCON = 0x8000; // start PWM
   }

/************************************************************************
Tmr3 is used to determine the speed so it is set to count using Tcy/256
*************************************************************************/
void InitTMR3(void)
{
T3CON = 0x0030; // internal Tcy/256 clock
TMR3 = 0;
PR3 = 0x8000;
}
/************************************************************************
GetSpeed, determins the exact speed of the motor by using the value in
TMR3 for every mechanical cycle.
*************************************************************************/
void GetSpeed(void)
{
if (Timer3 > 23000) // if TMR3 is large ignore reading
return;
if (Timer3 > 0)
Speed = RPMConstant/(long)Timer3;// get speed in RPM
ActualSpeed += Speed;
ActualSpeed = ActualSpeed >> 1;
if (++SpeedCount == 1)
{SpeedCount = 0;CalculateDC();}
}
/*****************************************************************************
CalculateDC, uses the PI algorithm to calculate the new DutyCycle value which
will get loaded into the PDCx registers.
****************************************************************************/
void CalculateDC(void)
{
DesiredSpeed = DesiredSpeed*3;
Flags.Minus = 0;
if (ActualSpeed > DesiredSpeed)
SpeedError = ActualSpeed - DesiredSpeed;
else
{
SpeedError = DesiredSpeed - ActualSpeed;
Flags.Minus = 1;
}
SpeedIntegral += SpeedError;
if (SpeedIntegral > 9000)
SpeedIntegral = 0;
DutyCycle = (((long)Ksp*(long)SpeedError + (long)Ksi*(long)SpeedIntegral) >> 12);
DesiredSpeed = DesiredSpeed/3;
if (Flags.Minus)
DutyCycle = DesiredSpeed + DutyCycle;
else DutyCycle = DesiredSpeed - DutyCycle;
if (DutyCycle < 100)
DutyCycle = 100;
if (DutyCycle > 1250)
{DutyCycle = 1250;SpeedIntegral = 0;}
PDC1 = DutyCycle;
PDC2 = PDC1;
PDC3 = PDC1;
}
//---------------------------------------------------------------------
// This is a generic 1ms delay routine to give a 1mS to 65.5 Seconds delay
// For N = 1 the delay is 1 mS, for N = 65535 the delay is 65,535 mS.
// Note that FCY is used in the computation. Please make the necessary
// Changes(PLLx4 or PLLx8 etc) to compute the right FCY as in the define
// statement above.
void DelayNmSec(unsigned int N)
{
unsigned int j;
while(N--)
for(j=0;j < MILLISEC;j++);
}
 
well if the budget is $150 then make it simple and get:

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en537020

though programming will not be simple :? as it will be like taking your
first swimming lesson in the middle of the Pacific....

very interesting: the application notes on the same page !
(not the video's, the pdf's). I build my sensorless controller
differently by the way....

What kind of controller do you have in mind ? sensor or sensorless ? Just simple
PWM type throttle or more advanced ? You want to include automatic timing
shifting ? Note: for a simple sensored PWM type controller you don't need a
processor or even a dedicated IC, just some gates should do it...

I build a sensorless controller around a PIC16F88 which is supposed to be supplied
from a variable DC power source. I can publish schematic and code as a starting point
of the discussion ?
 
Lebowski said:
well if the budget is $150 then make it simple and get:

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en537020
Looks apealing but for me I think starting from scratch is better.


Lebowski said:
I build my sensorless controller
differently by the way....

What kind of controller do you have in mind ? sensor or sensorless ? Just simple
PWM type throttle or more advanced ? You want to include automatic timing
shifting ? Note: for a simple sensored PWM type controller you don't need a
processor or even a dedicated IC, just some gates should do it...
100hp for now ;) I am thinking I will work my way up to 150 or more volts and as many phase amps as I can (600+)
I want everything from full timing controll to phase amp monitering to variable regen of a proper brake lever not a throttle! I will start simple and work my way up this will be open source so everyone can build one or have one if they want someone else to build it!
Lebowski said:
I build a sensorless controller around a PIC16F88 which is supposed to be supplied
from a variable DC power source. I can publish schematic and code as a starting point
of the discussion ?
Yup lets get this thread hopping thanks for your help!
 
Here is another link to one for 150 http://www.spingarage.com/froboard
It has a pic18f4431 chip and seems to be quite cabable. Andrew is going to test it with a big IGBT he has for me and let me know how it works.

It is probably a good time to point out I plan to run IGBT's only because of the cost and avilablitiy once I have it working I will concider more giant fets.

For me this bord is real ev stuff not lame little girly ebike projects although some of you can use it for that and I might in the future as well. I plan to run very hi phase currents and the highest voltage needed to get a good top speed for my project.
 
Well my setup is for a lame little girly bike :oops: 'cause the cops here in switzerland are not the little girlies they have in the USA :D so I want to keep stuff legal.

But things like engine power and what voltage / current you want to run only depends on your output stage, not on the
algorithm running on the processor. So, feel free to choose other components than I have, at some point though
the control signals for your output stage are going to be similar to mine.


This shows the power stage for one of the 3 motor phases (I use A, B and C for names). The 78xx and 79xx are only
build once and shared by all phases. I use NMOS and PMOS transistors for the output stage, so not the more typical
all NMOS. This because it makes it easy to turn on the high-side PMOS transistor without the need for a supply
higher than the main battery voltage. Also the gate of a high-side NMOS needs to track it's source which is just
plain nasty with the fast transients present due to PWM. Plus it will probably need 3 high-side voltage supplies
if you want to use a gate-driver / optocoupler combination like I do.

The NMOS is driven directly from a PIC pin via a TC4427A buffer (to make 12V swing at 1.5 amp drive capability)
The PMOS is more complicated. It's driven via an optocoupler and again a TC4427 gate driver. The optocoupler
is a fast type for use in digital data transmission (capable of several megabit/sec) so there'll be no delay in driving the PMOS.

The PIC16F88 makes only one PWM signal which is used by all PMOS transistors. When the PWM signal is high it grounds one
side of the opto couplers diode. The other side of the diode is driven directly from the PIC. In this way whatever
PMOS you want to turn on is automatically modulated by the PWM signal.
Since I built a sensorless controller the PIC needs analog information from the motor phases. This is the little circuit on
the bottom right. The motor voltage (up to 80 V in my case) is devided down by the resistive divider. A capacitor is
added to filter away PWM residue on the motor signals. The zener diode protects the PIC from overvoltage. Each motor
phase is connected to an ADC input of the PIC.

For higher voltage / current application you just need to use different output transistors and make sure the drivers
can handle the bigger transistors (it's the gate-charge in the transistor spec that counts). Also the 33K in the ADC
input circuits needs to be increased for higher voltage....

P.S. excuse me the broken English but I'm Dutch originally :D

Oh, here in Switzerland I buy all my components at Farnell, this is where you can easely find datasheets for the
HPCL2631 optocoupler, the TC4427A gate driver and so on
 
Ahh, I see I'm not the only one using PMOS devices :). I'm developing an h-bridge for a 250W DC-brushed motor (some details in this post) and used IRF4905, the PMOS with the lowest RDSON (20mOhm) I could find and get.

The current reading part of your schematics, is for alarm only or "continuous" measurement?
 
Njay said:
Ahh, I see I'm not the only one using PMOS devices :). I'm developing an h-bridge for a 250W DC-brushed motor (some details in this post) and used IRF4905, the PMOS with the lowest RDSON (20mOhm) I could find and get.

The current reading part of your schematics, is for alarm only or "continuous" measurement?
The 4905 is a 55V device while my motor will run upto 80, the 5210 is 100V (and only costs half, am a cheap bastard :? )
Plus, all things are relative... the resistance per winding of my motor is 0.65 Ohm so the 0.06 Ohm of the
5210 is negligible, 0.02 is overkill (especially when they cost $6 more than the 5210)

I have no current reading part ? The analog bit on the bottom right is for measuring the
back EMF of the floating motor phase to determine the switching point (it's sensorless)
 
Lebowski said:
The 4905 is a 55V device while my motor will run upto 80, the 5210 is 100V (and only costs half, am a cheap bastard :? )
Plus, all things are relative... the resistance per winding of my motor is 0.65 Ohm so the 0.06 Ohm of the
5210 is negligible, 0.02 is overkill (especially when they cost $6 more than the 5210)
Yes, my bridge is for 24V, so for a 250W motor I really needed the lowest RDSON I could get. Definitely not your case!
$6 more?! I bought the 4905 for 1,01€ each (VAT included) at tme.eu ...

Lebowski said:
I have no current reading part ? The analog bit on the bottom right is for measuring the
back EMF of the floating motor phase to determine the switching point (it's sensorless)
Ahh, ok. Otherwise my next question would be how were you dealing with the temperature changing RDSON :)
 
Arlo, you know I commend you in this effort.

I need to search the other threads and find why you chose the pic18f2431, in my opinion you want to be in the dspPIC family. If I were recommending it would be somewhere around the dsPIC30F3010-30I/SO or a dsPIC30F2010 as a bare minimum. AN 957 would be your starting point.

All the problems we are having with low inductance, low resistance motor control are residing around speed in the phase current sensing loop. I am headed in the direction of taking that function out of software and putting it back into hardware. These are not little sissy air conditioning cooling fans we are controlling!

What I want to suggest is that you think through that dI/dt stuff we have been talking about based on motor constants. Now assume you are going to measure phase current directly so that we are up in the next class of controllers.

Think through the timing loop:
1) Motor current reaches redline
2) Current sensor reads and transmits its actual current + x.x uSec
3) ADC reads the input via polled loop+ x uSec
4) Processor figures out what to do with the input +x uSec
5) Processor shuts off FETs because we are going to blow! + x uSec

Now go back and look at the currents from my spreadsheet or an analytical analyses. If the current is actually at the redline; calculate what it will be with the above delay to see if you let smoke out of the FETs. I think you will see the very fast processing speed we need, or we need a different topology and must move it to hardware. The delay in current sensing is significant.

Consider the IR2113S as the FET driver with an emitter follower current to amplify drive current.

Consider isolated 12 volt supplies for each FET driver in place of bootstrapping.

Consider that some IGBT's need -5 to -8 volts on the gate to get the turn off fast, and this would result in a different driver topology.

You know I'll do my best to comment and help you in this thread.

I just want to say going in, that this will not be an easy project. Consider at least 3 board turns to get a stable system. One glitch in firmware will cost you the board. ... this stuff is not easy at our power levels.
 
I have thought about the current limiting problem; I haven't done any experiments yet, but I'll share my thoughts anyways. This is just analysis without trying to reach any conclusions yet.
My context is that of DC brushed motor control, but it should apply to brushless as well. The controller has a shunt for current measurement and an AVR uC (microcontroller) for brain, and I wanted to use as little hw as possible.

First option is to use the ADC to do current reading from the shunt and act upon those readings. This was quickly overturned because the AVR can do at most a conversion every 13us - too slow.

Then I checked the possibility of using the AVR's internal voltage comparator (most uCs have such comparator). The datasheet shows that it has a typical propagation delay time of ~500ns. This is also slow, because this is not a "maximum" value (just "typical") and I was hopping to get the MOSFETs switching in a time a bit shorter than this.

So that lead me to the 3rd option: an external fast voltage comparator. I choose an LM119 to try; these old school chips are very easy to get and cheap too. From the datasheet, I believe I can make it react in some 200ns in my system. I haven't tried it yet.
The comparator's output will trigger a "pin change interrupt" on the uC. Triggering this interrupt has 5 CPU clock cycles maximum delay, plus other cycles needed to turn off the MOSFETs. Assuming I need to do only 1 uC port write to disable the power section, that's another 2 cycles, total 7 cycles. At 16MHz clock, that's 437.5ns (350ns at 20MHz, which the AVR can be run at). So that's 200 + 438 = 638ns.
There are still other delays to add: MOSFET driver propagation delay and MOSFET switching time. In my case I have measured it at ~500ns (from driver's input to MOSFETs ON). Leading to the grand total of 638 + 500 ~ 1.14us . For the motor I'm using this is a piece of cake, but one day I'll want to drive a Lynch.

The uC will sit in a loop taking orders from an external entity (through i2c) and "slowly" measuring average current & temperatures with the ADC (to report). On a current limiting event, everything runs on the background through the interrupt.

update: fixed minor English issues
 
Njay you just made one of those "great leaps for the eRevolution"! Now go the next step and think how you can remove the processor entirely from the shut down event. You set the current limit to the comparator with a DtoA, the DtoA can be slow. The comparators and/or the DA's can be internal or external to the processor. In my implementation I like the comparator external, it must be fast. Now think what you put between the comparator and the FET driver to do the deed. It must be fast.

Your getting there! I hope you will excuse me, but I have to get at this a bit obtusely because of "restrictions."

The final hurdle will be a fast current transducer in the 500 amp range.
 
bigmoose said:
Njay you just made one of those "great leaps for the eRevolution"! Now go the next step and think how you can remove the processor entirely from the shut down event. You set the current limit to the comparator with a DtoA, the DtoA can be slow. The comparators and/or the DA's can be internal or external to the processor. In my implementation I like the comparator external, it must be fast. Now think what you put between the comparator and the FET driver to do the deed. It must be fast.

Your getting there! I hope you will excuse me, but I have to get at this a bit obtusely because of "restrictions."

The final hurdle will be a fast current transducer in the 500 amp range.
I was thinking this as well we don't need the processor to shut the fets off if it senses the current to high we can just design a circuit to do it before the processor gets a chance to know whats going on. I was also thinking its possible to "MAP" what is allowed to flow for current. So we can try to have the processor aim for a current depending on throttle position. Basicaly by maping the PWM VS RPM VS TEMP VS TPS. Then have the safety shut off on the fet drivers as our last resort thing. Hmmm gets me thinking dataloging hmmmm sure be cool to log what the controler did up to the point the fets were cut off to save them.
 
bigmoose said:
Arlo, you know I commend you in this effort.

I need to search the other threads and find why you chose the pic18f2431, in my opinion you want to be in the dspPIC family. If I were recommending it would be somewhere around the dsPIC30F3010-30I/SO or a dsPIC30F2010 as a bare minimum. AN 957 would be your starting point.

All the problems we are having with low inductance, low resistance motor control are residing around speed in the phase current sensing loop. I am headed in the direction of taking that function out of software and putting it back into hardware. These are not little sissy air conditioning cooling fans we are controlling!

What I want to suggest is that you think through that dI/dt stuff we have been talking about based on motor constants. Now assume you are going to measure phase current directly so that we are up in the next class of controllers.

Think through the timing loop:
1) Motor current reaches redline
2) Current sensor reads and transmits its actual current + x.x uSec
3) ADC reads the input via polled loop+ x uSec
4) Processor figures out what to do with the input +x uSec
5) Processor shuts off FETs because we are going to blow! + x uSec

Now go back and look at the currents from my spreadsheet or an analytical analyses. If the current is actually at the redline; calculate what it will be with the above delay to see if you let smoke out of the FETs. I think you will see the very fast processing speed we need, or we need a different topology and must move it to hardware. The delay in current sensing is significant.

Consider the IR2113S as the FET driver with an emitter follower current to amplify drive current.

Consider isolated 12 volt supplies for each FET driver in place of bootstrapping.

Consider that some IGBT's need -5 to -8 volts on the gate to get the turn off fast, and this would result in a different driver topology.

You know I'll do my best to comment and help you in this thread.

I just want to say going in, that this will not be an easy project. Consider at least 3 board turns to get a stable system. One glitch in firmware will cost you the board. ... this stuff is not easy at our power levels.
I can order what ever chips I want to continue I will read in to the dsPIC chips you sugested.
I have 7 12v-12v isolated dc-dc converters on their way.
I ordered everything on the list for the LOBO controller from Jeremy's thread.
And I Want to make a somewhat universal output stage. I have blow up over $1000 worth of 18fet,24fet,12fet,6fet and VMM-650 monsters so blowing up a couple circuit boards is expected and I am not worried about it because hopefully I will learn from it and change things for the next bord. This wont be an over night thread but I am doing it 100% I love this stuff.
Now at the same time did you see on the inductance thread I am working hard to find more inductance for collossus? I think I can get about 2 times just by winding it very tight for the same KV but it seems I might want to wind it for 1/2 the KV and double the voltage.....
 
Ok so whats the best Chip we can look at for this it seems the dsPIC30F3010-30I/SO is pretty good. It would be nice to get one I don't have to solder so I can yank it from a blown board and move it to the next. Any other good PICs or dsPICs to look at other then what bigmoose pointed out? Maybe another family?
 
bigmoose said:
Njay you just made one of those "great leaps for the eRevolution"!
Not sure how I did that but I'm happy anyway :D

bigmoose said:
Now think what you put between the comparator and the FET driver to do the deed. It must be fast.
In my drivers, since they're discreet, I would do this:

This would actually reduce the "MOSFET driver reaction time" because Q1 would be out of the way.

In a more general case, assuming the driver is a black box with a relatively high impedance logic input and an output to the MSOFETS's gates, I guess I would look into logic gates. They can be damn fast (10 - 20ns propagation delay).

Above you also have another idea from Lebowski, acting on the optical couplers.

I haven't checked the integrated MOSFET drivers panorama yet, but maybe there are some with an "EN" pin with fast enough response time. That would be perfect.

bigmoose said:
The final hurdle will be a fast current transducer in the 500 amp range.
Yes! That is a problem too. I've been gathering info for some time:

1) Shunt. Has obvious problems in the form of power dissipation or, if going to a really low value in order to minimize that, signal conditioning/sensitivity. Apparently commercial companies have done it, measuring the voltage drop across the bus bars themselves...

2) Hall sensors. The bigger hall current sensors I've seen are too slow, in the order of 1..4us reaction time. The smaller, simple hall sensors seem slow too, with similar reaction times (they have lots of electronics inside). I don't know if there's anything faster, and affordable.

3) Current mirror technique. I haven't yet studied nor fully understood how this works, but here's a reference: http://www.4qdtec.com/mircl.html

4) There are some MOSFETs with an extra pin for current sensing, I haven't studied this either, but they are not "big" MOSFETs as we would need.

One thing I noticed from the "Inside a 400amp 120v BLDC Kelly" thread by LFP was that the sevcon seemed to use hall current sensors.

Arlo1 said:
Any other good PICs or dsPICs to look at other then what bigmoose pointed out? Maybe another family?

There is the Xmega family of "beefier AVRs", but I have no experience with them. I know they have DACs, and faster ADCs and specialized hw for BDLC motor control: http://www.atmel.com/dyn/resources/prod_documents/doc8077.pdf
 
Arlo1 said:
And I Want to make a somewhat universal output stage. I have blow up over $1000 worth of 18fet,24fet,12fet,6fet and VMM-650 monsters so blowing up a couple circuit boards is expected and I am not worried about it because hopefully I will learn from it and change things for the next bord. This wont be an over night thread but I am doing it 100%
How do you test stuff? Sometimes it's just a matter of testing by stages as you build it, so that you can correct things before they blow.

Arlo1 said:
I love this stuff.
Just a big :)

Arlo1 said:
Now at the same time did you see on the inductance thread I am working hard to find more inductance for collossus? I think I can get about 2 times just by winding it very tight for the same KV but it seems I might want to wind it for 1/2 the KV and double the voltage.....
If you're going to design your own controller, why not just design it for colussus specs and drop external inductors?
 
Njay said:
If you're going to design your own controller, why not just design it for colussus specs and drop external inductors?
Yup. The external inductors are just a crutch till I figure out a better solution.
Maybe you misunderstand what I ment. To run collossus with 4 turns x two strands parallel vs 8 turns and double the voltage with no external inductors. The nice thing is I have a stock wound collossus and a dissambled unit to test with.
 
Njay said:
Ahh, ok, a temporary solution.
Yup a big part of why I want to build my own controller :wink: Well that and my car needs to quit burning gas and flow more electrons!
 
Njay you better stay around, or we are going to go looking for you! I like how you design!! :D

I picked the IRS2113s for it's shutdown pin, SD. tsd = Shutdown propagation delay of about 130 nS. About as good as the turn on/turn off time. I think you will want to make use of the SD pin on the IRS2113. :mrgreen:

Next, think of the micro as enabling or starting the PWM cycle. Let's close the loop in hardware to terminate the conduction during the PWM period at our desired current set point. Think how you would do that function! :mrgreen: I'll comment as the ideas come out. (I have always thought we should base our designs on current control and not PWM period control. Then the throttle is a torque knob! ...just like the gas pedal.)

The more you dig you will find why I picked the dsPIC30F3010-30I/SO. I have also designed around the TI TMS320F240 but no one here is going to be able to afford the compiler.
It is good that you ask for other options, but make sure the recommendations are from folks who understand our cycle time need, ADC time, etc. There are many chips that we could use to make a variable speed BLDC motor to run our air conditioner fan.

This will be a good design, I think.
 
bigmoose said:
Njay you better stay around, or we are going to go looking for you! I like how you design!! :D

Funny you say that. I just joined a boat forum to send Jeremy Harris a message to come on back!
bigmoose said:
Next, think of the micro as enabling or starting the PWM cycle. Let's close the loop in hardware to terminate the conduction during the PWM period at our desired current set point. Think how you would do that function! :mrgreen: I'll comment as the ideas come out. (I have always thought we should base our designs on current control and not PWM period control. Then the throttle is a torque knob! ...just like the gas pedal.)
This is what I was thinking and the controll based on current is what we need to stay away from blown up shit to begin with! (well a big part of it)

bigmoose said:
The more you dig you will find why I picked the dsPIC30F3010-30I/SO. I have also designed around the TI TMS320F240 but no one here is going to be able to afford the compiler.
It is good that you ask for other options, but make sure the recommendations are from folks who understand our cycle time need, ADC time, etc. There are many chips that we could use to make a variable speed BLDC motor to run our air conditioner fan.

This will be a good design, I think.
Yeh we need a chip to be cheep enough but yet suite our needs and Like sevcon we dont need a uber expinsive way of flashing it! I think to get started ~$75-$100 for a programing controller with a couple chips is ok then $3-$15 a chip for future controllers is a good price point! Some of the stuff has serial if I read corectly but its hard to find a computer with a db9/serial port nowadays!
 
Yea the TI compiler was like $3 or $5 grand for the TI Code Composer Studio, and the Keil compiler for the Cygnal chips is like $2 or $3 grand. Mainstream dsp compilers are good, but get expensive real fast.

Njay now look at your schematic. Notice that it will shut off the FET's when the current reaches it's threashold. But, what happens when the current falls, and we are still in the PWM period? Well it re-energizes. I do not think we want that. As Captain Marko Ramius said in the movie Hunt for Red October, 1 ping, 1 ping only Vasili! I think we should only have one shot at reaching maximum current per PWM period. So what cute little and cheap device can we put between the comparator output and in your case the emitter follower and in my case the shutdown pin of the FET driver :?:
 
bigmoose said:
So what cute little and cheap device can we put between the comparator output and in your case the emitter follower and in my case the shutdown pin of the FET driver :?:
How about a SR flip-flop or latch. That is, the over current signal gets latched and then reset by the micro contingent on certain requirements such as reducing the throttle to zero momentarily.
 
mauimart, you just took the second great step for the eRevolution!

This is just too easy!

You now hold two of the 5 rings needed for your journey, said Gandalf.

gandalf_smoking.jpg
 
I found some good reading here http://www.ixysrf.com/pdf/switch_mode/appnotes/5mosfet_driver_theory_and_applications.pdf
 
Back
Top