A galvanometer motor digital controller based on FPGA+DSP
By using a dual-processor architecture of FPGA+DSP and a three-loop PID controller, the problem of high-speed and high-precision control of the digital control system for galvanometer motors in high-performance application scenarios was solved, achieving faster response speed and higher scanning accuracy, reducing power consumption and enhancing anti-interference capability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2026-03-24
AI Technical Summary
Existing digital control systems for galvanometer motors are difficult to achieve high-speed and high-precision control in high-performance applications such as military exploration and aerospace, and are susceptible to external interference. Existing analog control methods have high power consumption, complex debugging, and poor reliability.
The system employs a dual-processor architecture of FPGA+DSP, combined with a parallel bus interface and a three-loop PID controller, to achieve high-speed acquisition and compensation of motor current and position signals. The FPGA performs error compensation and signal scheduling, the DSP performs complex algorithm calculations, and the motor drive unit performs isolated driving.
It significantly improves the response speed and scanning accuracy of the galvanometer motor control system, reduces power consumption, enhances anti-interference capability and reliability, and is suitable for high-performance application scenarios.
Smart Images

Figure CN115733392B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of high-precision motor control, and particularly relates to a galvanometer motor digital controller based on FPGA+DSP. BACKGROUND
[0002] The galvanometer motor is a position servo motor, and the galvanometer motor is required to quickly, accurately and stably follow the position input signal in operation. The galvanometer motor control method is divided into an analog control method and a digital control method, and the galvanometer motor control is mainly realized through the analog control method at present. Compared with the digital control method, the analog control method cannot apply intelligent control algorithms, has large power consumption, serious heating, complex debugging, poor portability, large temperature drift and is easily disturbed by the outside world.
[0003] The digital control method has strong anti-interference ability and high reliability, but needs to be converted through an analog-to-digital converter, and the data processing amount is large. The digital control system of a single processor architecture needs to collect the motor current and position signals in real time, and the processor needs to consider data collection, data preprocessing and control algorithms. The high-frequency interrupt response will limit the complexity of the motor control algorithm, it is difficult to realize high-speed and high-precision control of the scanning trajectory of the reflector, and it cannot meet the high-performance application scenarios such as military detection and aerospace. SUMMARY
[0004] The technical problem to be solved by the application is to overcome the shortcomings of the existing galvanometer motor digital control system, and to provide a galvanometer motor digital controller based on FPGA+DSP, so as to improve the response speed and scanning precision of the galvanometer motor control system.
[0005] The technical scheme of the application is: a galvanometer motor digital controller based on FPGA+DSP, the digital controller comprising a signal processing unit, a control operation unit and a motor driving unit.
[0006] The signal processing unit collects the position input signal, amplifies and filters the motor current signal, and converts the digital signal into a digital signal, which is sent to the control operation unit; the output of the position sensor in the controlled galvanometer motor is processed to obtain a position feedback digital signal proportional to the actual angle of the motor;
[0007] The control operation unit is realized by using FPGA and DSP, the FPGA uses a parallel bus interface to send the position input signal digital signal, the position feedback signal digital signal and the motor current signal digital signal to the DSP, and compensates and corrects the error caused by the position sensor for the position feedback signal; the DSP uses a current loop, a speed loop and a position loop three-loop PID controller with a feedforward controller to calculate the PWM output, and converts the PWM output into a PWM driving signal to the motor driving unit;
[0008] The motor driving unit isolates and outputs a PWM driving signal, drives the motor, realizes forward rotation or reverse rotation of the motor, samples current flowing through the motor winding, obtains a motor current signal, and forwards the motor current signal to the signal processing unit.
[0009] Preferably, the method for compensating the position feedback signal by the FPGA is as follows:
[0010] The CORDIC algorithm is used to solve the current position feedback signal angle error value, the ideal angle value of the position sensor corresponding to the current position feedback signal is calculated, and the ideal angle value and the angle error value are added to obtain the actual angle value of the position sensor, that is, the position sensor error is compensated.
[0011] Preferably, the angle error value is represented by a "voltage-angle error" function formed by superimposing three sine functions.
[0012] Preferably, the transfer function of the three-loop PID controller is as follows:
[0013]
[0014] Wherein, F(s) is the transfer function of the feedforward controller, G v (s) is the speed loop closed-loop transfer function, G p (s) is the position loop controller transfer function.
[0015] Preferably, when the position input signal is a step signal, the DSP performs a transition process on the position input signal before calculating the PWM output quantity by using the current loop, the speed loop and the position loop three-loop PID controller with the introduction of the feedforward controller, and the transition process function is as follows:
[0016]
[0017] Wherein, T0 is the transition process time.
[0018] Preferably, the three-loop PID controller has a temperature compensation function, the current loop, the speed loop and the position loop PID control parameters at different temperatures are calibrated in a temperature box in advance, and are fitted into linear equations about temperature respectively, the DSP real-time collects temperature data output by a motor internal temperature sensor, and calculates by using the corresponding control parameters at the current temperature.
[0019] Preferably, the high-speed data communication method of the DSP and the FPGA is as follows: the FPGA is used as an external SRAM of the DSP, the address space of the FPGA is mapped to the address space of the DSP through the external interface of the DSP, and data communication is realized.
[0020] Preferably, the position sensor is a photocell sensor, which comprises an LED light source, a blocking butterfly and a cross-coupled photoelectric array.
[0021] The light source, the blocking butterfly and the photoelectric array are coaxially fixedly connected with the motor shaft, the parallel light emitted by the LED light source is blocked by the blocking butterfly, the rest is irradiated on the photoelectric array, the photoelectric array generates a photoelectric current under the light irradiation, the current intensity generated by the photoelectric array is proportional to the area under the light irradiation, the photoelectric array comprises four windows connected in cross, namely a first window a1, a second window a2, a third window b1 and a fourth window b2, the first window a1 and the second window a2 are connected and are a first photoelectric array A, generate a first photoelectric current Ia and output; the third window b1 and the fourth window b2 are connected and are a photoelectric array B, generate a second photoelectric current Ib and output; when the motor rotates, the blocking butterfly rotates with the motor shaft, the area of the first photoelectric array A and the second photoelectric array B receiving light is changed, and the change of the difference between the first photoelectric current Ia and the second photoelectric current Ib is linearly related to the rotation angle of the motor.
[0022] Preferably, the signal processing unit comprises an operational amplifier circuit and an analog-digital conversion circuit.
[0023] The operational amplifier circuit collects position input signals and motor current signals, amplifies and filters the signals and converts them into digital signals, and sends the signals to the control operation unit; the first photoelectric current Ia and the second photoelectric current Ib output by the position sensor in the controlled galvanometer motor are respectively amplified and subtracted to obtain a position feedback analog signal proportional to the actual angle of the motor;
[0024] The analog-digital conversion circuit converts the position input, position feedback analog signal and motor current analog voltage signals processed by the operational amplifier circuit into digital signals.
[0025] Preferably, the position input signal and the motor current signal are respectively amplified by a first-stage operational amplifier.
[0026] The first photoelectric current Ia and the second photoelectric current Ib are converted into a first voltage signal Va and a second voltage signal Vb through a sampling resistor, the first voltage signal Va and the second voltage signal Vb are respectively amplified by a first-stage operational amplifier, then are subtracted by a subtraction operational amplifier circuit, an analog voltage signal proportional to the angle of the motor is obtained, the circuit noise is reduced by a low-pass filter, and the signal is sent to the input end of the analog-digital conversion circuit.
[0027] Compared with the prior art, the present application has the following beneficial effects:
[0028] (1), the present application is through FPGA+DSP dual-processor collaborative processing architecture, give full play to the advantages of FPGA logic control and DSP data processing, compared with the existing digital control system, significantly improve the response speed and scanning accuracy of galvanometer motor control system.
[0029] (2), the present application hardware adopts high-speed A / D conversion chip with parallel communication interface, software uses parallel communication algorithm, solve the existing digital controller serial communication control speed is slow, data transmission time-consuming problem, significantly improve the control speed.
[0030] (3), the present application will digital controller internal power supply is divided into two parts, digital power supply and power supply, both are isolated from each other, avoid the motor drive circuit to the noise interference of other circuits in the controller, at the same time avoid motor drive circuit work abnormally when the large current damage to the controller internal chip, improve the reliability of the control system.
[0031] (4), the present application FPGA to the position feedback signal after compensation, eliminate the installation error and nonlinearity error of position sensor, improve the scanning accuracy of galvanometer motor control system.
[0032] (5), the present application FPGA as system peripheral management core, timing operation to peripheral chip, play the role of signal scheduling, data caching and information preprocessing. FPGA+DSP architecture has the data processing ability of DSP and the logic control ability of FPGA, give full play to the advantages of both. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1 for the galvanometer motor control system schematic diagram of the embodiment of the present application;
[0034] Figure 2 for the galvanometer motor digital controller composition schematic diagram of the embodiment of the present application;
[0035] Figure 3 for the galvanometer motor system transfer function block diagram of the embodiment of the present application;
[0036] Figure 4 for the transition process signal schematic diagram of the embodiment of the present application;
[0037] Figure 5 for the position sensor structure schematic diagram of the embodiment of the present application;
[0038] Figure 6 for the position sensor output current signal diagram of the embodiment of the present application;
[0039] Figure 7 for the position feedback signal processing circuit diagram of the embodiment of the present application; DETAILED DESCRIPTION
[0040] For the purpose of the present application, the technical solutions and advantages are more clear, the following will be combined with the drawings to the embodiments of the present application are described in detail. It should be noted that, in the case of no conflict, the examples and features in the examples in the present application can be combined with each other.
[0041] Galvanometer motor is a limited angle DC motor with mechanical limit, including motor body, swing mirror, position sensor.
[0042] The motor body is generally a one-piece structure, composed of stator assembly, rotor assembly, terminal block, pin, damping ring and bearing; wherein, the stator assembly includes coil assembly, bearing retainer, protective sleeve and stator housing; the rotor assembly includes permanent magnet, damping ring, rotor front and rear shaft and pin; the bearing adopts deep groove ball bearing of stainless steel material, and is pre-tightened with spring. In a specific embodiment of the present application, the motor body is a one-piece moving iron type motor, which has the characteristics of low inertia, large electromagnetic torque and high torque inertia ratio.
[0043] The swing mirror is fixedly connected with the motor rotor front shaft through the pin and located at the head of the motor.
[0044] The position sensor is a photocell sensor, integrated in the tail of the motor body and connected with the digital controller; the photocell sensor includes an LED light source, a blocking butterfly body and a cross-coupled photoelectric array, the butterfly blocking body is fixedly connected with the motor rotor rear shaft, the LED light source projects on the photoelectric array through the dynamic blocking butterfly body, the current change in the photoelectric array reflects the change of the motor rotor position, the position sensor converts the swing mirror rotation angle into current signal, realizes the feedback of position, has the characteristics of small rotational inertia, high resolution, small size, high linearity and good repeatability.
[0045] The present application provides a kind of galvanometer motor digital control system, compared with existing analog control system, the galvanometer motor control system of the present application can be strong, power consumption is low, heating is small, debugging is simple, temperature drift is small and anti-interference is strong.
[0046] Figure 1 As shown in a kind of high-speed galvanometer motor control system based on FPGA+DSP provided by the present application, working process is that digital controller receives external position input signal, collects position sensor and motor current signal in the controlled galvanometer motor, executes control algorithm and drives galvanometer motor, so that swing mirror scans according to position input signal.
[0047] Figure 2The mirror motor digital controller is composed of a power conversion unit, a signal processing unit, a control operation unit, a motor driving unit and a data communication unit.
[0048] The power conversion unit converts external power input into various DC power required by the position sensor in the controlled mirror motor and the internal digital controller.
[0049] The signal processing unit collects and amplifies and filters the position input signal and the motor current signal, and converts them into digital signals and sends them to the control operation unit; and processes the output of the position sensor in the controlled mirror motor to obtain a position feedback digital signal proportional to the actual angle of the motor.
[0050] The control operation unit is realized by a FPGA minimum system and a DSP minimum system; the FPGA minimum system sends the position input signal digital signal, the position feedback signal digital signal and the motor current signal digital signal to the DSP minimum system through a parallel bus interface, compensates the position feedback signal and corrects the error caused by the position sensor; the DSP minimum system adopts a current loop, a speed loop and a position loop three-loop PID controller with a feedforward controller, calculates the PWM output, converts the PWM output into a PWM driving signal and sends it to the motor driving unit, realizes high-speed servo control of the mirror motor, and is the core of the digital controller.
[0051] The motor driving unit isolates and outputs the PWM driving signal, drives the motor, realizes forward rotation or reverse rotation of the motor, samples the current flowing through the motor winding to obtain the motor current signal, and sends it to the signal processing unit.
[0052] The data communication unit outputs the position feedback signal, communicates with the upper computer, realizes testing, upgrading and parameter solidification of the controller.
[0053] The power conversion unit includes a digital power conversion circuit and a power power conversion circuit, which are isolated from each other. The digital power is generated by the digital power conversion circuit, and the power power is generated by the power power conversion circuit. The noise interference of the motor driving unit on other circuits in the digital controller is suppressed through isolation.
[0054] The digital power conversion circuit is used for converting external power supply into secondary power supply to supply power for the signal processing unit, the control operation unit and the data communication unit; in a specific embodiment of the present application, the digital power conversion circuit selects an integrated DC / DC converter with isolation function to realize the conversion of external power supply input +24V into three-way output +5V, +12V and -12V to supply power for the signal processing unit, the control operation unit and the data communication unit; a common mode inductor is placed at the input end of the DC / DC converter to suppress external electromagnetic interference;
[0055] The power supply conversion circuit is used for generating power supply to directly convert external power supply input into direct current voltage to supply power for the motor driving unit; in a specific embodiment of the present application, the power supply conversion circuit adopts a 12V stabilizing diode to directly convert external power supply input into +12V voltage to supply power for the motor driving unit;
[0056] The FPGA minimum system collects 16-bit parallel data output by the three-way analog-digital converter and sends the data preprocessed to the DSP minimum system;
[0057] The FPGA minimum system comprises FPGA, clock management, power management, reset circuit, JTAG debugging circuit and configuration storage circuit;
[0058] The power management comprises a power supply chip HWD70302 and its peripheral circuit, two-way output first 2.5V and then 3.3V to ensure the power-on sequence of the FPGA first kernel and then I / O, and the power supply chip is enabled after the system power supply is started and RC delay is 0.1 seconds, and the low-level enablement after the inverter ensures the starting reliability and stability.
[0059] The DSP minimum system comprises DSP, clock management, power management, reset circuit and JTAG debugging circuit;
[0060] The high-speed data communication scheme of the DSP and the FPGA is that the FPGA is used as the external SRAM of the DSP, the address space of the FPGA is mapped to the address space of the DSP through the external interface (XINTF) of the DSP to realize data communication.
[0061] The DSP and the FPGA adopt different external clock sources, the three groups of data collected by the FPGA are registered twice, and then the DSP reads, so that the metastability problem of the cross-clock domain is solved.
[0062] The data preprocessing comprises pre-calibration of the zero error of the position sensor and the motor body installation and the non-linearity error of the position sensor, fitting of the accurate position sensor voltage-angle curve, and compensation of the collected position feedback data by the FPGA.
[0063] The compensation step is: subtracting the pre-measured position sensor actual input-output characteristic curve (i.e. angle-voltage curve) from the sensor ideal input-output characteristic curve to obtain a sensor error curve, decomposing the error curve into a superposition of three cubic sine harmonics using Fourier decomposition, expressing the error function as a superposition of three sine functions, when FPGA collects a group of position feedback signals output by the position sensor, using CORDIC algorithm to solve the error function value corresponding to the current position, and compensating the sensor error.
[0064] Preferably, the method for compensating the position feedback signal by FPGA is:
[0065] Using CORDIC algorithm to solve the angle error value of the current position feedback signal, and then calculating the ideal angle value of the corresponding sensor at the current position feedback signal, and adding the ideal angle value and the angle error value to obtain the actual angle value of the sensor, i.e. compensating the error of the sensor.
[0066] The angle error value is expressed by a "voltage-angle error" function formed by superposition of three sine functions.
[0067] In a specific embodiment of the present application, the angle error value is obtained by the following method:
[0068] Within the range of the position sensor, a point is selected every 0.5° (-20°, -19.5°, …, 0°, …, 19.5°, 20°), and the voltage output value of the sensor at the angle is measured respectively, taking the actual output voltage of the sensor as the abscissa and setting the angle value as the ordinate, and using MATLAB to fit the actual "voltage-angle" characteristic curve of the position sensor, the ideal "voltage-angle" characteristic curve of the sensor is a straight line, i.e. the output voltage and the measured angle are in linear relationship. Due to installation error, manufacturing error and other reasons, the actual sensor causes the output voltage and the measured angle to not be strictly in linear relationship, i.e. there is a certain degree of nonlinearity. Subtracting the ideal "voltage-angle" characteristic curve from the actual "voltage-angle" characteristic curve can obtain the "voltage-angle error" characteristic curve, and using Fourier decomposition method to decompose the "voltage-angle error" characteristic curve of the sensor into a superposition of three cubic sine harmonics, i.e. expressing the "voltage-angle error" function as a superposition of three sine functions, when FPGA collects a group of position feedback signals output by the position sensor, using CORDIC algorithm to solve the angle error value corresponding to the "voltage-angle error" function at the current voltage, and then calculating the ideal angle value of the corresponding sensor at the current voltage, and adding the ideal angle value and the angle error value to obtain the actual angle value of the sensor, i.e. compensating the error of the sensor.
[0069] The three-loop controller is based on three-loop PID control algorithm of current loop, speed loop and position loop, and introduces feedforward control to realize non-lag dynamic tracking of the motor position in view of dynamic tracking lag of the galvanometer motor.
[0070] The system control block diagram of introducing speed loop feedforward control is shown in Figure 3
[0071] The transfer function of the three-loop PID controller is:
[0072]
[0073] Wherein, F(s) is the transfer function of the feedforward controller, G v (s) is the closed-loop transfer function of the speed loop, and G p (s) is the transfer function of the position loop controller.
[0074] It can be known from the above formula that when F(s) = s / G v (s), H(s) = 1, that is, the output signal completely reproduces the input signal. When the speed loop can be equivalent to G v (s) = 1, F(s) = s, the three-loop PID controller can realize non-lag tracking of the position in theory.
[0075] In view of the contradiction between fast response and overshoot of the galvanometer motor under the step command, a transition process is arranged for the step command to realize fast non-overshoot non-oscillation tracking of the galvanometer motor system to the step command of the position. Specifically:
[0076] When the position input signal is a step signal, the DSP adopts the three-loop PID controller of the current loop, the speed loop and the position loop introducing the feedforward controller before calculating the PWM output quantity, and the transition process function of the position input signal is as follows:
[0077]
[0078] Wherein, T0 is the transition process time.
[0079] When t ≤ T0, it is the transition process of the unit step command, and when t > T0, it indicates that the transition is completed and is always 1.
[0080] Given the step command u, u x trns(T0, t) is taken as the input of the three-loop PID controller, and then the transition process is arranged in the step command. The transition time is determined by T0, and the transition time can be changed by changing T0.
[0081] Figure 4 When T0 is different for the unit step command, the command signal input to the three-loop PID controller is: Figure 4 It can be seen that the instruction input to the three-loop PID controller has a smooth rising process compared to the step instruction, which reduces the starting error between the given position and the actual position; the size of T0 determines the length of the smooth rising process time. The position given instruction of the three-loop PID controller is a unit step signal, the transition process time T0 is set to 70us, the speed loop and the current loop adopt proportional integral control, and the position loop adopts proportional control.
[0082] The three-loop PID controller has a temperature compensation function, and the PID control parameters of the current loop, the speed loop and the position loop at different temperatures are calibrated in the temperature box in advance, and are fitted into linear equations about temperature respectively, and the temperature data output by the motor internal temperature sensor is collected in real time by the DSP, and the corresponding control parameters at the current temperature are used for calculation.
[0083] The high-speed data communication method of the DSP and the FPGA is that the FPGA is used as the external SRAM of the DSP, the address space of the FPGA is mapped to the address space of the DSP through the external interface of the DSP, and data communication is realized.
[0084] Specifically, the FPGA controls the collection of three data of a position input digital signal, a position feedback digital signal and a motor current digital signal, and after the collection is completed, three groups of data and a group of preset flag data are respectively stored in four different addresses mapped by the external interface of the DSP. The DSP continuously queries whether the data in the flag data storage address is the set value, and if yes, the three groups of data are read.
[0085] In a specific embodiment of the application, the photocell sensor comprises an LED light source, a blocking butterfly body and a cross-coupled photoelectric array;
[0086] Figure 5 The photocell sensor structure schematic diagram is shown, the LED light source 2, the blocking butterfly body 3 and the photoelectric array 4 are coaxially fixedly connected with the motor shaft 1, the parallel light emitted by the LED light source is blocked by the blocking butterfly body, the rest is irradiated on the photoelectric array, the photoelectric array generates a photocurrent under light irradiation, the current intensity generated by the photoelectric array is proportional to the area under light irradiation, the photoelectric array comprises four cross-coupled windows, namely a first window a1, a second window a2, a third window b1 and a fourth window b2, the first window a1 and the second window a2 are connected and are a first photoelectric array A, generate a first photocurrent Ia and output; the third window b1 and the fourth window b2 are connected and are a photoelectric array B, generate a second photocurrent Ib and output;
[0087] Figure 6The first photocurrent Ia and the second photocurrent Ib are outputted by the photocell sensor. When the motor rotates, the blocking butterfly rotates along with the rotation shaft of the motor, the area of the first photoelectric array A and the second photoelectric array B receiving light changes, and the difference between the first photocurrent Ia and the second photocurrent Ib changes linearly with the rotation angle of the motor.
[0088] Preferably, the signal processing unit comprises an operational amplifier circuit and an analog-digital conversion circuit.
[0089] The operational amplifier circuit comprises five operational amplifiers and peripheral circuits, is used for collecting and amplifying and filtering a position input signal and a motor current signal, and converting the position input signal and the motor current signal into analog signals within the collection range of the analog-digital conversion circuit.
[0090] The analog-digital conversion circuit converts the position input signal, the position feedback analog signal and the motor current analog voltage signal processed by the operational amplifier circuit into digital signals.
[0091] The position input signal and the motor current signal are respectively amplified by a first-stage operational amplifier.
[0092] Figure 7 The position feedback signal processing circuit is shown. The first photocurrent Ia and the second photocurrent Ib are converted into a first voltage signal Va and a second voltage signal Vb through a sampling resistor, the first voltage signal Va and the second voltage signal Vb are respectively amplified by a first-stage operational amplifier, and then are subtracted by a subtraction operational amplifier circuit to obtain an analog voltage signal proportional to the motor angle, and then are inputted into the input end of the analog-digital conversion circuit after reducing circuit noise by a low-pass filter.
[0093] In a specific embodiment of the present application, the analog-digital conversion circuit comprises three high-speed 16-bit analog-digital conversion chips AD976A and peripheral circuits thereof, the sampling frequency of the AD976A reaches 200 kHz, and the AD976A has a high-speed parallel port data communication interface. The position input signal, the position sensor output signal and the motor current analog voltage signal processed by the operational amplifier circuit are converted into 16-bit digital signals.
[0094] The motor driving unit comprises a power driving circuit and a current sampling circuit. The power driving circuit isolates and outputs the PWM driving signal outputted by the DSP as a driving motor of an actuator to realize the forward and reverse rotation of the motor. The current sampling circuit samples the motor current to generate a motor current signal.
[0095] The power drive circuit comprises an isolation drive circuit and an H-bridge drive circuit; the isolation drive circuit realizes isolation of the controller digital part and the power part, and the H-bridge drive circuit drives the motor forward and reverse rotation.
[0096] The isolation drive circuit comprises an optoelectronic coupler, an integrated bootstrap drive chip IR2110 and a peripheral circuit thereof; the motor drive circuit and other circuits inside the digital controller are isolated by using a high-speed optoelectronic coupler.
[0097] The PWM drive signal output by the DSP is isolated and output by the high-speed optoelectronic coupler, and is sent to the input end of the IR2110 drive circuit, so as to realize isolation between the motor drive unit and other parts of the digital controller.
[0098] The two loop resistors at the output end of the IR2110 are configured to realize the timing of slow rising and fast falling, so as to avoid common-state conduction in hardware and improve the reliability of the system.
[0099] The H-bridge drive circuit adopts four N-channel MOSFETs to form a full bridge, so as to realize forward and reverse rotation of the motor; and adopts a switching power device, so as to significantly reduce the heat generation of the power drive circuit.
[0100] The current sampling circuit comprises a low-value current detection resistor and a signal conditioning circuit.
[0101] The low-value current detection resistor is connected in series on the upper arm of the H-bridge drive circuit, and samples the motor winding current.
[0102] The signal conditioning circuit adopts a current detection chip, so as to realize high common-mode rejection and 20 times gain amplification of the motor winding current signal.
[0103] The data communication unit is composed of a 485 chip and a peripheral circuit thereof; the galvanometer motor control system communicates with the upper computer through a ground-isolated serial communication bus.
[0104] The serial port baud rate is set to 921.6kbps, 1-bit start bit, 8-bit data bit, 1-bit stop bit, and no parity check; and the control operation circuit initiates a calling application every 1ms.
[0105] The application provides a high-speed galvanometer motor control system based on FPGA+DSP, which fully gives play to the advantages of FPGA logic control and DSP data processing, and significantly improves the response speed and scanning precision of the galvanometer motor control system compared with the existing digital control system.
[0106] The application divides the internal power supply of the digital controller into a digital power supply and a power supply, and the two are isolated from each other, so as to avoid noise interference of the motor drive circuit on other circuits inside the controller, and to avoid damage of the internal chip of the controller caused by large current generated when the motor drive circuit works abnormally, and to improve the reliability of the control system.
[0107] The application eliminates the installation error and nonlinearity error of the position sensor and improves the scanning precision of the galvanometer motor control system after compensating after the position feedback signal is collected by the FPGA.
[0108] Although the application has been disclosed with the above preferred embodiments, it is not intended to limit the application, and any person skilled in the art can make possible changes and modifications to the technical solutions of the application by using the disclosed methods and technical contents without departing from the spirit and scope of the application. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the application without departing from the technical solutions of the application shall fall within the protection scope of the technical solutions of the application.
Claims
1. An FPGA + DSP-based galvanometer motor digital controller, characterized in that The signal processing unit, the control operation unit and the motor driving unit are included. The signal processing unit collects position input signals, amplifies, filters and converts motor current signals into digital signals, and sends them to the control operation unit; and processes the output of a position sensor in the controlled galvanometer motor to obtain a position feedback digital signal proportional to the actual angle of the motor. The control operation unit is realized by FPGA and DSP; the FPGA sends the position input signal digital signal, the position feedback signal digital signal and the motor current signal digital signal to the DSP through a parallel bus interface, compensates the position feedback signal and corrects the error caused by the position sensor; the DSP calculates the PWM output quantity by using a current loop, a speed loop and a position loop three-loop PID controller with a feedforward controller, converts the PWM output quantity into a PWM driving signal and sends it to the motor driving unit. The motor driving unit isolates and outputs the PWM driving signal to drive the motor, realizes the forward rotation or reverse rotation of the motor, samples the current flowing through the motor winding to obtain the motor current signal, and sends it to the signal processing unit for feedback. The compensation method of the FPGA for the position feedback signal is as follows: The CORDIC algorithm is used to solve the current position feedback signal angle error value, the ideal angle value of the position sensor corresponding to the current position feedback signal is calculated, the ideal angle value is added to the angle error value, and the actual angle value of the position sensor is obtained, that is, the error of the position sensor is compensated. The angle error value is represented by a "voltage-angle error" function formed by superimposing three sine functions; specifically, the "voltage-angle error" characteristic curve is obtained by subtracting the ideal "voltage-angle" characteristic curve from the actual "voltage-angle" characteristic curve, and the sensor "voltage-angle error" characteristic curve is decomposed into three sine harmonics by using the Fourier decomposition method, that is, the "voltage-angle error" function expression is written as the superposition of three sine functions.
2. The high-speed galvanometer motor system based on FPGA+DSP according to claim 1, characterized in that The transfer function of the three-loop PID controller is as follows: wherein, Gp is the position loop controller transfer function, Gv is the speed loop closed loop transfer function, Gp is the position loop controller transfer function.
3. The high-speed galvanometer motor system based on FPGA+DSP according to claim 1, characterized in that When the position input signal is a step signal, the DSP performs a transition process on the position input signal before calculating the PWM output quantity by using the three-loop PID controller with a feedforward controller, and the transition process function is as follows: wherein is the transition time.
4. The high-speed galvanometer motor system based on FPGA+DSP according to claim 1, characterized in that The three-loop PID controller has a temperature compensation function, and the PID control parameters of the current loop, the speed loop and the position loop at different temperatures are calibrated in a temperature box in advance and fitted into linear equations about temperature, and the DSP collects the temperature data output by the motor internal temperature sensor in real time and calculates by using the corresponding control parameters at the current temperature.
5. The high-speed galvanometer motor system based on FPGA+DSP according to claim 1, characterized in that The high-speed data communication method of the DSP and the FPGA is that the FPGA is used as the external SRAM of the DSP, the address space of the FPGA is mapped to the address space of the DSP through the external interface of the DSP, and data communication is realized.
6. The high-speed galvanometer motor system based on FPGA+DSP according to claim 1, characterized in that The position sensor is a photocell sensor, which includes an LED light source, a blocking butterfly body and a cross-coupled photoelectric array. The light source, the blocking butterfly body and the photoelectric array are coaxially fixedly connected with the motor shaft, parallel light emitted by the LED light source is blocked by the blocking butterfly body, the rest is irradiated on the photoelectric array, the photoelectric array generates photoelectric current under the irradiation, the current intensity generated by the photoelectric array is proportional to the area under the irradiation, the photoelectric array includes four cross-coupled windows, which are a first window a1, a second window a2, a third window b1 and a fourth window b2, the first window a1 and the second window a2 are connected and are a first photoelectric array A, generate a first photoelectric current Ia and output; the third window b1 and the fourth window b2 are connected and are a photoelectric array B, generate a second photoelectric current Ib and output; when the motor rotates, the blocking butterfly rotates with the motor shaft, the area of the first photoelectric array A and the second photoelectric array B under the irradiation is changed, and the change of the difference between the first photoelectric current Ia and the second photoelectric current Ib is linearly related to the rotation angle of the motor.
7. The high-speed galvanometer motor system based on FPGA+DSP according to claim 6, characterized in that The signal processing unit comprises an operational amplifier circuit and an analog-digital conversion circuit; The operational amplifier circuit collects and amplifies and filters position input signals and motor current signals, and converts the signals into digital signals and sends the signals to a control operation unit, the first photoelectric current Ia and the second photoelectric current Ib output by a position sensor in the controlled galvanometer motor are respectively amplified and subtracted to obtain a position feedback analog signal proportional to the actual angle of the motor; The analog-digital conversion circuit converts the position input, position feedback analog signal and motor current analog voltage signals processed by the operational amplifier circuit into digital signals.
8. The high-speed galvanometer motor system based on FPGA+DSP according to claim 7, characterized in that The position input signal and the motor current signal are respectively amplified by a first-stage operational amplifier; The first photoelectric current Ia and the second photoelectric current Ib are converted into a first voltage signal Va and a second voltage signal Vb through a sampling resistor, the first voltage signal Va and the second voltage signal Vb are respectively amplified by a first-stage operational amplifier, then are subtracted by a subtraction operational amplifier circuit, an analog voltage signal proportional to the angle of the motor is obtained, the analog voltage signal is sent to the input end of the analog-digital conversion circuit after being reduced by a low-pass filter circuit.
Citation Information
Patent Citations
Servo system for tracking moving target by linear variable-coefficient servo driving radar antenna
CN102509887A
Compensation method and circuit for laser flight marking hardware
CN104267670A