Design of farmland irrigation control board based on Freescale Kinetis

Publisher:hzx312895379Latest update time:2012-05-19 Source: 单片机与嵌入式系统 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
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.

a.jpg


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

b.jpg


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.

c.jpg


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.

d.jpg

[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.

e.jpg


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.

f.jpg

[page]

3 Software Design
3.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:

g.jpg


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.

h.jpg



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.

Reference address:Design of farmland irrigation control board based on Freescale Kinetis

Previous article:Porting standard Linux to S3C2410
Next article:Transplantation of CramFS root file system based on s3c2410

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号