Share this

Design of a High-Precision Large Telescope Servo Controller Based on Microcontroller and CPLD

2026-04-06 03:30:00 · · #1

A servo controller for a high-precision large telescope, based on the high-speed C8051F120 microcontroller and CPLD, is designed. The microcontroller implements the closed-loop control algorithm, host computer communication, and LCD display control, while the CPLD implements incremental encoder counting, motor drive waveform generation, and I/O interfaces. This controller can control the motor independently or in conjunction with a host computer, and features strong real-time performance, anti-interference capabilities, low cost, and easy debugging.

introduction

The development of microelectronics and computers has driven the progress of servo control technology. The hardware systems of control systems are becoming increasingly faster, smaller, and more modular, and their functions are becoming more powerful and complete. Moreover, servo control technology is developing towards a more open and modular control structure, requiring simple controller algorithms, flexible control interfaces, and the ability for the hardware system to remain unchanged while the software system can automatically adjust parameters for different servo control objects.

In high-precision large telescope servo control applications, high-precision photoelectric encoders are used as the primary feedback method, mainly absolute and incremental encoders. The drive motor signal includes analog voltage output or PWM pulse output; the motor speed is adjusted by changing the voltage magnitude or the PWM duty cycle. The system has a communication interface with a host computer and several logic input/output interfaces. Large telescopes are precision optical devices used to track and measure flying targets or observe celestial objects. The servo system is a crucial component of the telescope, playing a vital role in tracking targets, accurately measuring their positions, and other parameters. The performance of the servo system directly affects the telescope's observation capabilities; high-precision servo control of the telescope requires a high-precision position feedback device and high-resolution PWM drive pulses.

This paper uses the high-speed microcontroller C8051F120 as the main controller. The interface with the photoelectric encoder primarily uses AB quadrature code and zero-position signal input. The drive motors mostly employ PWM signals with dead-time to drive brushed DC motors. A CPLD is used to implement AB code counting, setting the number of counting bits, and 32-bit reversible counting for the high-speed photoelectric encoder. It can also output high-resolution PWM motor drive signals with dead-time. This paper combines the advantages of high-speed microcontrollers and CPLDs to design the controller for a telescope servo system.

1 System Hardware Design

The design employs a high-speed microcontroller as the main controller to construct a low-cost servo control scheme. CPLDs are characterized by flexible programming, high integration, short development cycles, and low cost, enabling large-scale digital circuit design. Therefore, selecting a suitable CPLD can meet the circuit interface requirements of the servo control system, such as AB orthogonal code counting and PWM waveform generation, while significantly reducing PCB area and enhancing reliability. The overall controller system block diagram is shown in Figure 1.

The high-speed microcontroller selected as the main controller is the C8051F120. It is a fully integrated mixed-signal system-on-a-chip (SoC) that mainly performs mathematical operations, control algorithms, and A/D data acquisition.

The C8051F120 has the following characteristics:

◆ High-speed, pipelined 8051-compatible CIP-51 core (100MIPS or 50MIPS);

◆A true 12-bit, 100ksps ADC with PGA and an 8-channel analog multiplexer;

◆ Two 12-bit DACs with programmable data update modes;

◆A 2-cycle 16×16 multiplication and accumulation engine;

◆128KB of system-programmable Flash memory;

◆8448 (8K+256) bytes of on-chip RAM;

◆External data memory interface addressable up to 64KB address space;

◆ Hardware implementation of SPI, SMBus/I2C and two UART serial interfaces;

◆ Five general-purpose 16-bit timers;

◆A programmable counter/timer array with 6 capture/compare modules;

◆On-chip watchdog timer, VDD monitor, and temperature sensor.

