AN 994: Drive-on-Chip Design Example for Intel Agilex® 7 Devices

ID 780361
Date 6/26/2023
Public
Document Table of Contents

7.3.5. Motor Control Modes

The Drive-on-Chip Design Example supports various control algorithms and commutation modes.
The design supports:
  • Open-loop Volts/Hz speed control with sinusoidal commutation
  • Speed and position control with field-oriented current control (FOC), sinusoidal commutation with quadrature encoder or resolver feedback The design implements this mode in software or a combination of software and hardware using FOC IP.

Open Loop

The design supports open loop control using sinusoidal commutation and trapezoidal commutation. The design uses Volts per Hz control in which the voltage the design applies to the motor increases with increasing frequency (motor speed). After each interrupt the interrupt service routine (ISR) updates a ramp generator to represent the motor electrical angle based on the previous angle, desired speed, and sample rate. The ISR calculates the voltage to apply using a Volts per Hz control gain based on the frequency and motor parameters. In open loop sinusoidal commutation, the ISR applies the inverse Park Transform and SVM function from FOC to generate sinusoidal commutation.
Figure 27. Open Loop Sinusoidal Commutation

FOC with Position Sensor Feedback

The design supports FOC sensor control where the motor position feeds back to form a closed loop with position and speed PI control. The design senses the motor position by incremental (quadrature) encoders.

The design samples and uses the motor phase currents as feedback to the FOC algorithm.
Figure 28. FOC with Position Sensor Feedback

High-speed FOC with Position Sensor Feedback

The high-speed FOC sensor mode closely resembles the standard FOC with position sensor feedback mode, but operates at 64 kHz instead of 16 or 32 kHz. In this mode, the design performs the FOC calculation only with the FOC DSP Builder IP. Phase currents U and W are directly connected to the sigma-delta ADC interface. The output space vector modulation PWM values are directly connected to the six-channel PWM interface.

The ADC interface operates at 64 kHz and is synchronized with the PWM to eliminate FET switching noise from the power board. The software can run at 96 kHz, but the Tandem board limits the frequency to 64 kHz. The high-speed mode only supports the DSP Builder fixed-point design. It does not support floating point or software fixed point.

Figure 29. Block diagram for high-speed FOC connection

The figure shows the high-speed FOC connection. In the diagram, bold lines represent the Avalon interface, single lines indicate the direct interface, and blue lines indicate one item triggers the next. ISR uses interface IP and algorithm acceleration IPs for control and diagnostics. The ISR calls Avalon memory-mapped interfaces

Figure 30. Timing diagram for high-speed FOC The figure shows the timing diagram for the high-speed FOC. Although the software operates at 32 kHz, the FOC DSP IP receives input and output updates at a frequency of 64 kHz.

PWM counter values reaching PWM_TRIGGER_UP and PWM_TRIGGER_DOWN initiate ADC conversion for feedback-current readings. When the ADC reading stabilizes, the latch_en signal is set to high. The avs_irq signal activates each ISR service routine, determined by the irq_counter and latch_en. The irq_counter value ensures sufficient time for each ISR service routine and is automatically calculated in the software based on the FOC running speed.