At present, the problem of water resources in China is becoming increasingly prominent. The lack of water resources and unreasonable distribution are its objective reasons. To fundamentally alleviate this problem, we must start from saving water and improving the utilization rate of water resources. China's agricultural water consumption accounts for about 80% of the total water consumption. Due to the generally low utilization rate of agricultural irrigation water, the utilization rate of water is only 45% nationwide, while countries with high water resource utilization rates have reached 70-80%. Therefore, solving the problem of agricultural irrigation water is very important for alleviating the shortage of water resources. In view of the characteristics of automatic irrigation, in order to complete digital control, a farmland irrigation control card based on Frecscale Kinetis was developed and developed. The use of such an integrated control card simplifies the hardware circuit structure of the entire control system and improves the reliability and control accuracy of the system.
1 Overall design
According to the requirements, the irrigation control card needs to meet the following functions:
·Control the input motor or servo motor to accurately control the water pump, which can be independently controlled every week, accurately position the opening of any valve, and the pulse output speed can reach up to 100K.
·Software valve opening limit function.
·Multiple machines can be interconnected to meet the requirements of collaborative farmland production.
·Connect to PC to download irrigation control files.
·Use SD card to upgrade the system and store irrigation files.
·Can work independently offline and support display of start, stop and fault status prompts.
·Can control up to 4 soil moisture sensors and can be connected with carbon dioxide sensors and illuminance sensors.
In view of the above requirements, in order to meet the performance requirements and also meet the low price requirements, a high-performance and low-priced Cortex-M4ARM single-chip solution is selected. The ARM chip uses MK60DN 512ZVLL10, which belongs to the Kinetis K60 series of Freescale. The ARM Cortex-M4 processor is the latest embedded processor specially developed by ARM to meet the digital signal control market that requires effective and easy-to-use control and signal processing functions. The combination of efficient signal processing functions and the low power consumption, low cost and easy-to-use advantages of the Cortex-M4 processor series is designed to meet the flexible solutions for emerging categories specifically for motor control, automotive, power management, embedded audio and industrial automation markets.
The system block diagram of this system and the PC is shown in Figure 1.
The irrigation automatic control system is mainly composed of the central main control system (main computer, control cabinet), solenoid valve, field humidity sensor (can measure the absolute value of soil humidity), meteorological observation station (can measure temperature, wind direction, wind speed), data acquisition instruction transmission and other communication equipment. You can sit in the control room cover, conduct a comprehensive analysis of the meteorological data, field soil humidity and other data transmitted by the control board, and irrigate the entire controlled area manually or automatically without leaving home. At the same time, you can also use the data query system and printing system to record, query and print the meteorological data, soil humidity, irrigation settings, irrigation process, irrigation history records and other data of the entire irrigation area at any time.
The system consists of multiple control units, each of which manages an area. Using the Internet of Things and Industrial Ethernet, it is managed uniformly by the central computer. The outdoor air temperature and humidity sensor sends the results to the computer, where the irrigation parameters are set and the irrigation situation is counted, and the data and charts can be stored and displayed on the computer through special software. At the same time, special operations can be performed manually. Obtain weather information through the Internet and implement irrigation in a predictable manner.
[page]
2 Hardware Design
2.1 Features and Applications of ARM Processors
Freescal's MK60DN512ZVLL10 belongs to the Kinetis K60 series. The package is LOFP144 pin. The chip has the following features:
·ARM Cortex-M4 core + DSP. 512K flash, 512K Flex Memmory, 128K SRAM, 16K cache, 150MHz, single-cycle MAC, single instruction multiple data (SIMD) extension, optional single-precision floating-point unit.
·Up to four high-speed 16-bit ADCs with configurable resolution. Single or differential output mode can be used to improve noise suppression. Programmable delay block trigger function conversion time can reach 500 ns.
·With 3 high-speed comparators, it provides fast and accurate motor overcurrent protection by keeping PWM in a safe state.
·Up to four 64x programmable gain amplifiers for small amplitude signal conversion.
·Analog reference voltage provides accurate reference values for analog blocks, ADCs and DACs, which can replace external reference voltages and reduce system costs.
· DMA with 32 channels for peripherals and memory, which can reduce CPU load and achieve faster system throughput.
· Connectivity and communication: UART supports ISO7816 and IrDA, supports I2S, IC and SPI, and has 2 CAN modules for industrial network bridging.
· Reliability and security: Hardware cyclic redundancy check engine is used to verify memory contents, communication data and increase system reliability, COP with independent clock is used to prevent code from running away, and external watchdog monitoring.
· Timing and control: Powerful FlexTimers support general, PWM and motor control functions. Programmable interrupt timer is used for RTOS task scheduling or to provide trigger source for ADC conversion and programmable delay module.
· External interface: Versatile external bus interface provides interface with external memory, gate array logic or LCD.
· System: 5 V tolerant GPIO with pin interrupt function. Wide operating voltage range from 1.71 V to 3.6 V, flash programming voltage as low as 1.71 V, and all functions of flash and analog peripherals are normal at this time.
· Operating temperature: -40℃ to 105℃.
2.2 JTAG Debug Interface
The PC uses the JTAG interface to download programs and debug the irrigation control card, and downloads irrigation control instructions through the 232 serial port.
2.3 Networking and multi-machine interconnection
The 485 serial port and CAN interface are used for networking and multi-machine interconnection. The networking function of the irrigation controller can meet the synchronization requirements of farmland production. The networking can use CAN bus or 485 bus according to needs.
2.4 SDHC interface
The SDHC interface uses 4-bit operation and is used to connect SD cards. It can support SDHC large-capacity SD cards. SD cards can be used to upgrade the application program of the irrigation control card and update the control instructions. Its interface circuit is shown in Figure 5.
[page]
2.5 Flash memory
Flash memory is used to store a variety of irrigation control methods. When the irrigation control card is running, it reads the specified motion irrigation file and executes it. The flash memory uses the MX25L1605 with SPI interface and has a capacity of 16MB, which can store a large number of irrigation control program files. Figure 6 MX25L1605 interface circuit diagram. The NOT gate circuit conversion is shown in Figure 7.
2.6 PWM interface
The PWM interface is used to control the pump motor and control the flow rate. The single-channel PWM is output from the MCU MK60DN512ZVLL10 and converted through the NOT gate circuit.
2.7 Avoidance of external signals
In actual work, the interference of external signals should be avoided as much as possible. To achieve this goal, an optocoupler device is used in the system. Its input end is equipped with a light-emitting device and the output end is a light receiver. When the switch input is connected to the circuit, it will be blocked outside the optocoupler, thereby isolating the interference. The output interface is shown in Figure 8.
[page]
3 Software Design3.1 Software Development Environment
IAR for ARM 6.2 is used as the ARM software development environment.
3.2 Software Function Overview
The system is connected to a PC, and can download and read control parameter files. It can also collect and archive field parameters through the dedicated software on the PC. The PC can perform preliminary debugging, installation and testing of the system. After the test, the irrigation control file can be edited and downloaded to the motion control for execution. At the same time, in order to facilitate the generation of irrigation control files, a teaching system is designed on the PC, which can be used to configure and optimize the control file.
This system uses a PWM-based method to control DC motors, which is flexible and reliable, and the accuracy meets the requirements. The irrigation control file is stored in the flash memory using G code. After booting, it can be read from the flash memory through the default irrigation control file number set by the computer, and then parsed and executed one by one. If it is an irrigation instruction during execution, the software offline operation block diagram is shown in Figure 9:
3.3 Key software algorithms
Pump control algorithm: The pump speed control in this paper adopts an adaptive control algorithm. Adaptive control is to continuously extract relevant model information during the operation of the system. The algorithm is adjusted according to the new information. It is a powerful means to overcome the influence of parameter changes. The adaptive control system can be regarded as having two closed loops, one is the conventional feedback loop composed of the controller and the controlled object; the other is the controller's parameter adjustment loop. As shown in Figure 10.
4 Summary
With the development of computer technology and electronic technology, automated equipment will be widely used to replace manual operation, and irrigation control cards that can meet complex control will be more and more widely used in ecological agriculture. The irrigation control board introduced in this article can meet the requirements after testing and use, and can work repeatedly for a long time, greatly reducing the use of farmland labor and reducing work intensity. At the same time, it also has a great effect on improving production efficiency and optimizing crop growth.
Previous article:Porting standard Linux to S3C2410
Next article:Transplantation of CramFS root file system based on s3c2410
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Basics of Machine Learning: From Getting Started to Job Hunting (Hu Huanwu)
- Switching Power Supply Simulation and Design - Based on SPICE (Second Edition)
- Embedded Security Processor Application and Practice
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Silicon Labs BG22-EK4108A Bluetooth Development Review] Burn Bootloader + Debug Bluetooth iBeacon
- Electromagnetic compatibility design and rectification countermeasures and case analysis
- Award-winning live broadcast: TI DLP technology innovation and new applications in automobiles, 10-year DLP senior engineer explains for you
- How to send numerical values with decimal points through the serial port of a microcontroller
- Two Application Examples of EPROM in Single Chip Microcomputer Development
- [Erha Image Recognition Artificial Intelligence Vision Sensor] Evaluation 1: Winner Chip Level Evaluation
- Circuit PCB Design
- What is Wi-Fi 6?
- 51 MCU software sharing, friends who want it can download it
- 【NUCLEO-L552ZE Review】+ Unboxing and lighting