The CPLD selected is the Altera EPM570T100 from the low-power MAXII series. It contains 570 logic elements (LEs), equivalent to 440 macrocells; 8192 bits of user Flash memory, sufficient for small-capacity information storage; a maximum user I/O count of 76; a minimum access time of 4.5ns; and an internal maximum clock frequency of 304MHz, fully meeting system design requirements. The EPM570T100 primarily interfaces with the P1, P5, P6, and P7 pins of the C8051F120, as well as with the encoder's ABZ code, 8-channel output, and 8-channel input interface circuits. It implements functions such as data bus and address bus interface circuits with the C8051F120, external timer interrupt circuits, decoding circuits, PWM pulse generation circuits, frequency multiplication and direction detection circuits, counting circuits, and fault protection circuits.

The LCD display module primarily displays system status variables, such as position, speed, and encoder values. A serial level converter transceiver SP3223 enables two-way RS232 communication with the host computer, allowing for the setting of operating modes (such as fixed-point and constant-speed modes) and numerical values. Simultaneously, the microcontroller can send operating status variables to the host computer in real time, facilitating data recording and analysis. Controller parameters (such as proportional coefficient KP and integral coefficient KI) can also be set by the host computer, which is essential for open motion control modules.

In addition, an 8-way button is designed for setting function parameters, etc., as shown in Figure 2. The interface of the photoelectric incremental encoder is generally an RS422 differential input interface.

As shown in Figure 3, the photoelectric incremental encoder interface circuit has a terminating matching resistor and a filter network circuit, which can enhance anti-interference capability. The interface chip SP489 converts the RS422 signal to TTL level.

Implementation of each module on the 2CPLD chip

2.1 Frequency Multiplication Direction Detection and Counting Circuit

After processing by the encoder interface circuit shown in Figure 3, TTL level A1, B1, and Z1 signals are output to the CPLD. First, the waveform undergoes shaping and digital filtering; after 4 subdivisions, it enters the direction detection circuit; then, a reversible counting circuit counts the pulses, outputting a 32-bit binary code value; the microcontroller reads the count value in each sampling cycle to obtain the position value, and the velocity value can be obtained through differentiation. The AB code frequency output by the telescope's position feedback circular grating can reach 10MHz, which is fully capable of the high-frequency CPLD EPM570T100. Schmitt triggering and filtering are performed at the CPLD input port to avoid spike interference and further enhance system robustness.

2.2 Clock Circuit

The CPLD's global clock is 100MHz, which is divided and provided to various internal modules, such as the counting module circuit, the PWM processing circuit, and the microcontroller's interrupt signal. 100MHz can be divided into 1kHz, 500Hz, and 50Hz. In this design, the sampling period is 1ms, i.e., a 1kHz sampling frequency, used for the microcontroller's external interrupt signal. Within the sampling period, the microcontroller completes tasks such as circular grating counting and sampling, speed calculation, algorithm implementation, PWM control variable generation, and process state variable assignment. Actual measurements show that the time required to control a single motor is approximately 120μs, with the remaining time used for LCD display control and communication functions. Therefore, this microcontroller is capable of handling the closed-loop operation of the telescope servo system.

2.3 PWM Pulse Circuit

The power stage uses an H-bridge circuit, requiring four PWM signals with dead time to avoid shoot-through. As shown in Figure 4, a 12.5kHz triangular wave signal is first generated from 100MHz and compared with the data output from the microcontroller (0-8000) to obtain one PWM signal (the data size determines the duty cycle value, 0 corresponds to 0%, 8000 corresponds to 100%). This PWM signal then generates an inverse signal. Simultaneously, two PWM signals with a dead time of at least 5μs are obtained through the dead-time circuit, and four drive power stage PWM signals are obtained through the motor operating mode control circuit, allowing the motor to operate in unipolar or bipolar mode. When multiple motors need to be controlled, the same method can be used, demonstrating the flexibility of the CPLD.

2.4 Other Circuits

Limit signals on the turntable, fault signals from the power stage, and external logic digital signals are input to the CPLD for corresponding logic processing (such as output enable and stop), thereby achieving effective control and protection of the motor.

3. Control Algorithm Implementation

