BLDC
by Fred Eady
HARDWARE
PART 3
IHowever, before we transition our fingers from spinning
the BLDC motor shaft to tapping out some BLDC motor
t's time to get cerebral with our BLDC motor project.
code, I have a confession to make. Before I relate my
experiences, though, let's have a moment of silence for
the fallen Microchip TC4428 and Fairchild NDS9952A parts
that are littered all over my workbench under a cloud of
"magic smoke.”
My hot air soldering station has been very busy
removing "exhausted" chips from the pair of prototype
BLDC motor controller printed circuit boards I'm using to
support our motor controller project. I built up a second
PCB without the chips, but with the intention of writing
and testing as much of the motor controller firmware as I
could without having to worry about accidentally smoking
the three phase circuitry. I figured that everything was
going as planned. In my mind, I was on
the road to success with only a small
bug to root out and fix.
I was having a problem with PWM0
that was presenting itself to me visually
via the PWM0 activity LED. After some
head scratching, I finally found that I
had configured PWM0 and PWM1 as
complementary PWM outputs instead of
independent PWM outputs. The PWM0
LED no longer acted funny after I
switched the PWM0 and PWM1 output
pair to independent mode. Without the
PWM0 LED indicator, I would have not
caught the bug until later in the
firmware testing process since at the
time I was not looking at the output
of the PWM pairs simultaneously using
an oscilloscope.
The LEDs saved the day yet again
when I noticed that PWM4 and PWM5
on the PCB didn't match the definitions
in the test code I was executing. After
getting down off my donkey, I found that I had "assumed"
that the PWM signals were laid out in numerical order on
the PORTB pins of the PIC18F2431. In fact, if you take a
look at the PIC datasheet, you'll see that PWM4 is presented
on RB5 instead of RB4 as I "assumed.” A couple of pieces
of wirewrap wire and two precise moto tool-assisted trace
removals fixed that problem. At this point, I'm looking very
closely for more "assumption bugs" before moving on with
my firmware testing.
Satisfied that I had conquered all of the problems, I
mounted the TC4428s and NDS9952As on the prototype
PCBs. I figured I'd play it safe and not electrically attach the
BLDC motor to the controller electronics at this time. The
absence of the BLDC motor coils would eliminate the
possibility of passing any harmful overcurrent levels through
the NDS9952A output pairs. To add some extra "no smoke"
PHOTO 1. No major changes were made to the updated BLDC motor controller
hardware. I simply fixed some trace boo-boos and tied the VM voltage output
to a dedicated analog-to-digital input on the PIC18F2431.
SERVO 02.2009
45