July
2005, Issue 180
Solar-Powered
Water Pump Controller
Cypress
PSoC High Integration Challenge 2004 Contest Winner
ISRs
There
are three main interrupt sources in the pump controller.
The most active is the CY8C27443’s 8-bit sigma-delta
ADC ISR, which samples at a frequency of 10,416 Hz.
The ADC samples are intercepted and processed by the
background thread. The internal temperature-sampling
ISR uses a relatively slow 166-kHz clock to minimize
the CPU’s loading. It’s triggered once every second
to infer the ambient temperature of the sealed pump
inverter cabinet.
The
second most active is the inverter three-phase waveform
generator ISR, which operates at the switching frequency
of 5,859 Hz. It generates a composite waveform of preprogrammed
gain and frequency by triggering at each terminal count
of PWM-A corresponding to the start of each switching
period. The generator steps through a 360° look-up table
containing a normalized composite sine wave at a variable
phase velocity that’s proportional to the desired output
line frequency:

where
N represents the entries in the look-up table (256).
FS is the switching frequency (5,859 Hz). FL is the
line frequency (25 to 65 Hz).
All
three PWM generators use a phase position variable by
accessing the look-up table at offsets of 0°, 120°,
and 240°. The sine wave values are stored in a normalized
form in the look-up table with the 0 through 127 representing
0 through 100%.
The
sine wave values for the three phases are instantaneously
multiplied by the inverter’s output using the single-cycle
MAC unit in the CY8C27443. The resultant values are
then renormalized by dividing the result by 128 and
then loaded into the PWM duty cycle registers. The MAC
unit’s numerical range enables the output gain to have
a range from 0 to 127, which corresponds to 0 to 100%
of rated voltage output.