Internal model control (EMC) is employed in the implementation of the control algorithm. Its design involves connecting the object model in parallel with the actual object, with the controller approximating the dynamic inverse of the model. For single-variable systems, the EMC is taken as the inverse of the minimum phase part of the model, and the robustness of the system is enhanced by adding a low-pass filter. When the model and the controlled object model are precisely matched, the input of the control system equals the output. EMC clearly demonstrates the relationship between the adjustment parameters, closed-loop response, and robustness; the dynamic characteristics of the EMC depend on the matching between the internal model and the controlled object.

The block diagram of internal model control (IMC) is shown in Figure 5. Here, GP(s) represents the controlled object, ***** represents the internal model, GIMC(s) represents the internal model controller, and Gd(s) represents the external disturbance model; x, u, and y represent the given input, control quantity, and object output, respectively, and d represents the external disturbance. In industrial processes, compared with classical PID control, IMC has only one tuning parameter. The relationship between parameter adjustment and system dynamic quality and robustness is relatively clear. Therefore, adopting IMC can improve the design level of PID controllers. Due to the simplicity of parameter adjustment, this algorithm is easy to implement using a microcontroller program.

Large photoelectric telescopes are high-inertia systems, with mechanical time constants much larger than electrical time constants; therefore, the influence of the electrical time constant can be ignored. The velocity transfer function of the object can be simplified to:

In the formula, Tm is the mechanical time constant, and K is the gain. Therefore, the internal model controller can be selected as:

In the formula, λ represents the filter parameters. As shown in Figure 5, the part within the dotted line can be equivalent to a feedback controller:

When the model is matched, the closed loop of the internal model control system is an inertial element. Its time can be adjusted as needed; a smaller λ value is beneficial for dynamic performance, while a larger λ value enhances robustness. For an unsaturated output of the internal model controller, it is equivalent to a feedback controller (PI). Therefore, the steady-state error of the system to step inputs and step disturbances is zero, and its anti-interference capability is completely consistent with that of a conventional PI controller. An incremental PID control algorithm is adopted, with the following control variables:

In the formula, ek is the velocity error at the k-th step, Ts is the sampling period, and μ(k) is the current control output.

4 Experimental Results

A servo controller hardware platform based on the high-speed microcontrollers C8051F120 and CPLDEPM570T100 was used to realize the speed control of the large telescope turntable. The drive power stage adopted an H-bridge bipolar power amplifier, and the feedback used a 413mm diameter circular grating with 64800 channels, 1000 subdivisions, a resolution of 0.02"/s, and a sampling period of 1ms. The control loop calculation time was measured to be 120μs, including the circular grating data reading time. The speed transfer function of one turntable of the telescope is:

The actual speed value (baud rate 115200bps, 1 transmission per ms) was sent via the communication port on the board, and the data was recorded by the host computer. The measured speed response curve is shown in Figure 6. Initially, the motor ran at a low speed of 20"/s, increasing to 1800"/s in the middle, and finally reaching 3600"/s, showing very stable speed at each stage. In actual data processing, the circular grating data at the zero-position signal moment needs to be processed. Because this grating has a zero-position signal output, reasonable analysis of direction and magnitude is required when calculating the speed.

Conclusion

This paper uses a high-speed microcontroller and a CPLD to form a telescope servo controller, which realizes the circular grating fourth-harmonic subdivision circuit, the counting module, and the generation of PWM drive control signals for the motor. The microcontroller also implements the internal model control algorithm, LCD display, and data communication functions. Finally, experiments verified the feasibility of the system.

Read next

CATDOLL 136CM Mila

Height: 136cm Weight: 23.3kg Shoulder Width: 31cm Bust/Waist/Hip: 60/54/68cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22
CATDOLL Himari TPE Head

CATDOLL Himari TPE Head

Articles
2026-02-22
CATDOLL 108CM Coco

CATDOLL 108CM Coco

Articles
2026-02-22