WO2022120818A1 - 用于传感器的控制装置、方法、可移动平台和存储介质 - Google Patents
用于传感器的控制装置、方法、可移动平台和存储介质 Download PDFInfo
- Publication number
- WO2022120818A1 WO2022120818A1 PCT/CN2020/135842 CN2020135842W WO2022120818A1 WO 2022120818 A1 WO2022120818 A1 WO 2022120818A1 CN 2020135842 W CN2020135842 W CN 2020135842W WO 2022120818 A1 WO2022120818 A1 WO 2022120818A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- sensor
- memory access
- direct memory
- access channel
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 230000015654 memory Effects 0.000 claims abstract description 217
- 238000012545 processing Methods 0.000 claims abstract description 153
- 230000005540 biological transmission Effects 0.000 claims description 47
- 238000012546 transfer Methods 0.000 claims description 35
- 238000005070 sampling Methods 0.000 claims description 33
- 238000004590 computer program Methods 0.000 claims description 10
- 238000004148 unit process Methods 0.000 claims description 6
- 230000000630 rising effect Effects 0.000 claims description 4
- 230000001960 triggered effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 238000005259 measurement Methods 0.000 description 8
- 238000001514 detection method Methods 0.000 description 4
- 238000006073 displacement reaction Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 238000012937 correction Methods 0.000 description 3
- 230000006641 stabilisation Effects 0.000 description 3
- 238000011105 stabilization Methods 0.000 description 3
- 238000001914 filtration Methods 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 238000007654 immersion Methods 0.000 description 2
- 230000001939 inductive effect Effects 0.000 description 2
- 239000007788 liquid Substances 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- RZVHIXYEVGDQDX-UHFFFAOYSA-N 9,10-anthraquinone Chemical compound C1=CC=C2C(=O)C3=CC=CC=C3C(=O)C2=C1 RZVHIXYEVGDQDX-UHFFFAOYSA-N 0.000 description 1
- 101150043088 DMA1 gene Proteins 0.000 description 1
- MHABMANUFPZXEB-UHFFFAOYSA-N O-demethyl-aloesaponarin I Natural products O=C1C2=CC=CC(O)=C2C(=O)C2=C1C=C(O)C(C(O)=O)=C2C MHABMANUFPZXEB-UHFFFAOYSA-N 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000001976 improved effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000032258 transport Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D1/00—Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
- G05D1/08—Control of attitude, i.e. control of roll, pitch, or yaw
Definitions
- the present application relates to the technical field of sensors, and in particular, to a control device, method, movable platform and storage medium for sensors.
- attitude information of the device When controlling some devices, such as unmanned aerial vehicles, PTZs and other mobile platforms, it is usually necessary to obtain the attitude information of the device through sensors, such as inertial sensor IMU, such as three-axis acceleration and angular velocity information; Attitude correction can be achieved, for example, to stabilize the gimbal and maintain the flight attitude.
- sensors such as inertial sensor IMU, such as three-axis acceleration and angular velocity information
- Attitude correction can be achieved, for example, to stabilize the gimbal and maintain the flight attitude.
- the real-time nature of gesture information has a significant impact on product performance and user experience.
- the senor generates an interrupt when each sampling is completed, and the processor responds to the interrupt to process the attitude information acquired this time. Due to the high sampling rate, the processor will be interrupted frequently, which affects the performance.
- the processor periodically obtains the attitude information obtained multiple times from the sensor. This method of transmitting the attitude information acquired multiple times takes a long time, which will affect the real-time performance of the attitude information.
- the present application provides a control device, a method, a movable platform and a storage medium for a sensor, which can reduce the interruption frequency and have high real-time performance when acquiring the data of the sensor.
- an embodiment of the present application provides a control device for a sensor, including:
- a direct memory access controller for transferring the data acquired by the sensor to the data processing unit
- the direct memory access controller includes:
- a first direct memory access channel for sending a read data command, wherein the read data command is used to read data acquired by the sensor
- a second direct memory access channel for transmitting data acquired by the sensor is
- an embodiment of the present application provides a control method for a sensor, the method comprising:
- the first direct memory access channel of the direct memory access controller sends a read data command, where the read data command is used to read the data acquired by the sensor;
- the second direct memory access channel of the direct memory access controller transmits the data to the data processing unit.
- an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the foregoing control method.
- an embodiment of the present application provides a movable platform, and the movable platform includes:
- a direct memory access controller for transferring the data acquired by the sensor to the data processing unit
- the direct memory access controller includes:
- a first direct memory access channel for sending a read data command, wherein the read data command is used to read data acquired by the sensor
- a second direct memory access channel for transmitting data acquired by the sensor is
- Embodiments of the present application provide a control device, method, movable platform, and storage medium for a sensor, where the control device includes a direct memory access controller for transmitting data acquired by the sensor to a data processing unit, wherein the direct memory One direct memory access channel in the access controller is used to send a read data command for reading the data acquired by the sensor, and the other direct memory access channel is used to transmit the data acquired by the sensor.
- the data collected by the sensor can be transmitted to the data processing unit in time.
- the data processing unit processes the sensor data, the data processing unit has already stored more sensor data. The influence of the interrupt signal of the sensor on other tasks performed by the data processing unit can be reduced, and the data processing unit acquires the data of the sensor with high real-time performance.
- FIG. 1 is a schematic structural diagram of a control device for a sensor provided by an embodiment of the present application
- FIG. 2 is a schematic structural diagram of a control device in an embodiment
- FIG. 3 is a schematic diagram of sensor data transmission in a control device according to an embodiment of the present application.
- FIG. 4 is a schematic structural diagram of a control device in another embodiment
- 5 is a schematic diagram of the storage format of the data of the sensor in the data processing unit
- FIG. 6 is a schematic flowchart of a control method for a sensor provided by another embodiment of the embodiment of the present application.
- FIG. 7 is a schematic block diagram of a control apparatus provided by another embodiment of the present application.
- FIG. 8 is a schematic block diagram of a movable platform provided by an embodiment of the present application.
- FIG. 1 is a schematic structural diagram of a control device 10 for a sensor provided by an embodiment of the present application.
- the control device 10 can acquire data output by the sensor 200 . It can be understood that the control device 10 may include the sensor 200 or may not include the sensor 200 .
- the sensor 200 may include at least one of the following: a resistive sensor, a capacitive sensor, an inductive sensor, a piezoelectric sensor, a pyroelectric sensor, an impedance sensor, a magnetoelectric sensor, a piezoelectric sensor, a photoelectric sensor Sensor, resonant sensor, Hall sensor, ultrasonic sensor, isotope sensor, electrochemical sensor, microwave sensor, ultrasonic sensor, temperature sensor, humidity sensor, gas sensor, pressure sensor, acceleration sensor, ultraviolet sensor, magnetic sensor Sensors, magnetoresistive sensors, image sensors, power sensors, displacement sensors, pressure sensors, PH sensors, flow sensors, liquid level sensors, immersion sensors, illumination sensors, differential pressure transmitters, acceleration sensors, displacement sensors, load cells, ranging sensor.
- a resistive sensor a capacitive sensor, an inductive sensor, a piezoelectric sensor, a pyroelectric sensor, an impedance sensor, a magnetoelectric sensor, a piezoelectric sensor, a photoelectric sensor Sensor, resonant sensor, Hall sensor,
- control device 10 can perform preset tasks according to the data output by the sensor 200 , including but not limited to: controlling the execution device, such as the working state of the motor, switch, output device, etc., according to the sensor 200 .
- control device 10 includes a movable platform
- the movable platform may include at least one of an unmanned aerial vehicle, a gimbal, an unmanned vehicle, and the like.
- the aircraft may be a rotary-wing UAV, such as a quad-rotor UAV, a hexa-rotor UAV, an octa-rotor UAV, or a fixed-wing UAV.
- the movable platform includes an inertial sensor
- the inertial sensor includes, for example, an accelerometer, an angular velocity sensor (gyroscope), an inertial measurement unit (Inertial Measurement Unit, IMU), an attitude reference system (Attitude and heading reference system, AHRS). at least one.
- attitude information such as three-axis acceleration and angular velocity information
- inertial sensor chips such as IMU
- Axial acceleration and angular velocity information are processed by filtering algorithm to obtain stable result data, and then preset operations are performed based on PID automatic control algorithm to perform attitude correction, so as to achieve the purpose of gimbal stabilization and flight attitude maintenance. Therefore, the real-time performance of the sensor data obtained by the gimbal and unmanned aerial vehicle has a significant impact on the performance of the product and the user experience.
- one is real-time reading. After the sensor has set the sampling period, a sampling completion interrupt will be generated each time the sampling is completed, and the processor of the control device will respond to the sampling completion interrupt from the The sensor reads the data into memory, which is then processed by the processor.
- the other is batch reading, which requires the sensor to have a large-capacity internal buffer (BUFF), and temporarily store the data of multiple sampling periods in the internal buffer.
- BUFF large-capacity internal buffer
- the processor of the control device reads the data of multiple sampling periods from the internal buffer of the sensor into the memory after responding to the timing interruption, and then the processor performs processing.
- the inventor of the present application found that the processing method of real-time reading has good real-time performance, and the processor can obtain the data of the sensor in a timely manner, but frequent interruptions will cause the processor to perform other tasks, such as power detection and image processing. , channel detection and switching and other tasks, and when the processor responds to an interrupt, there will be a series of hardware environment save and restore operations, which will cause serious consumption of processor resources.
- the batch read processing method can reduce the frequency of interruptions, but it takes more time to read data of multiple sampling periods in response to interruptions, which reduces the real-time nature of sensor data.
- the time length between two timing interruptions cannot be too large, otherwise the sensor data will be lost.
- the inventors of the present application have improved the control device 10 for the sensor, which can reduce the interruption frequency and have higher real-time performance when acquiring the data of the sensor 200 .
- the control device 10 includes a direct memory access controller 100 , and the direct memory access controller 100 is configured to transmit the data acquired by the sensor 200 to the data processing unit 300 . It can be understood that the data acquired by the sensor 200 may be referred to as sensor data.
- the direct memory access controller 100 can be used for transferring data within the system, for example, transferring the data of the sensor 200 to the data processing unit 300 .
- the sensor 200 may issue an interrupt to the data processing unit 300, after the data processing unit 300 responds to the interrupt, clears the interrupt, and then configures the direct memory access controller 100, and after the configuration is completed, starts the direct memory access controller 100,
- the direct memory access controller 100 performs data transmission, and transfers the data of the sensor 200 to the internal storage of the data processing unit 300.
- the data of the sensor 200 can be transferred to the tightly coupled memory of the data processing unit 300 (Tightly Coupled Memories, TCM).
- the data processing unit 300 and the direct memory access controller 100 may be separate chips, or may be provided in the same chip.
- the data processing unit 300 and the direct memory access controller 100 may be provided in a chip of an SOC (System On Chip, system on chip) architecture.
- SOC System On Chip, system on chip
- the form of the control device 10 may be a chip.
- the control device 10 may also include a sensor 200 and/or an execution device, such as a motor, a switch, an output device, and the like.
- the data processing unit 300 may include at least one of a micro-controller unit (Micro-controller Unit, MCU), a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP), etc. .
- MCU micro-controller Unit
- CPU Central Processing Unit
- DSP Digital Signal Processor
- the direct memory access controller 100 includes a first direct memory access channel 110 (for example, called DMA0, where DMA stands for Direct Memory Access) and a second direct memory access channel 120 (for example, called DMA1). It can be understood that the first direct memory access channel 110 and the second direct memory access channel 120 may be different channels in the same direct memory access controller 100 , or may be different direct memory access controllers 100 .
- the first direct memory access channel 110 is used to send a read data command, wherein the read data command is used to read the data obtained by the sensor 200 ; the second direct memory access channel 120 is used to transmit the data obtained by the sensor 200 . data.
- the first direct memory access channel 110 may send the read data command according to the sampling frequency of the sensor 200 .
- the frequency of sending the read data command may be the same as the sampling frequency of the sensor 200 , and each time the first direct memory access channel 110 sends a read data command, the second direct memory access channel 120 may transmit a piece of sensor data to the data processing unit 300 .
- a piece of sensor data includes three-axis acceleration data and angular velocity data
- a piece of sensor data is 14 bytes (X, Y, Z three-axis acceleration information is 2 bytes each, X, Y, Z
- the three-axis angular velocity information is 2 bytes each, and the temperature information is 2 bytes).
- the sampling frequency of the sensor 200 is 32 kHz (32,000 times per second)
- 32,000 pieces of sensor data are transmitted in 1 second.
- the control device 10 further includes an interrupt processing circuit 400 .
- the interrupt processing circuit 400 is configured to receive the first interrupt signal sent by the sensor 200, and output the read data request signal according to the first interrupt signal.
- control device 10 has a GPIO (General-purpose input/output) GPIO through which the sensor 200 is connected.
- GPIO General-purpose input/output
- the first interrupt signal is sent by the sensor 200 according to the number of times of acquiring data.
- the sensor 200 outputs a first interrupt signal according to a preset sampling frequency, and sends the first interrupt signal to the interrupt processing circuit 400 of the control device 10 in each sampling period.
- the first interrupt signal is converted from a high level to a low level, or from a low level to a high level.
- the first interrupt signal is sent by the sensor 200 according to the trigger of an internal timer.
- the sensor 200 may output a first interrupt signal according to a preset sampling frequency, and send the first interrupt signal to the interrupt processing circuit 400 of the control device 10 in each sampling period.
- the interrupt processing circuit 400 outputs the read data request signal according to the rising edge and/or the falling edge of the first interrupt signal.
- the interrupt processing circuit 400 includes an edge sampling circuit 410 .
- the first direct memory access channel 110 is used for sending a read data command according to a read data request signal.
- the first direct memory access channel 110 may send a read data command according to the sampling frequency of the sensor 200 .
- the frequency of sending the read data command may be the same as the sampling frequency of the sensor 200 , and each time the first direct memory access channel 110 sends a read data command, the second direct memory access channel 120 may transmit a piece of sensor data to the data processing unit 300 .
- the first direct memory access channel 110 can also be configured so that the first direct memory access channel 110 sends the read data command according to the sampling frequency of the sensor 200 , in this case, it is not necessary to generate a read data command according to the first interrupt signal of the sensor 200 .
- a data request signal, and a read data command is sent according to the read data request signal.
- the data collected by the sensor 200 can be transmitted to the data processing unit 300 in time, and the data processing unit 300 is in the process of monitoring the sensor.
- the data processing unit 300 has already stored a lot of sensor data, for example, it can perform processing such as filtering on the stored multiple pieces of sensor data. Therefore, the influence of the interrupt signal of the sensor 200 on other tasks performed by the data processing unit 300 can be reduced, and the data processing unit 300 acquires the data of the sensor 200 with high real-time performance.
- FIG. 3 it is a comparison of the time taken for sensor data transmission in the control device 10 according to the embodiment of the present application, the real-time reading method, and the batch reading method.
- the frequency of processing interrupts by the data processing unit 300 is 32 kHz
- the time for the data processing unit 300 to acquire 31 pieces of sensor data is 968.75 microseconds
- the direct memory access is performed in the 32nd sampling period. It takes 5.6 microseconds for the controller 100 to acquire the 32nd piece of sensor data (the sensor data is stored in a register, and the transmission rate is relatively high, for example, 20MHz).
- the sensor 200 does not transmit sensor data in the first 31 sampling periods, but temporarily stores the sensor data in the internal buffer (BUFF), and then spends 3584 microseconds to transmit 32 pieces of sensor data (the sensor data is stored in the internal In the buffer, the transfer rate is lower, for example, 1MHz).
- BUFF internal buffer
- one direct memory access channel sends a read data command to the sensor 200
- the other direct memory access channel transmits the data acquired by the sensor 200
- the time spent to transmit 32 pieces of sensor data is 968.75 microseconds
- the data processing unit 300 acquires the data of the sensor 200 with high real-time performance, and can reduce the influence of the interrupt signal of the sensor 200 on other tasks performed by the data processing unit 300 .
- a second interrupt signal is sent, and the second interrupt signal is used to trigger the interrupt of the data processing unit 300.
- the data processing unit 300 when the data transmitted by the second direct memory access channel 120 reaches a preset amount of data, a second interrupt signal is sent, and the second interrupt signal is used to trigger the interrupt of the data processing unit 300.
- the data processing unit 300 when the data processing unit 300 is interrupted, it suspends processing tasks such as power detection, image processing, channel detection, and switching, and performs preset tasks according to data of a preset data volume.
- the preset amount of data includes the amount of data obtained by the sensor 200 at least twice.
- the interrupt of the data processing unit 300 is triggered, and the frequency of processing the interrupt by the data processing unit 300 is 1 kHz. Compared with the real-time reading method, The influence of the interrupt signal of the sensor 200 on other tasks performed by the data processing unit 300 can be reduced.
- the data processing unit 300 when the data processing unit 300 receives the second interrupt signal, the data processing unit 300 performs the preset task according to the data of the preset data amount.
- the data of the preset data volume can be filtered, and the attitude correction can be performed according to the filtered data, so as to achieve the purpose of stabilization of the gimbal and flight attitude maintenance.
- the first direct memory access channel 110 stops sending the read data command
- the second direct memory access channel 120 stops transmitting the data acquired by the sensor 200 .
- the data processing unit 300 enables the first direct memory access channel 110 to send a read data command, and/or enables the second direct memory access channel 120 to transmit data acquired by the sensor 200 after processing the data.
- the first direct memory access channel 110 is suspended from sending the read data command, and/or the second direct memory access channel 120 is suspended from transmitting the sensor 200 .
- the first direct memory access channel 110 may be resumed to send the read data command, and/or the second direct memory access channel 120 may be resumed to transmit the data acquired by the sensor 200 .
- the data processing unit 300 may finish processing data of a preset data amount, enable the first direct memory access channel 110 to send a read data command, and/or enable The second direct memory access channel 120 transmits the data acquired by the sensor 200 .
- the data processing unit 300 can acquire data of a preset data amount in the 1st to 32nd sampling period, and the data processing unit 300 can obtain the data of the sensor 200 in the 33rd sampling period. The data from the 1st to the 32nd sampling period are processed before the first interrupt signal is issued.
- the first direct memory access channel 110 sends the read data command according to a first source address; the first source address includes the storage address of the read data command in the data processing unit 300.
- read data commands are stored in tightly coupled memory of data processing unit 300 .
- the data processing unit 300 may configure the source address of the first direct memory access channel 110 as the first source address, so that the first direct memory transmits the read data command stored at the first source address to the sensor 200 .
- the read data command is used to read the data acquired by the sensor 200 in register mode. Reading the data acquired by the sensor 200 in the register mode can realize a higher rate of data transmission.
- the second direct memory access channel 120 transfers data to the data processing unit 300 according to a second target address; the second target address includes a bus access address of the tightly coupled memory of the data processing unit 300 .
- the data processing unit 300 may configure the target address of the second direct memory access channel 120 as the second target address, so that the second direct memory access channel 120 transmits the data acquired by the sensor 200 to the data processing unit 300 .
- the second target address includes bus access addresses of two caches in the tightly coupled memory. If the second direct memory access channel 120 transfers the current data to one of the caches, the latter data is transferred to the other cache.
- the data processing unit 300 can ensure that the data is stored accurately by adopting the manner in which the two caches store data in turn.
- the direct memory access controller 100 is connected to the sensor 200 through the data transfer interface 500 .
- the data transmission interface 500 includes at least one of the following: an SPI bus interface and an I2C bus interface, but of course it is not limited thereto.
- the data transmission interface 500 is used for reading the data acquired by the sensor 200 according to the read data command, and the second direct memory access channel 120 is used for transmitting the data read by the data transmission interface 500 .
- the read data command is a command matching the data transmission interface 500, such as an SPI command.
- the first direct memory access channel 110 sends a read data command to the data transmission interface 500 according to the first target address.
- the first target address includes an access address of the data transmission interface 500 corresponding to the sending register of the sensor 200 .
- the data processing unit 300 may configure the target address of the first direct memory access channel 110 as the first target address, so that the first direct memory transmits the read data command stored in the data processing unit 300 to the data transmission interface 500. send register.
- the data transmission interface 500 can send the information in the transmit register of the data transmission interface 500 to the sensor 200, so that the sensor 200 transmits data to the receive register of the data transmission interface 500.
- the second direct memory access channel 120 obtains data from the data transmission interface 500 according to the second source address; the second source address includes an access address of the data transmission interface 500 corresponding to the receiving register of the sensor 200 .
- the data processing unit 300 may configure the source address of the second direct memory access channel 120 as the second source address, so that the second direct memory transmits the data from the sensor 200 in the receiving register of the data transmission interface 500 to the data processing unit. unit 300.
- a storage request signal is output to the second direct memory access channel 120 , so that the second direct memory access channel 120 transmits the data to the data processing unit 300 .
- the first direct memory access channel 110 is configured as a multi-block DMA transfer mode
- the parameter loading mode of the source-side multi-block transfer mode is an autoreloading mode
- the source-side address mode is an autoreloading mode
- the destination address mode is the fixed (Nochange) mode.
- the second direct memory access channel 120 is configured as a multi-block transfer mode
- the parameter loading mode of the target-side multi-block transfer mode is a linklist mode
- the source-side address mode is a fixed mode
- the target-side address mode is Incremental mode.
- the data processing unit 300 is further configured to configure the sensor 200 in a register mode and/or configure an interrupt of the sensor 200 in a self-clearing mode.
- the first direct memory access channel 110 sends the same read data command to the sensor 200 every time, so the addressing mode of the first direct memory access channel 110 is: automatically load the first source address, read from the first source address Read data command, send the read data command to the data transmission interface 500 according to the first target address, then automatically load the first source address again, read the read data command from the first source address, and send it to the data transmission interface 500 according to the first target address. read data command.
- the first direct memory access channel 110 may send a read data command to a fixed first target address.
- the register of the sensor 200 for storing sensor data can be read through the data transmission interface 500 .
- the read data command may be a 14-byte read command.
- the second direct memory access channel 120 obtains data from the data transmission interface 500 according to the fixed second source address, and specifically, obtains multiple bytes, such as 14-byte sensor data, from the data transmission interface 500 in an incremental mode.
- the storage format of the sensor data of the preset amount of data in the tightly coupled memory of the data processing unit 300 is shown in FIG. 5 , the sensor data of multiple sampling periods is stored according to the 32-bit addressing, and the sensor data of each sampling period is consecutive in bytes Store, for example, the sensor data of each sampling period including Data59 to Data72.
- the link list pointer (Link List Pointe, LLP) corresponding to the current second destination address (Destination Address, DAR) in the linked list parameter configuration points to the second destination address 16 bytes later.
- the work flow of the control device 10 is as follows:
- the first direct memory access channel 110 transmits the read data command in the tightly coupled memory to the sending register of the data transmission interface 500 according to the read data request signal, so that the data transmission interface 500 transmits the read data command to the sensor 200;
- the receiving register of the data transmission interface 500 receives the sensor data sent by the sensor 200 according to the read data command, and sends a transmission request to the second direct memory access channel 120 according to the storage state of the receiving register;
- the second direct memory access channel 120 transports the sensor data registered in the receiving register in the data transmission interface 500 to the second target address in the tightly coupled memory according to the second target address according to the transmission request;
- the data processing unit 300 performs a preset task on the data of the preset data amount according to the second interrupt signal;
- the first direct memory access channel 110 is enabled to send a read data command
- the second direct memory access channel 120 is enabled to transmit the sensor 200 to obtain the data. The data.
- a control device for a sensor includes a direct memory access controller for transmitting data acquired by the sensor to a data processing unit, wherein a direct memory access channel in the direct memory access controller is used for For sending a read data command for reading the data acquired by the sensor, another direct memory access channel is used for transmitting the data acquired by the sensor.
- the data collected by the sensor can be transmitted to the data processing unit in time.
- the data processing unit processes the sensor data, the data processing unit has stored more sensor data. The influence of the interrupt signal of the sensor on other tasks performed by the data processing unit can be reduced, and the data processing unit acquires the data of the sensor with high real-time performance.
- the control device for a sensor not only has the advantages of high communication rate in the real-time reading method, but also has the advantages of low interruption frequency in the batch reading method.
- the data transmission interface such as the high-speed interface rate of the SPI bus interface, can be retained, and the frequency of interrupts requiring software response can be effectively reduced.
- the control device includes a movable platform, which can reduce the load of the processor chip when the flight control driver software of the gimbal and unmanned aerial vehicle obtains the inertial sensor data, reduce the number of software and hardware interactions, and reduce the number of interruptions, thereby greatly reducing interruption overhead and driving. software complexity. The real-time performance of inertial sensor data acquisition is also better.
- FIG. 6 is a schematic flowchart of a control method for a sensor provided by an embodiment of the present application.
- the control method for the sensor can be applied in the control device for acquiring the data output by the sensor and other processes.
- the senor may include at least one of the following: a resistive sensor, a capacitive sensor, an inductive sensor, a piezoelectric sensor, a pyroelectric sensor, an impedance sensor, a magnetoelectric sensor, a piezoelectric sensor, a photoelectric sensor , resonant sensor, Hall sensor, ultrasonic sensor, isotope sensor, electrochemical sensor, microwave sensor, ultrasonic sensor, temperature sensor, humidity sensor, gas sensor, pressure sensor, acceleration sensor, ultraviolet sensor, magnetic sensor , magnetoresistive sensor, image sensor, electric quantity sensor, displacement sensor, pressure sensor, PH sensor, flow sensor, liquid level sensor, immersion sensor, illumination sensor, differential pressure transmitter, acceleration sensor, displacement sensor, load cell, measuring distance sensor.
- a resistive sensor a capacitive sensor, an inductive sensor, a piezoelectric sensor, a pyroelectric sensor, an impedance sensor, a magnetoelectric sensor, a piezoelectric sensor, a photoelectric sensor , resonant sensor, Hall sensor
- the control device includes, for example, one or more processors, operating individually or collectively, for acquiring the data output by the sensors.
- control device can perform preset tasks according to the data output by the sensor, including but not limited to: controlling the execution device according to the sensor, such as the working state of the motor, switch, output device and so on.
- control device includes a movable platform
- the movable platform may include at least one of an unmanned aerial vehicle, a gimbal, an unmanned vehicle, and the like.
- the aircraft may be a rotary-wing UAV, such as a quad-rotor UAV, a hexa-rotor UAV, an octa-rotor UAV, or a fixed-wing UAV.
- the movable platform includes an inertial sensor
- the inertial sensor includes, for example, an accelerometer, an angular velocity sensor (gyroscope), an inertial measurement unit (Inertial Measurement Unit, IMU), an attitude reference system (Attitude and heading reference system, AHRS). at least one.
- control method for a sensor includes steps S110 to S120.
- the first direct memory access channel of the direct memory access controller sends a read data command, where the read data command is used to read the data acquired by the sensor.
- the second direct memory access channel of the direct memory access controller transmits the data to the data processing unit.
- the first direct memory access channel sends the read data command according to a read data request signal; the read data request signal is output by an interrupt processing circuit receiving a first interrupt signal sent by the sensor.
- the first interrupt signal is sent by the sensor according to the number of times of acquiring data; or, the first interrupt signal is sent by the sensor according to the trigger of an internal timer.
- the read data request signal is output by the interrupt processing circuit according to a rising edge and/or a falling edge of the first interrupt signal.
- the interrupt processing circuit includes an edge sampling circuit.
- a second interrupt signal is sent, and the second interrupt signal is used to trigger the interrupt of the data processing unit.
- the preset amount of data includes the amount of data obtained by the sensor at least twice.
- the second interrupt signal is used to cause the data processing unit to perform a preset task according to the preset data amount of data.
- the first direct memory access channel stops sending the read data command and/or the second direct memory access channel stops transmitting the sensor while the data processing unit is processing the data acquired data.
- the data processing unit enables the first direct memory access channel to send the read data command, and/or enables the second direct memory access channel to transmit when the data is processed. data acquired by the sensor.
- the first direct memory access channel sends the read data command according to a first source address; the first source address includes a storage address of the read data command in the data processing unit.
- the read data command reads data acquired by the sensor in register mode.
- the second direct memory access channel transfers the data to the data processing unit according to a second target address; the second target address includes a bus access of a tightly coupled memory of the data processing unit address.
- the second target address includes the bus access addresses of the two caches in the tightly coupled memory; if the second direct memory access channel transmits the current data to one of the caches, the latter data is transmitted. to another cache.
- the direct memory access controller connects to the sensor through a data transfer interface.
- the data transmission interface includes at least one of the following: an SPI bus interface and an I2C bus interface.
- the data transmission interface is configured to read the data acquired by the sensor according to the read data command, and the second direct memory access channel is used to transmit the data read by the data transmission interface.
- the first direct memory access channel sends the read data command to the data transfer interface according to a first target address; the first target address includes the data transfer interface corresponding to the sensor.
- the access address of the transmit register is not limited to the first target address; the first target address includes the data transfer interface corresponding to the sensor. The access address of the transmit register.
- the second direct memory access channel obtains the data from the data transfer interface according to a second source address; the second source address includes a receive register of the data transfer interface corresponding to the sensor access address.
- the receiving register when the receiving register acquires the data acquired by the sensor, it outputs a storage request signal to the second direct memory access channel, so that the second direct memory access channel transmits the data to the second direct memory access channel. the data processing unit.
- the first direct memory access channel is configured as a multi-block transfer mode
- the parameter loading mode of the source-side multi-block transfer mode is an automatic reload mode
- the source-side address mode is an incremental mode
- the target-side address mode is Fixed mode.
- the second direct memory access channel is configured as a multi-block transfer mode
- the parameter loading mode of the target-side multi-block transfer mode is a linked list mode
- the source-side address mode is a fixed mode
- the target-side address mode is an incremental mode .
- the data processing unit is further configured to configure the sensor into a register mode and/or configure an interrupt of the sensor into a self-clearing mode.
- the data acquired by the sensor is transmitted to the data processing unit through the direct memory access controller, wherein a direct memory access channel in the direct memory access controller is used for sending data for reading the data.
- the read data command of the data acquired by the sensor, and another direct memory access channel is used to transmit the data acquired by the sensor.
- the data collected by the sensor can be transmitted to the data processing unit in time.
- the data processing unit processes the sensor data, the data processing unit has already stored more sensor data. The influence of the interrupt signal of the sensor on other tasks performed by the processor can be reduced, and the data processing unit acquires the data of the sensor with high real-time performance.
- FIG. 7 is a schematic block diagram of a control device 600 for a sensor provided by an embodiment of the present application.
- the control device can acquire the data output by the sensor.
- the control device includes, for example, one or more processors 601 , which work individually or collectively to execute the aforementioned control methods to acquire data output by the sensors.
- the processor 601 includes a data processing unit and a direct memory access controller.
- the data processing unit and the direct memory access controller can be separate chips, or can be provided in the same chip.
- the data processing unit and the direct memory access controller may be provided in a chip of an SOC (System On Chip, system on chip) architecture.
- control device can perform preset tasks according to the data output by the sensor, including but not limited to: controlling the execution device according to the sensor, such as the working state of the motor, switch, output device and so on.
- control device includes a movable platform
- the movable platform may include at least one of an unmanned aerial vehicle, a gimbal, an unmanned vehicle, and the like.
- the aircraft may be a rotary-wing UAV, such as a quad-rotor UAV, a hexa-rotor UAV, an octa-rotor UAV, or a fixed-wing UAV.
- the movable platform includes an inertial sensor
- the inertial sensor includes, for example, an accelerometer, an angular velocity sensor (gyroscope), an inertial measurement unit (Inertial Measurement Unit, IMU), an attitude reference system (Attitude and heading reference system, AHRS). at least one.
- control device 600 further includes a memory 602 .
- the processor 601 and the memory 602 are connected through a bus 603, and the bus 603 is, for example, an SPI bus or an I2C (Inter-integrated Circuit) bus.
- the bus 603 is, for example, an SPI bus or an I2C (Inter-integrated Circuit) bus.
- the processor 601 may be a micro-controller unit (Micro-controller Unit, MCU), a central processing unit (Central Processing Unit, CPU), or a digital signal processor (Digital Signal Processor, DSP) or the like.
- MCU Micro-controller Unit
- CPU Central Processing Unit
- DSP Digital Signal Processor
- the memory 602 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) magnetic disk, an optical disk, a U disk, a mobile hard disk, and the like.
- ROM Read-Only Memory
- the memory 602 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) magnetic disk, an optical disk, a U disk, a mobile hard disk, and the like.
- the processor 601 is configured to run a computer program stored in the memory 602, and implement the aforementioned control method when executing the computer program.
- the processor 601 is configured to run a computer program stored in the memory 602, and implement the following steps when executing the computer program:
- the first direct memory access channel of the direct memory access controller sends a read data command, where the read data command is used to read the data acquired by the sensor;
- the second direct memory access channel of the direct memory access controller transmits the data to the data processing unit.
- Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor enables the processor to implement the steps of the control method provided in the foregoing embodiments .
- the computer-readable storage medium may be an internal storage unit of the control device described in any of the foregoing embodiments, such as a hard disk or a memory of the control device.
- the computer-readable storage medium may also be an external storage device of the control device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the control device ) card, Flash Card, etc.
- FIG. 8 is a schematic block diagram of a movable platform 700 provided by an embodiment of the present application.
- the movable platform may include at least one of an unmanned aerial vehicle, a gimbal, an unmanned vehicle, and the like.
- the unmanned aerial vehicle may be a rotary-wing drone, such as a quad-rotor drone, a hexa-rotor drone, an octa-rotor drone, or a fixed-wing drone.
- the movable platform 700 includes the control device 10 and the sensor 200 of the foregoing embodiments.
- the sensor 200 of the movable platform 700 includes an inertial sensor, and the inertial sensor includes, for example, an accelerometer, an angular velocity sensor (gyroscope), an inertial measurement unit (Inertial Measurement Unit, IMU), a heading reference system (Attitude and heading reference system, at least one of AHRS).
- the inertial sensor includes, for example, an accelerometer, an angular velocity sensor (gyroscope), an inertial measurement unit (Inertial Measurement Unit, IMU), a heading reference system (Attitude and heading reference system, at least one of AHRS).
- the control device 10 includes a direct memory access controller and a data processing unit.
- the direct memory access controller is used to transmit the data acquired by the sensor 200 to the data processing unit.
- the direct memory access controller includes:
- a first direct memory access channel for sending a read data command, wherein the read data command is used to read data acquired by the sensor 200;
- the second direct memory access channel is used to transmit the data acquired by the sensor 200 .
- the movable platform 700 can perform preset tasks according to the data output by the sensor 200 , including but not limited to: alarming according to the data output by the sensor 200 , or controlling the working state of execution devices, such as motors and switches.
- control device 10 further includes an interrupt processing circuit, the interrupt processing circuit is configured to receive a first interrupt signal sent by the sensor 200, and output a read data request signal to the first direct memory access channel according to the first interrupt signal, the first A direct memory access channel is used to issue read data commands in response to read data request signals.
- interrupt processing circuit is configured to receive a first interrupt signal sent by the sensor 200, and output a read data request signal to the first direct memory access channel according to the first interrupt signal, the first A direct memory access channel is used to issue read data commands in response to read data request signals.
- control device 10 further includes a data transfer interface through which the direct memory access controller is connected to the sensor 200.
- the control device, method, removable platform, and storage medium for sensors provided in the embodiments of the present application transmit data acquired by the sensor to a data processing unit through a direct memory access controller, wherein the direct memory access controller in the One direct memory access channel is used to send a read data command for reading the data acquired by the sensor, and the other direct memory access channel is used to transmit the data acquired by the sensor.
- the data collected by the sensor can be transmitted to the data processing unit in time.
- the data processing unit processes the sensor data, the data processing unit has already stored more sensor data. The influence of the interrupt signal of the sensor on other tasks performed by the processor can be reduced, and the data processing unit acquires the data of the sensor with high real-time performance.
Landscapes
- Engineering & Computer Science (AREA)
- Aviation & Aerospace Engineering (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
Abstract
一种用于传感器的控制装置(10),包括直接存储器访问控制器(100),用于将传感器(200)获取的数据传输给数据处理单元(300);直接存储器访问控制器(100)包括第一直接存储器访问通道(110),用于发送读数据命令,其中读数据命令用于读取传感器(200)获取的数据;以及第二直接存储器访问通道(120),用于传输传感器(200)获取的数据。能够在获取传感器(200)的数据时,降低中断频率且具有较高实时性。还提供了方法、可移动平台和存储介质。
Description
本申请涉及传感器技术领域,尤其涉及一种用于传感器的控制装置、方法、可移动平台和存储介质。
在对一些设备,如无人飞行器、云台等可移动平台进行控制时,通常需要通过传感器,如惯性传感器IMU获取设备的姿态信息,例如三轴加速度和角速度信息;通过基于自动化控制算法对设备进行姿态矫正,可以实现例如云台增稳,飞行姿态保持等目的。姿态信息的实时性对产品的性能,用户体验有着重大的影响。
通常传感器在每次采样完成时产生一个中断,处理器响应该中断而去处理这次获取的姿态信息,由于采样率较高,会使处理器频繁中断,影响效能。或者通过将多次获取的姿态信息先保存在传感器中,处理器定时从传感器获取多次获取的姿态信息。这种传输多次获取的姿态信息的方式需要消耗较长的时间,会影响姿态信息的实时性。
发明内容
本申请提供了一种用于传感器的控制装置、方法、可移动平台和存储介质,可以在获取传感器的数据时,降低中断频率且具有较高实时性。
第一方面,本申请实施例提供了一种用于传感器的控制装置,包括:
直接存储器访问控制器,用于将传感器获取的数据传输给数据处理单元;
其中,所述直接存储器访问控制器包括:
第一直接存储器访问通道,用于发送读数据命令,其中所述读数据命令用于读取所述传感器获取的数据;以及
第二直接存储器访问通道,用于传输所述传感器获取的数据。
第二方面,本申请实施例提供了一种用于传感器的控制方法,所述方法包括:
直接存储器访问控制器的第一直接存储器访问通道发送读数据命令,所述读数据命令用于读取传感器获取的数据;
所述直接存储器访问控制器的第二直接存储器访问通道传输所述数据给数据处理单元。
第三方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现前述的控制方法。
第四方面,本申请实施例提供了一种可移动平台,所述可移动平台包括:
传感器;
数据处理单元;
直接存储器访问控制器,用于将传感器获取的数据传输给数据处理单元;
其中,所述直接存储器访问控制器包括:
第一直接存储器访问通道,用于发送读数据命令,其中所述读数据命令用于读取所述传感器获取的数据;以及
第二直接存储器访问通道,用于传输所述传感器获取的数据。
本申请实施例提供了一种用于传感器的控制装置、方法、可移动平台和存储介质,控制装置包括用于将传感器获取的数据传输给数据处理单元的直接存储器访问控制器,其中,直接存储器访问控制器中的一个直接存储器访问通道用于发送用于读取传感器获取的数据的读数据命令,另一个直接存储器访问通道用于传输传感器获取的数据。使得传感器采集的数据可以及时传输给数据处理单元,数据处理单元在对传感器数据进行处理时,数据处理单元已经存储有较多的传感器数据。可以降低传感器的中断信号对数据处理单元执行其他任务造成的影响,而且数据处理单元获取传感器的数据具有较高的实时性。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请实施例的公开内容。
为了更清楚地说明本申请实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种用于传感器的控制装置的结构示意图;
图2是一实施方式中控制装置的结构示意图;
图3是本申请实施例的控制装置中传感器数据传输的示意图;
图4是另一实施方式中控制装置的结构示意图;
图5是传感器的数据在数据处理单元中的存储格式示意图;
图6是本申请实施例另一实施例提供的一种用于传感器的控制方法的流程示意图;
图7是本申请另一实施例提供的控制装置的示意性框图;
图8是本申请实施例提供的一种可移动平台的示意性框图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
请参阅图1,图1是本申请实施例提供的一种用于传感器的控制装置10的结构示意图,控制装置10能够获取传感器200输出的数据。可以理解的,控制装置10可以包括传感器200,也可以不包括传感器200。
示例性的,传感器200可以包括以下至少一种:电阻式传感器、电容式传感器、电感式传感器、压电式传感器、热电式传感器、阻抗式传感器、磁电式 传感器、压电式传感器、光电式传感器、谐振式传感器、霍尔式传感器、超声式传感器、同位素式传感器、电化学式传感器、微波式传感器、超声波传感器、温度传感器、湿度传感器、气体传感器、压力传感器、加速度传感器、紫外线传感器、磁敏传感器、磁阻传感器、图像传感器、电量传感器、位移传感器、压力传感器、PH传感器、流量传感器、液位传感器、浸水传感器、照度传感器、差压变送器、加速度传感器、位移传感器、称重传感器、测距传感器。
在一些实施方式中,控制装置10能够根据传感器200输出的数据执行预设任务,包括但不限于:根据传感器200控制执行装置,如电机、开关、输出装置等的工作状态。
示例性的,控制装置10包括可移动平台,可移动平台可以包括无人飞行器、云台、无人车等中的至少一种。进一步而言,飞行器可以为旋翼型无人机,例如四旋翼无人机、六旋翼无人机、八旋翼无人机,也可以是固定翼无人机。
示例性的,可移动平台包括惯性传感器,惯性传感器例如包括加速度计、角速度传感器(陀螺)、惯性测量单元(Inertial Measurement Unit,IMU)、航姿参考系统(Attitude and heading reference system,AHRS)中的至少一种。
示例性的,在增稳云台、无人飞行器等控制领域,需要通过惯性传感器芯片(如IMU)获取姿态信息,例如三轴加速度和角速度信息,云台、无人飞行器的处理器对这些三轴加速度和角速度信息进行滤波算法处理,得到稳定的结果数据,然后基于PID自动化控制算法执行预设操作,以进行姿态矫正,达到云台增稳、飞行姿态保持等目的。所以云台、无人飞行器获取传感器数据的实时性对产品的性能,用户体验有着重大的影响。
目前获取传感器输出的数据主要有以下两种方式:一种是实时读取,传感器在设置好采样周期后,每次采样完成会产生一个采样完成中断,控制装置的处理器响应采样完成中断后从传感器读取数据到内存中,然后处理器再做处理。另一种是批量读取,需要传感器具有较大容量的内部缓存(BUFF),将多个采样周期的数据先暂存在内部缓存中,传感器定时产生定时中断,且在两次定时中断之间缓存多个采样周期的数据,控制装置的处理器响应定时中断后从传感器的内部缓存读取多个采样周期的数据到内存中,然后处理器再做处理。
本申请的发明人发现,实时读取的处理方式有很好的实时性,处理器可以 很及时地获取到传感器的数据,但是频繁的中断会对处理器执行其他任务,如电量检测、图像处理、信道检测和切换等任务造成影响,而且处理器响应中断时会有一系列硬件环境保存和恢复的操作,从而对处理器的资源造成严重消耗。而批量读取的处理方式可以降低中断的频率,但是在响应中断读取多个采样周期的数据需要消耗较多的时间,降低了传感器数据的实时性。另外,批量读取的方式时,由于传感器的内部缓存容量有限,两次定时中断之间的时间长度不能过大,否则会造成传感器数据的丢失。
针对该发现,本申请的发明人对用于传感器的控制装置10进行了改进,可以在获取传感器200的数据时,降低中断频率且具有较高实时性。
如图1所示,控制装置10包括直接存储器访问控制器100,直接存储器访问控制器100用于将传感器200获取的数据传输给数据处理单元300。可以理解的,传感器200获取的数据可以称为传感器数据。
直接存储器访问控制器100(Direct Memory AccessController,DMAC)可以用于在系统内部转移数据,例如将传感器200的数据搬运至数据处理单元300。示例性的,传感器200可以向数据处理单元300发出中断,数据处理单元300响应该中断后,清除该中断,然后配置直接存储器访问控制器100,在配置完成后,启动直接存储器访问控制器100,直接存储器访问控制器100进行数据传输,将传感器200的数据搬运至数据处理单元300的内部存储,示例性的,可以将传感器200的数据搬运至数据处理单元300的紧耦合内存(Tightly Coupled Memories,TCM)中。
在一些实施方式中,数据处理单元300和直接存储器访问控制器100可以为分离的芯片,也可以设置在同一个芯片中。举例而言,数据处理单元300和直接存储器访问控制器100可以设置在SOC(System On Chip,片上系统)架构的芯片中。可以理解的,如图1所示,控制装置10的形态可以是芯片。当然,在其他实施方式中,控制装置10也可以包括传感器200和/或执行装置,如电机、开关、输出装置等。
示例性的,数据处理单元300可以包括微控制单元(Micro-controller Unit,MCU)、中央处理单元(Central Processing Unit,CPU)、数字信号处理器(Digital Signal Processor,DSP)等中的至少一种。
其中,直接存储器访问控制器100包括第一直接存储器访问通道110(例 如称为DMA0,其中DMA表示Direct Memory Access)和第二直接存储器访问通道120(例如称为DMA1)。可以理解的,第一直接存储器访问通道110和第二直接存储器访问通道120可以为同一个直接存储器访问控制器100中的不同通道,也可以是不同的直接存储器访问控制器100。
具体的,请参阅图1,第一直接存储器访问通道110用于发送读数据命令,其中读数据命令用于读取传感器200获取的数据;第二直接存储器访问通道120用于传输传感器200获取的数据。
在一些实施方式中,第一直接存储器访问通道110可以根据传感器200的采样频率发送读数据命令。例如发送读数据命令的频率可以与传感器200的采样频率相同,则第一直接存储器访问通道110每发送一次读数据命令,第二直接存储器访问通道120可以将一条传感器数据传输给数据处理单元300。
其中,传感器200为IMU传感器200时,一条传感器数据包括三轴加速度数据和角速度数据,例如一条传感器数据为14字节(X、Y、Z三轴加速度信息各2字节,X、Y、Z三轴角速度信息各2字节,温度信息2字节)。传感器200的采样频率为32kHz(每秒32000次)时,1秒内有32000条传感器数据传输。
在一些实施方式中,如图2所示,控制装置10还包括中断处理电路400。中断处理电路400用于接收传感器200发送的第一中断信号,以及根据第一中断信号输出读数据请求信号。
示例性的,控制装置10具有GPIO(通用输入输出,General-purpose input/output)GPIO,通过该GPIO引脚连接传感器200。
示例性的,第一中断信号是传感器200根据获取数据的次数发送的。例如,传感器200根据预设的采样频率输出第一中断信号,在每个采样周期向控制装置10的中断处理电路400发送第一中断信号。第一中断信号例如为由高电平转换为低电平,或者由低电平转换为高电平。
示例性的,第一中断信号是传感器200根据内部定时器的触发发送的。例如,传感器200可以根据预设的采样频率输出第一中断信号,在每个采样周期向控制装置10的中断处理电路400发送第一中断信号。
示例性的,中断处理电路400根据第一中断信号的上升沿和/或下降沿输出读数据请求信号。举例而言,如图2所示,中断处理电路400包括采沿电路410。
示例性的,如图2所示,第一直接存储器访问通道110用于根据读数据请 求信号发送读数据命令。举例而言,第一直接存储器访问通道110可以根据传感器200的采样频率发送读数据命令。例如发送读数据命令的频率可以与传感器200的采样频率相同,则第一直接存储器访问通道110每发送一次读数据命令,第二直接存储器访问通道120可以将一条传感器数据传输给数据处理单元300。可以理解的,也可以通过配置第一直接存储器访问通道110,使得第一直接存储器访问通道110根据传感器200的采样频率发送读数据命令,此时可以不需要根据传感器200的第一中断信号生成读数据请求信号,和根据读数据请求信号发送读数据命令。
通过设置一个直接存储器访问通道向传感器200发送读数据命令,另一个直接存储器访问通道传输传感器200获取的数据,使得传感器200采集的数据可以及时传输给数据处理单元300,数据处理单元300在对传感器数据进行处理时,数据处理单元300已经存储有较多的传感器数据,例如可以对存储的多条传感器数据进行滤波等处理。因此,可以降低传感器200的中断信号对数据处理单元300执行其他任务造成的影响,而且数据处理单元300获取传感器200的数据具有较高的实时性。
如图3所示,是本申请实施例的控制装置10中传感器数据传输所花费的时间与实时读取方式、批量读取方式的对比。如图3所示,在实时读取方式时,数据处理单元300处理中断的频率为32kHz,数据处理单元300获取31条传感器数据的时间为968.75微秒,在第32个采样周期通过直接存储器访问控制器100获取第32条传感器数据需要花费5.6微秒(传感器数据存放在寄存器中,传输速率较高,例如为20MHz)。在批量读取方式时,传感器200的前31个采样周期时不传输传感器数据,而将传感器数据暂存在内部缓存(BUFF)中,之后花费3584微秒传输32条传感器数据(传感器数据存放在内部缓存中,传输速率较低,例如为1MHz)。本申请实施例控制装置10的读取方式,一个直接存储器访问通道向传感器200发送读数据命令,另一个直接存储器访问通道传输传感器200获取的数据,传输32条传感器数据花费的时间为968.75微秒加上5.6微秒,数据处理单元300获取传感器200的数据具有较高的实时性,而且可以降低传感器200的中断信号对数据处理单元300执行其他任务造成的影响。
在一些实施方式中,第二直接存储器访问通道120传输的数据达到预设数 据量时,发出第二中断信号,第二中断信号用于触发数据处理单元300的中断。示例性的,数据处理单元300中断时,暂停处理电量检测、图像处理、信道检测和切换等任务,以及根据预设数据量的数据执行预设任务。
示例性的,预设数据量包括传感器200至少两次获取数据的数据量。
如图3所示,在第二直接存储器访问通道120传输的数据达到32条时,触发数据处理单元300的中断,则数据处理单元300处理中断的频率为1kHz,相较于实时读取方式,可以降低传感器200的中断信号对数据处理单元300执行其他任务造成的影响。
示例性的,数据处理单元300接收到第二中断信号时,根据预设数据量的数据执行预设任务。例如,可以对预设数据量的数据进行滤波处理,根据滤波处理后的数据进行姿态矫正,达到云台增稳、飞行姿态保持等目的。
在一些实施方式中,数据处理单元300在处理数据时,第一直接存储器访问通道110停止发送读数据命令,和/或第二直接存储器访问通道120停止传输传感器200获取的数据。
在一些实施方式中,数据处理单元300在处理完数据时,使能第一直接存储器访问通道110发送读数据命令,和/或使能第二直接存储器访问通道120传输传感器200获取的数据。
示例性的,在数据处理单元300在根据预设数据量的数据执行预设任务时,暂停第一直接存储器访问通道110发送读数据命令,和/或暂停第二直接存储器访问通道120传输传感器200获取的数据,以快速可靠的根据预设数据量的数据执行预设任务。在处理完预设数据量的数据时,可以恢复第一直接存储器访问通道110发送读数据命令,和/或恢复第二直接存储器访问通道120传输传感器200获取的数据。
示例性的,数据处理单元300可以在传感器200发出新的第一中断信号前,处理完预设数据量的数据,以及使能第一直接存储器访问通道110发送读数据命令,和/或使能第二直接存储器访问通道120传输传感器200获取的数据。如图3所示,相较于批量读取方式,在第1至第32个采样周期数据处理单元300可以获取到预设数据量的数据,数据处理单元300可以在第33个采样周期传感器200发出第一中断信号前处理完第1至第32个采样周期的数据。
在一些实施方式中,第一直接存储器访问通道110根据第一源地址发送读 数据命令;第一源地址包括读数据命令在数据处理单元300中的存储地址。
示例性的,读数据命令存储在数据处理单元300的紧耦合内存中。例如数据处理单元300可以配置第一直接存储器访问通道110的源端地址为第一源地址,以使第一直接存储器将第一源地址存储的读数据命令传输给传感器200。
示例性的,读数据命令用以寄存器模式读取传感器200获取的数据。以寄存器模式读取传感器200获取的数据,可以实现较高速率的数据传输。
在一些实施方式中,第二直接存储器访问通道120根据第二目标地址将数据传输给数据处理单元300;第二目标地址包括数据处理单元300的紧耦合内存的总线访问地址。数据处理单元300可以配置第二直接存储器访问通道120的目标地址为第二目标地址,以使第二直接存储器访问通道120将传感器200获取的数据传输给数据处理单元300。
示例性的,第二目标地址包括紧耦合内存中两个缓存的总线访问地址。若第二直接存储器访问通道120将当前的数据传输给其中一个缓存,则将后一个数据传输给另一个缓存。通过采用两块缓存轮流存储数据的方式,可以保证数据处理单元300准确存储数据。
在一些实施方式中,如图4所示,直接存储器访问控制器100通过数据传输接口500连接传感器200。
示例性的,数据传输接口500包括以下至少一种:SPI总线接口、I2C总线接口,当然也不限于此。
示例性的,数据传输接口500用于根据读数据命令读取传感器200获取的数据,第二直接存储器访问通道120用于传输数据传输接口500读取的数据。
示例性的,读数据命令为与数据传输接口500匹配的命令,例如为SPI命令。
示例性的,第一直接存储器访问通道110根据第一目标地址向数据传输接口500发送读数据命令。第一目标地址包括数据传输接口500对应于传感器200的发送寄存器的访问地址。
示例性的,数据处理单元300可以配置第一直接存储器访问通道110的目标地址为第一目标地址,以使第一直接存储器将数据处理单元300中存储的读数据命令传输给数据传输接口500的发送寄存器。
示例性的,数据传输接口500能够将数据传输接口500的发送寄存器中的 信息发送给传感器200,以使传感器200将数据发送给数据传输接口500的接收寄存器。
示例性的,第二直接存储器访问通道120根据第二源地址从数据传输接口500获取数据;第二源地址包括数据传输接口500对应于传感器200的接收寄存器的访问地址。
示例性的,数据处理单元300可以配置第二直接存储器访问通道120的源地址为第二源地址,以使第二直接存储器将数据传输接口500的接收寄存器中的传感器200将数据传输给数据处理单元300。
举例而言,接收寄存器获取到传感器200获取的数据时,向第二直接存储器访问通道120输出存储请求信号,以使第二直接存储器访问通道120将数据传输给数据处理单元300。
在一些实施方式中,第一直接存储器访问通道110配置为多块传输模式(Multi-block DMA transfer),源端多块传输模式的参数加载方式为自动重加载(autoreloading)模式,源端地址模式为递增(Increment)模式,目标端地址模式为固定(Nochange)模式。
在一些实施方式中,第二直接存储器访问通道120配置为多块传输模式,目标端多块传输模式的参数加载方式为链表(linklist)模式,源端地址模式为固定模式,目标端地址模式为递增模式。
在一些实施方式中,数据处理单元300还用于将传感器200配置为寄存器模式和/或配置传感器200的中断为自清零模式。
第一直接存储器访问通道110每次发送给传感器200的读数据命令都是一样的,因此第一直接存储器访问通道110的寻址方式是:自动加载第一源地址,从第一源地址读取读数据命令,根据第一目标地址向数据传输接口500发送读数据命令,之后再次自动加载第一源地址,从第一源地址读取读数据命令,根据第一目标地址向数据传输接口500发送读数据命令。
从第一源地址读取读数据命令时,通过递增模式可以在第一源地址读取完整的多个字节,如14字节的读数据命令。第一直接存储器访问通道110可以将读数据命令发送给固定的第一目标地址。
将传感器200配置为寄存器模式,可以通过数据传输接口500读取传感器200的用于存放传感器数据的寄存器,寄存器例如存放14字节的传感器数据, 传感器数据存放在寄存器中,读取速率较高。相应的,读数据命令可以为14个字节的读命令。
第二直接存储器访问通道120根据固定的第二源地址从数据传输接口500获取数据,具体的,通过递增模式从数据传输接口500按字节获取多个字节,如14字节的传感器数据。
预设数据量的传感器数据在数据处理单元300的紧耦合内存中的存储格式如图5所示,多个采样周期的传感器数据按32比特寻址存放,各采样周期的传感器数据按字节连续存放,例如各采样周期的传感器数据包括Data59至Data72。通过将第二直接存储器访问通道120的目标端多块传输模式的参数加载方式配置为链表模式,便于紧耦合内存中传感器数据的存储和读取。具体的,链表参数配置中当前第二目标地址(Destination Address,DAR)对应的链接列表指针(Link List Pointe,LLP)指向16字节之后的第二目标地址。
举例而言,在一些实施方式中,控制装置10的工作流程如下:
1)通过GPIO引脚接收传感器200的第一中断信号,中断处理电路400根据第一中断信号产生读数据请求信号;
2)第一直接存储器访问通道110根据读数据请求信号,将紧耦合内存中的读数据命令传输给数据传输接口500的发送寄存器,以使数据传输接口500将读数据命令传输给传感器200;
3)数据传输接口500的接收寄存器接收传感器200根据读数据命令发送的传感器数据,根据接收寄存器的存储状态向第二直接存储器访问通道120发送传输请求;
4)第二直接存储器访问通道120根据传输请求,按照第二目标地址将数据传输接口500中接收寄存器寄存的传感器数据搬运至紧耦合内存中的第二目标地址;
5)循环执行上述1)至4),直至第二直接存储器访问通道120搬运预设数据量的传感器数据,如32个采样周期的传感器数据时,第二直接存储器访问通道120向数据处理单元300发出第二中断信号;
6)数据处理单元300根据第二中断信号,对预设数据量的数据执行预设任务;
7)数据处理单元300根据预设数据量的数据执行完预设任务时,使能第一 直接存储器访问通道110发送读数据命令,和/或使能第二直接存储器访问通道120传输传感器200获取的数据。
本申请实施例提供的用于传感器的控制装置,包括用于将传感器获取的数据传输给数据处理单元的直接存储器访问控制器,其中,所述直接存储器访问控制器中的一个直接存储器访问通道用于发送用于读取所述传感器获取的数据的读数据命令,另一个直接存储器访问通道用于传输所述传感器获取的数据。使得传感器采集的数据可以及时传输给数据处理单元,数据处理单元在对传感器数据进行处理时,数据处理单元已经存储有较多的传感器数据。可以降低传感器的中断信号对数据处理单元执行其他任务造成的影响,而且数据处理单元获取传感器的数据具有较高的实时性。
本申请实施例提供的用于传感器的控制装置,既具有实时读取方式高通信速率的优点,又具有批量读取方式低中断频次的优点。通过直接存储器访问控制器,既可以保留数据传输接口,如SPI总线接口的高速接口速率,又有效的降低了需要软件响应的中断频次。
控制装置包括可移动平台,可以减少云台、无人飞行器的飞控驱动软件获取惯性传感器数据时处理器芯片的负载,减少软硬件交互次数,通过减少中断次数,从而大大减少中断开销,降低驱动软件复杂度。对于惯性传感器数据获取的实时性也更好。
请结合前述实施例参阅图6,图6是本申请实施例提供的一种用于传感器的控制方法的流程示意图。所述用于传感器的控制方法可以应用在控制装置中,用于获取传感器输出的数据等过程。
示例性的,传感器可以包括以下至少一种:电阻式传感器、电容式传感器、电感式传感器、压电式传感器、热电式传感器、阻抗式传感器、磁电式传感器、压电式传感器、光电式传感器、谐振式传感器、霍尔式传感器、超声式传感器、同位素式传感器、电化学式传感器、微波式传感器、超声波传感器、温度传感器、湿度传感器、气体传感器、压力传感器、加速度传感器、紫外线传感器、磁敏传感器、磁阻传感器、图像传感器、电量传感器、位移传感器、压力传感器、PH传感器、流量传感器、液位传感器、浸水传感器、照度传感器、差压变送器、加速度传感器、位移传感器、称重传感器、测距传感器。
控制装置例如包括一个或多个处理器,一个或多个处理器单独地或共同地 工作,用于获取传感器输出的数据。
在一些实施方式中,控制装置能够根据传感器输出的数据执行预设任务,包括但不限于:根据传感器控制执行装置,如电机、开关、输出装置等的工作状态。
示例性的,控制装置包括可移动平台,可移动平台可以包括无人飞行器、云台、无人车等中的至少一种。进一步而言,飞行器可以为旋翼型无人机,例如四旋翼无人机、六旋翼无人机、八旋翼无人机,也可以是固定翼无人机。
示例性的,可移动平台包括惯性传感器,惯性传感器例如包括加速度计、角速度传感器(陀螺)、惯性测量单元(Inertial Measurement Unit,IMU)、航姿参考系统(Attitude and heading reference system,AHRS)中的至少一种。
如图6所示,本申请实施例的用于传感器的控制方法包括步骤S110至步骤S120。
S110、直接存储器访问控制器的第一直接存储器访问通道发送读数据命令,所述读数据命令用于读取传感器获取的数据。
S120、所述直接存储器访问控制器的第二直接存储器访问通道传输所述数据给数据处理单元。
在一些实施方式中,所述第一直接存储器访问通道根据读数据请求信号发送所述读数据命令;所述读数据请求信号由中断处理电路接收所述传感器发送的第一中断信号输出。
示例性的,所述第一中断信号是所述传感器根据获取数据的次数发送的;或者,所述第一中断信号是所述传感器根据内部定时器的触发发送的。
示例性的,所述读数据请求信号是中断处理电路根据所述第一中断信号的上升沿和/或下降沿输出的。
示例性的,所述中断处理电路包括采沿电路。
在一些实施方式中,所述第二直接存储器访问通道传输的数据达到预设数据量时,发出第二中断信号,所述第二中断信号用于触发所述数据处理单元的中断。
示例性的,所述预设数据量包括所述传感器至少两次获取数据的数据量。
示例性的,所述第二中断信号用于使所述数据处理单元根据所述预设数据 量的数据执行预设任务。
在一些实施方式中,在所述数据处理单元处理所述数据时,所述第一直接存储器访问通道停止发送所述读数据命令,和/或所述第二直接存储器访问通道停止传输所述传感器获取的数据。
在一些实施方式中,所述数据处理单元在处理完所述数据时,使能所述第一直接存储器访问通道发送所述读数据命令,和/或使能所述第二直接存储器访问通道传输所述传感器获取的数据。
在一些实施方式中,所述第一直接存储器访问通道根据第一源地址发送所述读数据命令;所述第一源地址包括所述读数据命令在所述数据处理单元中的存储地址。
在一些实施方式中,所述读数据命令用以寄存器模式读取所述传感器获取的数据。
在一些实施方式中,所述第二直接存储器访问通道根据第二目标地址将所述数据传输给所述数据处理单元;所述第二目标地址包括所述数据处理单元的紧耦合内存的总线访问地址。
示例性的,所述第二目标地址包括所述紧耦合内存中两个缓存的总线访问地址;若所述第二直接存储器访问通道将当前的数据传输给其中一个缓存,则将后一个数据传输给另一个缓存。
在一些实施方式中,所述直接存储器访问控制器通过数据传输接口连接所述传感器。
示例性的,所述数据传输接口包括以下至少一种:SPI总线接口、I2C总线接口。
在一些实施方式中,所述数据传输接口用于根据所述读数据命令读取所述传感器获取的数据,所述第二直接存储器访问通道用于传输所述数据传输接口读取的数据。
在一些实施方式中,所述第一直接存储器访问通道根据第一目标地址向所述数据传输接口发送所述读数据命令;所述第一目标地址包括所述数据传输接口对应于所述传感器的发送寄存器的访问地址。
在一些实施方式中,所述第二直接存储器访问通道根据第二源地址从所述数据传输接口获取所述数据;所述第二源地址包括所述数据传输接口对应于所 述传感器的接收寄存器的访问地址。
在一些实施方式中,所述接收寄存器获取到所述传感器获取的数据时,向所述第二直接存储器访问通道输出存储请求信号,以使所述第二直接存储器访问通道将所述数据传输给所述数据处理单元。
在一些实施方式中,所述第一直接存储器访问通道配置为多块传输模式,源端多块传输模式的参数加载方式为自动重加载模式,源端地址模式为递增模式,目标端地址模式为固定模式。
在一些实施方式中,所述第二直接存储器访问通道配置为多块传输模式,目标端多块传输模式的参数加载方式为链表模式,源端地址模式为固定模式,目标端地址模式为递增模式。
在一些实施方式中,所述数据处理单元还用于将所述传感器配置为寄存器模式和/或配置所述传感器的中断为自清零模式。
本申请实施例提供的控制方法的具体原理和实现方式均与前述实施例的控制装置类似,此处不再赘述。
本申请实施例提供的控制方法,通过直接存储器访问控制器将传感器获取的数据传输给数据处理单元,其中,所述直接存储器访问控制器中的一个直接存储器访问通道用于发送用于读取所述传感器获取的数据的读数据命令,另一个直接存储器访问通道用于传输所述传感器获取的数据。使得传感器采集的数据可以及时传输给数据处理单元,数据处理单元在对传感器数据进行处理时,数据处理单元已经存储有较多的传感器数据。可以降低传感器的中断信号对处理器执行其他任务造成的影响,而且数据处理单元获取传感器的数据具有较高的实时性。
请结合上述实施例参阅图7,图7是本申请实施例提供的用于传感器的控制装置600的示意性框图。控制装置能够获取传感器输出的数据。
控制装置例如包括一个或多个处理器601,一个或多个处理器601单独地或共同地工作,用于执行前述的控制方法,以获取传感器输出的数据。
具体的,处理器601包括数据处理单元和直接存储器访问控制器。数据处理单元和直接存储器访问控制器可以为分离的芯片,也可以设置在同一个芯片中。举例而言,数据处理单元和直接存储器访问控制器可以设置在SOC(System On Chip,片上系统)架构的芯片中。
在一些实施方式中,控制装置能够根据传感器输出的数据执行预设任务,包括但不限于:根据传感器控制执行装置,如电机、开关、输出装置等的工作状态。
示例性的,控制装置包括可移动平台,可移动平台可以包括无人飞行器、云台、无人车等中的至少一种。进一步而言,飞行器可以为旋翼型无人机,例如四旋翼无人机、六旋翼无人机、八旋翼无人机,也可以是固定翼无人机。
示例性的,可移动平台包括惯性传感器,惯性传感器例如包括加速度计、角速度传感器(陀螺)、惯性测量单元(Inertial Measurement Unit,IMU)、航姿参考系统(Attitude and heading reference system,AHRS)中的至少一种。
示例性的,控制装置600还包括存储器602。
示例性的,处理器601和存储器602通过总线603连接,该总线603比如为SPI总线,或者为I2C(Inter-integrated Circuit)总线。
具体地,处理器601可以是微控制单元(Micro-controller Unit,MCU)、中央处理单元(Central Processing Unit,CPU)或数字信号处理器(Digital Signal Processor,DSP)等。
具体地,存储器602可以是Flash芯片、只读存储器(ROM,Read-Only Memory)磁盘、光盘、U盘或移动硬盘等。
其中,所述处理器601用于运行存储在存储器602中的计算机程序,并在执行所述计算机程序时实现前述的控制方法。
示例性的,所述处理器601用于运行存储在存储器602中的计算机程序,并在执行所述计算机程序时实现如下步骤:
直接存储器访问控制器的第一直接存储器访问通道发送读数据命令,所述读数据命令用于读取传感器获取的数据;
所述直接存储器访问控制器的第二直接存储器访问通道传输所述数据给数据处理单元。
本申请实施例提供的控制装置的具体原理和实现方式均与前述实施例的控制方法类似,此处不再赘述。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现上述实 施例提供的控制方法的步骤。
其中,所述计算机可读存储介质可以是前述任一实施例所述的控制装置的内部存储单元,例如所述控制装置的硬盘或内存。所述计算机可读存储介质也可以是所述控制装置的外部存储设备,例如所述控制装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
请结合前述实施例参阅图8,图8是本申请实施例提供的可移动平台700的示意性框图。示例性的,可移动平台可以包括无人飞行器、云台、无人车等中的至少一种。进一步而言,无人飞行器可以为旋翼型无人机,例如四旋翼无人机、六旋翼无人机、八旋翼无人机,也可以是固定翼无人机。
具体的,该可移动平台700包括前述实施例的控制装置10以及传感器200。
示例性的,可移动平台700的传感器200包括惯性传感器,惯性传感器例如包括加速度计、角速度传感器(陀螺)、惯性测量单元(Inertial Measurement Unit,IMU)、航姿参考系统(Attitude and heading reference system,AHRS)中的至少一种。
其中,控制装置10包括直接存储器访问控制器和数据处理单元。
具体的,直接存储器访问控制器用于将传感器200获取的数据传输给数据处理单元。
其中,直接存储器访问控制器包括:
第一直接存储器访问通道,用于发送读数据命令,其中读数据命令用于读取传感器200获取的数据;以及
第二直接存储器访问通道,用于传输传感器200获取的数据。
在一些实施方式中,可移动平台700能够根据传感器200输出的数据执行预设任务,包括但不限于:根据传感器200输出的数据报警,或者控制执行装置,如电机、开关的工作状态。
在一些实施方式中,控制装置10还包括中断处理电路,中断处理电路用于接收传感器200发送的第一中断信号,以及根据第一中断信号向第一直接存储器访问通道输出读数据请求信号,第一直接存储器访问通道用于根据读数据请求信号发送读数据命令。
在一些实施方式中,控制装置10还包括数据传输接口,直接存储器访问控 制器通过数据传输接口连接传感器200。
本申请实施例提供的可移动平台的具体原理和实现方式均与前述实施例的控制装置法类似,此处不再赘述。
本申请实施例提供的用于传感器的控制装置、方法、可移动平台和存储介质,通过直接存储器访问控制器将传感器获取的数据传输给数据处理单元,其中,所述直接存储器访问控制器中的一个直接存储器访问通道用于发送用于读取所述传感器获取的数据的读数据命令,另一个直接存储器访问通道用于传输所述传感器获取的数据。使得传感器采集的数据可以及时传输给数据处理单元,数据处理单元在对传感器数据进行处理时,数据处理单元已经存储有较多的传感器数据。可以降低传感器的中断信号对处理器执行其他任务造成的影响,而且数据处理单元获取传感器的数据具有较高的实时性。
应当理解,在此本申请中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。
还应当理解,在本申请和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。
Claims (49)
- 一种用于传感器的控制装置,其特征在于,包括:直接存储器访问控制器,用于将传感器获取的数据传输给数据处理单元;其中,所述直接存储器访问控制器包括:第一直接存储器访问通道,用于发送读数据命令,其中所述读数据命令用于读取所述传感器获取的数据;以及第二直接存储器访问通道,用于传输所述传感器获取的数据。
- 根据权利要求1所述的控制装置,其特征在于,还包括:中断处理电路,用于接收所述传感器发送的第一中断信号,以及根据所述第一中断信号输出读数据请求信号;所述第一直接存储器访问通道用于根据所述读数据请求信号发送所述读数据命令。
- 根据权利要求2所述的控制装置,其特征在于,所述第一中断信号是所述传感器根据获取数据的次数发送的;或者,所述第一中断信号是所述传感器根据内部定时器的触发发送的。
- 根据权利要求2所述的控制装置,其特征在于,所述中断处理电路根据所述第一中断信号的上升沿和/或下降沿输出读数据请求信号。
- 根据权利要求4所述的控制装置,其特征在于,所述中断处理电路包括采沿电路。
- 根据权利要求1-5中任一项所述的控制装置,其特征在于,所述第二直接存储器访问通道传输的数据达到预设数据量时,发出第二中断信号,所述第二中断信号用于触发所述数据处理单元的中断。
- 根据权利要求6所述的控制装置,其特征在于,所述预设数据量包括所述传感器至少两次获取数据的数据量。
- 根据权利要求6所述的控制装置,其特征在于,所述数据处理单元接收到所述第二中断信号时,根据所述预设数据量的数据执行预设任务。
- 根据权利要求1-8中任一项所述的控制装置,其特征在于,在所述数据处理单元处理所述数据时,所述第一直接存储器访问通道停止发送所述读数据 命令,和/或所述第二直接存储器访问通道停止传输所述传感器获取的数据。
- 根据权利要求9所述的控制装置,其特征在于,所述数据处理单元在处理完所述数据时,使能所述第一直接存储器访问通道发送所述读数据命令,和/或使能所述第二直接存储器访问通道传输所述传感器获取的数据。
- 根据权利要求1-10中任一项所述的控制装置,其特征在于,所述第一直接存储器访问通道根据第一源地址发送所述读数据命令;所述第一源地址包括所述读数据命令在所述数据处理单元中的存储地址。
- 根据权利要求11所述的控制装置,其特征在于,所述读数据命令用以寄存器模式读取所述传感器获取的数据。
- 根据权利要求1-12中任一项所述的控制装置,其特征在于,所述第二直接存储器访问通道根据第二目标地址将所述数据传输给所述数据处理单元;所述第二目标地址包括所述数据处理单元的紧耦合内存的总线访问地址。
- 根据权利要求13所述的控制装置,其特征在于,所述第二目标地址包括所述紧耦合内存中两个缓存的总线访问地址;若所述第二直接存储器访问通道将当前的数据传输给其中一个缓存,则将后一个数据传输给另一个缓存。
- 根据权利要求1-14中任一项所述的控制装置,其特征在于,所述直接存储器访问控制器通过数据传输接口连接所述传感器。
- 根据权利要求15所述的控制装置,其特征在于,所述数据传输接口包括以下至少一种:SPI总线接口、I2C总线接口。
- 根据权利要求15或16所述的控制装置,其特征在于,所述数据传输接口用于根据所述读数据命令读取所述传感器获取的数据,所述第二直接存储器访问通道用于传输所述数据传输接口读取的数据。
- 根据权利要求15-17中任一项所述的控制装置,其特征在于,所述第一直接存储器访问通道根据第一目标地址向所述数据传输接口发送所述读数据命令;所述第一目标地址包括所述数据传输接口对应于所述传感器的发送寄存器的访问地址。
- 根据权利要求17所述的控制装置,其特征在于,所述第二直接存储器访问通道根据第二源地址从所述数据传输接口获取所述数据;所述第二源地址包括所述数据传输接口对应于所述传感器的接收寄存器的访问地址。
- 根据权利要求19所述的控制装置,其特征在于,所述接收寄存器获取到所述传感器获取的数据时,向所述第二直接存储器访问通道输出存储请求信号,以使所述第二直接存储器访问通道将所述数据传输给所述数据处理单元。
- 根据权利要求1-20中任一项所述的控制装置,其特征在于,所述第一直接存储器访问通道配置为多块传输模式,源端多块传输模式的参数加载方式为自动重加载模式,源端地址模式为递增模式,目标端地址模式为固定模式。
- 根据权利要求1-21中任一项所述的控制装置,其特征在于,所述第二直接存储器访问通道配置为多块传输模式,目标端多块传输模式的参数加载方式为链表模式,源端地址模式为固定模式,目标端地址模式为递增模式。
- 根据权利要求1-22中任一项所述的控制装置,其特征在于,所述数据处理单元还用于将所述传感器配置为寄存器模式和/或配置所述传感器的中断为自清零模式。
- 一种用于传感器的控制方法,其特征在于,所述方法包括:直接存储器访问控制器的第一直接存储器访问通道发送读数据命令,所述读数据命令用于读取传感器获取的数据;所述直接存储器访问控制器的第二直接存储器访问通道传输所述数据给数据处理单元。
- 根据权利要求24所述的控制方法,其特征在于,所述第一直接存储器访问通道根据读数据请求信号发送所述读数据命令;所述读数据请求信号由中断处理电路接收所述传感器发送的第一中断信号输出。
- 根据权利要求25所述的控制方法,其特征在于,所述第一中断信号是所述传感器根据获取数据的次数发送的;或者,所述第一中断信号是所述传感器根据内部定时器的触发发送的。
- 根据权利要求25所述的控制方法,其特征在于,所述读数据请求信号是中断处理电路根据所述第一中断信号的上升沿和/或下降沿输出的。
- 根据权利要求27所述的控制方法,其特征在于,所述中断处理电路包括采沿电路。
- 根据权利要求24-28中任一项所述的控制方法,其特征在于,所述第二直接存储器访问通道传输的数据达到预设数据量时,发出第二中断信号,所述第二中断信号用于触发所述数据处理单元的中断。
- 根据权利要求29所述的控制方法,其特征在于,所述预设数据量包括所述传感器至少两次获取数据的数据量。
- 根据权利要求29所述的控制方法,其特征在于,所述第二中断信号用于使所述数据处理单元根据所述预设数据量的数据执行预设任务。
- 根据权利要求24-31中任一项所述的控制方法,其特征在于,在所述数据处理单元处理所述数据时,所述第一直接存储器访问通道停止发送所述读数据命令,和/或所述第二直接存储器访问通道停止传输所述传感器获取的数据。
- 根据权利要求32所述的控制方法,其特征在于,所述数据处理单元在处理完所述数据时,使能所述第一直接存储器访问通道发送所述读数据命令,和/或使能所述第二直接存储器访问通道传输所述传感器获取的数据。
- 根据权利要求24-33中任一项所述的控制方法,其特征在于,所述第一直接存储器访问通道根据第一源地址发送所述读数据命令;所述第一源地址包括所述读数据命令在所述数据处理单元中的存储地址。
- 根据权利要求34所述的控制方法,其特征在于,所述读数据命令用以寄存器模式读取所述传感器获取的数据。
- 根据权利要求24-35中任一项所述的控制方法,其特征在于,所述第二直接存储器访问通道根据第二目标地址将所述数据传输给所述数据处理单元;所述第二目标地址包括所述数据处理单元的紧耦合内存的总线访问地址。
- 根据权利要求36所述的控制方法,其特征在于,所述第二目标地址包括所述紧耦合内存中两个缓存的总线访问地址;若所述第二直接存储器访问通道将当前的数据传输给其中一个缓存,则将后一个数据传输给另一个缓存。
- 根据权利要求24-37中任一项所述的控制方法,其特征在于,所述直接存储器访问控制器通过数据传输接口连接所述传感器。
- 根据权利要求38所述的控制方法,其特征在于,所述数据传输接口包括以下至少一种:SPI总线接口、I2C总线接口。
- 根据权利要求38或39所述的控制方法,其特征在于,所述数据传输接 口用于根据所述读数据命令读取所述传感器获取的数据,所述第二直接存储器访问通道用于传输所述数据传输接口读取的数据。
- 根据权利要求38-40中任一项所述的控制方法,其特征在于,所述第一直接存储器访问通道根据第一目标地址向所述数据传输接口发送所述读数据命令;所述第一目标地址包括所述数据传输接口对应于所述传感器的发送寄存器的访问地址。
- 根据权利要求40所述的控制方法,其特征在于,所述第二直接存储器访问通道根据第二源地址从所述数据传输接口获取所述数据;所述第二源地址包括所述数据传输接口对应于所述传感器的接收寄存器的访问地址。
- 根据权利要求42所述的控制方法,其特征在于,所述接收寄存器获取到所述传感器获取的数据时,向所述第二直接存储器访问通道输出存储请求信号,以使所述第二直接存储器访问通道将所述数据传输给所述数据处理单元。
- 根据权利要求24-43中任一项所述的控制方法,其特征在于,所述第一直接存储器访问通道配置为多块传输模式,源端多块传输模式的参数加载方式为自动重加载模式,源端地址模式为递增模式,目标端地址模式为固定模式。
- 根据权利要求24-44中任一项所述的控制方法,其特征在于,所述第二直接存储器访问通道配置为多块传输模式,目标端多块传输模式的参数加载方式为链表模式,源端地址模式为固定模式,目标端地址模式为递增模式。
- 根据权利要求24-45中任一项所述的控制方法,其特征在于,所述数据处理单元还用于将所述传感器配置为寄存器模式和/或配置所述传感器的中断为自清零模式。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如权利要求24-46中任一项所述的控制方法。
- 一种可移动平台,其特征在于,所述可移动平台包括:传感器;数据处理单元;直接存储器访问控制器,用于将传感器获取的数据传输给数据处理单元;其中,所述直接存储器访问控制器包括:第一直接存储器访问通道,用于发送读数据命令,其中所述读数据命令用于读取所述传感器获取的数据;以及第二直接存储器访问通道,用于传输所述传感器获取的数据。
- 根据权利要求48所述的可移动平台,其特征在于,所述可移动平台包括如下至少一种:无人飞行器、云台、无人车。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/135842 WO2022120818A1 (zh) | 2020-12-11 | 2020-12-11 | 用于传感器的控制装置、方法、可移动平台和存储介质 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/135842 WO2022120818A1 (zh) | 2020-12-11 | 2020-12-11 | 用于传感器的控制装置、方法、可移动平台和存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022120818A1 true WO2022120818A1 (zh) | 2022-06-16 |
Family
ID=81974167
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/135842 WO2022120818A1 (zh) | 2020-12-11 | 2020-12-11 | 用于传感器的控制装置、方法、可移动平台和存储介质 |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2022120818A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115952128A (zh) * | 2023-02-22 | 2023-04-11 | 南京芯驰半导体科技有限公司 | 通信方法、相关装置、芯片及存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104407617A (zh) * | 2014-12-22 | 2015-03-11 | 大连理工大学 | 可编程飞行器姿态控制ip核 |
CN105353996A (zh) * | 2015-10-14 | 2016-02-24 | 深圳市亚泰光电技术有限公司 | 一种检测信号处理装置及方法 |
US20160299687A1 (en) * | 2015-04-13 | 2016-10-13 | SK Hynix Inc. | Controller transmitting output commands and method of operating the same |
CN110147347A (zh) * | 2019-03-18 | 2019-08-20 | 腾讯科技(深圳)有限公司 | 用于矩阵处理的芯片、矩阵处理方法、装置及存储介质 |
-
2020
- 2020-12-11 WO PCT/CN2020/135842 patent/WO2022120818A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104407617A (zh) * | 2014-12-22 | 2015-03-11 | 大连理工大学 | 可编程飞行器姿态控制ip核 |
US20160299687A1 (en) * | 2015-04-13 | 2016-10-13 | SK Hynix Inc. | Controller transmitting output commands and method of operating the same |
CN105353996A (zh) * | 2015-10-14 | 2016-02-24 | 深圳市亚泰光电技术有限公司 | 一种检测信号处理装置及方法 |
CN110147347A (zh) * | 2019-03-18 | 2019-08-20 | 腾讯科技(深圳)有限公司 | 用于矩阵处理的芯片、矩阵处理方法、装置及存储介质 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115952128A (zh) * | 2023-02-22 | 2023-04-11 | 南京芯驰半导体科技有限公司 | 通信方法、相关装置、芯片及存储介质 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10482045B2 (en) | Data communication interface for processing data in low power systems | |
US9594720B2 (en) | Interface between a bus and a inter-thread interconnect | |
JP6004608B2 (ja) | ホストusbアダプタを仮想化するための方法、装置、およびコンピュータ・プログラム(ホストusbアダプタの仮想化) | |
US6985977B2 (en) | System and method for transferring data over a communication medium using double-buffering | |
US20140278205A1 (en) | Embedded processor on an integrated mems sensor chip autonomously managing external sensor | |
WO2021035645A1 (zh) | 传感系统、传感设备及其控制方法、可移动平台和存储介质 | |
US8429324B2 (en) | Bus-protocol converting device and bus-protocol converting method | |
KR102460750B1 (ko) | Ois 기능을 갖는 카메라 장치 및 그 통신 방법 | |
CN108924520B (zh) | 传输控制方法、装置、控制器、拍摄设备及飞行器 | |
WO2022120818A1 (zh) | 用于传感器的控制装置、方法、可移动平台和存储介质 | |
US10936310B2 (en) | Systems and methods for interfacing a sensor and a processor | |
CN208987073U (zh) | 一种拍摄设备及飞行器 | |
US20190329408A1 (en) | Robot, method for controlling motion of a robot and non-transitory readable medium | |
CN108920193B (zh) | Fpga和cpu间sdio通信接口实现方法、及装置 | |
JPH0752418B2 (ja) | デ−タ受信方式 | |
JP2014010759A (ja) | ブリッジ装置およびその方法、ストレージ装置、ならびにプログラム | |
US20060184708A1 (en) | Host controller device and method | |
WO2022027337A1 (zh) | 可移动平台的控制系统、控制方法、设备及存储介质 | |
US9170964B2 (en) | USB device interrupt signal | |
US5481756A (en) | DMA controller mailing auto-initialize halting unit | |
CN207764789U (zh) | 用于地震仪主控站cpu与外设数据传输的桥接器 | |
WO2020037542A1 (zh) | 数据指令处理方法、存储芯片、存储系统和可移动平台 | |
JPH10334037A (ja) | 通信dma装置 | |
WO2022227092A1 (zh) | 可移动平台、芯片设计的验证装置、验证方法 | |
US20100082894A1 (en) | Communication system and methos between processors |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20964754 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20964754 Country of ref document: EP Kind code of ref document: A1 |