SPRUJ55D September 2023 – July 2025 AM263P2 , AM263P2-Q1 , AM263P4 , AM263P4-Q1
The coil of a Resolver needs an excitation signal which gets modulated as per the shaft rotation. This excitation signal, modulated as per the rotation of the shaft is then output as the sine and cosine outputs of the resolver.
To generate the excitation signal, the Resolver sub-system in AM263P generates a Sinusoidal PWM signal(RESx_PWMOUTx) where the PWM's duty cycle is modulated as per the Sine excitation signal. This PWM signal needs to be passed through an external low pass filter to obtain the sine excitation signal. Refer Figure 7-147 below, showing ALM2403-Q1 application for example.
The excitation signal is a sine wave with a programmable frequencies of 1KHz, 5KHz, 10KHz, and 20KHz with programmable phase of 0 to 360°. The Resolver Sub-System outputs this Sinusoidal PWM as RESx_PWMOUTx on Mux Mode 8 of AM263P MCUs ball pins namely, PR0_PRU1_GPIO8, PR0_PRU1_GPIO10, PR0_PRU1_GPIO13, PR0_PRU1_GPIO14.
Figure 7-146 Excitation Signal Generation through PWM (Example for 20KHz)
Figure 7-147 Filter and Amplifier Circuit Converting the RESx_PWMOUTx Signal to an Analog sine Wave Driving the Resolver Excitation CoilThe PWM base frequency must meet the requirements of external excitation amplifier’s second order low pass filter, and must be at least 32 times the maximum supported frequency. Using a 800KHz PWM frequency meets that requirement with it being 40 times the highest excitation frequency of 20KHz. RDC can tolerate a second or third harmonic for the excitation signal up to 10% at the final resolver output.
The PWM generation circuit is shown below in Figure 7-148.
Figure 7-148 PWM Generation Circuit
Figure 7-149 PWM Generator Block
Figure 7-150 PWM Comparator Output (top), and Output of the Counter and Sine Wave (bottom)The top plot of Figure 7-150 shows the PWM comparator output, and the bottom plot shows the output of the counter and sine wave which are inputs to the pwm comparator. Note the sine wave signal attenuation to avoid clipping. This example shows a 20KHz sine wave generation with 40 pulses per sine wave period.
For PWM generation, a 250-counter counts from 0 to 249 with 200MHz clock. That generates a periodic sawtooth waveform at 800KHz as shown in Figure 7-150. The overflow counter triggers 8000-counter that counts from 0 to 7999 with steps of EXC_FREQ_SEL(register REGS_EXCIT_SAMPLE_CFG1[7:0]). That counter also generates a sawtooth waveform at 800KHz (in total sync with 250-counter) counting from 0 to 7999. After scaling with * 8.192, this value controls a lookup table of 16 bit sine wave entries. The 16 bit values are multiplied by the gain control EXT_AMP_CNTRL(register REGS_EXCIT_SAMPLE_CFG3[7:0]), then left shifted (divided by 216), resulting in a 8bit digital sine waveform. If ext_amp_cntrl = 250, then the gain is 1. If it is 225, then gain is = 225/250 = 0.9. Further 125 is added to this signed sine wave, and it goes to a comparator comparing it to the incoming sawtooth waveform generating PWM signals.
The RDC over-samples the excitation frequency with a programmable integer number, and based on that, a table is provided for supported excitation frequency and oversample ratio combinations. Note that oversample OSR = ADC_SAMPLE_RATE(register REGS_EXCIT_SAMPLE_CFG1[7:0]) × 2, and effective excitation frequency Fexc = 100 × EXC_FREQ_SEL in Hz.
This PWM excitation block also supports synchronizing ADCs that sample the motor current with the resolver ADC SOC(start of conversion) signals as shown in Figure 7-151.
The sync pulse(PWMSYNCOUT_XBAR[2]) coming from the motor-PWM-ADC latches the 8000-counter, which indicates the precise phase information. Note that motor PWM might be an integer multiple of excitation frequency, in this case it may trigger the latch at multiple equal intervals of the counter. The user needs to decide which one to use as the resolver ADC sampling time. By reading PWM_PHASE_INFO(register REGS_EXCIT_SAMPLE_CFG2[12:0]) and programming the SOCPEAK_START value, user can control the phase of the resolver ADC SOC (Start Of Conversion) signal. Also if a phase difference is desired between those signals, it can be easily implemented by offsetting this value. SOCPEAK_START and PWM_PHASE_INFO registers map 0 to 7999 to 0 to 360° × (7999/8000). Ideally the resolver ADC should also sample the sine and cosine coils at the peak of the excitation signal. After the motor PWM ADC and resolver ADC sampling times are synchronized, through the phase control of resolver PWM (EXC_FREQ_PHASE_CFG part of register REGS_EXCIT_SAMPLE_CFG1[28:16]), the excitation signal peak needs to be aligned. This can be achieved by software monitoring the (sin2 + cos2) signal and shifting the phase until maximum value is achieved, thus compensating for any phase delay on board.