Content originally posted in LPCWare by Tapio on Mon Feb 13 05:28:42 MST 2012
Hello,
I'm having problems using BLDC with LPC1751 and custom PCB.
A brief description of my project:
I made a circuit similar to app. note AN10898. I used same pins and ports as there is in the AN10898 so that I can eliminate as much as possible errors. Also fet driver circuits are similar. I have tested that electronics are ok by driving GPIO's up and down with systick.
I downloaded the sample code LPC1700_BLDC which is made with Keil. At first I converted it to LPCXpresso with no luck after programming my device. Then tested it directly with Keil.
The motor can be enabled by giving following values:
/* Enable the BLDC motor */
BLDC_Enable();
PID_Motor.Brake = DISABLE;
PID_Motor.Enable = ENABLE;
And this code above is written just before the while(1)-loop.
I'm just hearing a buzzing sound from the motor coils. I have tested my project with two differend EC-motor with the same result. And I know how to wire those motors because I have done that with a different motor controller.
By looking with oscilloscope, it seems that my motor controller is trying to start with no luck. There are single pulses coming to power mosfet gates. By single pulse I mean periodical pulse which is not pulse width modulated pulse (not a "large" pulse that consists of many smaller pulses). I haven't studied the code but maybe duty cycle of PWM is 100 % at start-up. Anyhow, it also seems that these pulses are almost at same phase with each others and it means that there is a risk that my fet bridge starts to heat even with no load (periodical shortcut). I haven't done any changes to the sample code, except now it starts automatically the motor when the device is powered up. I have also tested all variations with this set of code (in bldc.h -file):
/* Choose between HALL or QEI */
#define USE_HALL 1
#if (USE_HALL == 0)
#define USE_QEI 1
#endif
/* Choose between MCPWM or GPIO interrupt feedback */
#define USE_MCPWM_FEEDBACK 0
So there is no difference between interrupt GPIO or MCPWM. I have also tried to give different values to p-term of the PID (10, 100 and 1000) and the motor won't start. In the function BLDC_commutate, I have also uncommented the line:
PID_Motor.mv = PID_Motor.Period/2; // Checks that PID isn't causing any failures
If I spin the motor with my hand to help it to start (to give an interrupt with halls and make it commutate the motor), there will be a larger shortcut in the fet bridge. Luckily I have 15 amps automatic fuse relay in the power line to prevent this kind of errors to cause any damage.
This sample code is made originally for LPC1768 so I'm just wondering if there is something that bugs me to use this with LPC1751?
Any suggestions how to proceed because I'm feeling a bit helpless?
Thank you in advance!
BR,
Tapio