No, it is "old" ARM7, but really cheap. Should be more than enough to the task and I can change at any time if needed.grindz145 said:Sweet little dev board is that LPC2103 processor an ARM9?
I think we need OpenSource controller AND with commercial/professional support.Arlo1 said:Just found this thread. Very cool we need more diy controllers!!![]()
casainho said:KUxxx controllers seems to be optimized for cost and are complex for me to understand, also they can't measure current only the maximum current -- I really want to measure current and voltage.
Njay, I am using the KU63 circuit and giving it the control signals, please find here the PDF schematic of KU63: http://www.avdweb.nl/solar-bike/electronics/ku63-motor-controller.htmlNjay said:Not directly related to your comment but, most MOSFETs have an absolute maximum of +/-20V between gate and source and you have "gate signals" of some 24V; what and how are you exactly measuring on the yellow line?
Yes, you are correct. I am now using ACS756 sensor, is expensive but I may be able to measure current in steps of 500mA (or less) and I need it because I want to calc the power usage by the motor and show it to user. This expensive sensor is good for DIY circuit prototype/development.Jeremy Harris said:casainho said:KUxxx controllers seems to be optimized for cost and are complex for me to understand, also they can't measure current only the maximum current -- I really want to measure current and voltage.
FWIW, the shunt is the current sensor on the KU series controllers, and drives two independent current sense circuits, so the controller does in fact sense voltage and current linearly (as do all the other ebike controllers I've seen). One of these current sense circuits is an A/D input on the µcontroller that does the normal linear current limiting function, so that there is a smooth reduction in PWM duty cycle as the battery current tries to increase above the set limit. The other is a fault detection over-current sense circuit, that uses an internal comparator in the µcontroller to shut it down, via an interrupt, if a fault condition is detected.
Hmmm, I need to see if there is some problem with KU63 controller... here is the PDF schematic of KU63: http://www.avdweb.nl/Article_files/Solarbike/Motor-controller/China-BLDC-motor-controller-36V-250W.pdfJeremy Harris said:I agreey with njay, the FET gate drive voltages need to be kept down well below 20V. 12 to 15V is fine for gate drive.
I understand what you said. If someday I will design something commercial/cost optimized, I will use this info.Jeremy Harris said:The standard KU series controllers use a 10 bit A/D and can measure current down to under 500mA. They are resolution limited by the A/D max range and the inevitable noise on the supply line, but I believe they use the internal 1.24V reference in the µcontroller to set the A/D range, so 1 bit is around 1.2mV. This gives a current resolution of around 0.3A for a 4 mohm shunt. It's debatable if you need better than 1/2A resolution for limiting, anyway, IMHO.
I found that it was perfectly feasible to measure the voltage across a 4 mohm controller shunt and use it to provide a display of power that was accurate enough for most purposes. My original simple battery "fuel gauge" does this to calculate Ah used (there's a thread here somewhere describing it).
unsigned int rotor_find_position_sector (void)
{
unsigned int sector_current[6];
unsigned int max_current = 0;
unsigned int max_current_sector = 0;
unsigned int i;
motor_set_duty_cycle (1000);
for (i = 0; i < 6; i++)
{
commutation_sector (i + 1); // start energize the sector
delay_us (50); // wait 50us
// read the current, 4 samples and average/filter
sector_current[i] = 0;
sector_current[i] += (adc_read (CURRENT) / 4);
sector_current[i] += (adc_read (CURRENT) / 4);
sector_current[i] += (adc_read (CURRENT) / 4);
sector_current[i] += (adc_read (CURRENT) / 4);
commutation_disable ();
delay_us (50); // wait 50us
// verify and save the higher current sector
if (sector_current[i] > max_current)
{
max_current = sector_current[i];
max_current_sector = i + 1;
}
}
commutation_disable ();
return max_current_sector;
}
Thanks! I may update later this piece of code. For now, it is here: https://github.com/casainho/EBike-Smart-Controller/blob/master/firmware/bldc.cNjay said:May not be that important in this application but that's not a good average, you're loosing data. The integer binary divide always rounds down. So you should add all up and divide at the end - even better, round by adding half divisor prior to divide. Further it's less efficient, you're dividing 4 times instead of 1.
Eheh, yes, it is JorgeNjay said:Às tantas é o Jorge![]()