Design of windsurfing control system based on STC12C5A60S2

Publisher:Xiaohan521Latest update time:2012-06-07 Source: 电子设计工程 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
As a type of microcontroller, single-chip microcomputers are widely used in daily life. This course is comprehensive and practical, and involves a lot of knowledge. It plays an important role in cultivating and training students' ability to develop and design hardware and software using single-chip microcomputer technology, students' ability to analyze and solve problems, vocational skills of higher vocational students, and practical innovation ability, laying a foundation for the detection and design of automatic control and application electronic products. This article is derived from the F question of the 2011 National Electronic Design Competition, which designs and implements a windsurfing control system. The system requires the preset angle through the keyboard, the wind force of the fan to control the angle of the windsurfing board, and displays it in real time. This question involves single-chip microcomputer application technologies such as angle detection, motor drive, PWM, closed-loop control, and AD conversion, which are important components of the windsurfing autonomous navigation system.

1 System solution description
According to the requirements, this system consists of six modules: single-chip microcomputer minimum system, human-computer interaction module, fan control module, angle detection module, sound and light alarm module, and system power supply. The specific block diagram is shown in Figure 1.

a.jpg


1.1 Microprocessor module
The STC12C5A60S2 microcontroller from STC is used as the microprocessor.
This microcontroller is an enhanced 51 microcontroller with the characteristics of high speed, low power consumption and super strong anti-interference. It integrates MAX810 dedicated reset circuit, 2-way PWM, and 8-way high-speed 10-bit A/D converter (speed up to 250,000 times/second), which is very consistent with the system requirements.
1.2 Angle detection module
The MMA7361 acceleration angle sensor is used to measure the angle. The acceleration angle sensor calculates the inclination angle of the device relative to a certain plane by measuring the acceleration caused by gravity. The angle sensor is sensitive, the output data is accurate and the price is moderate. There are three types of angle measurement using acceleration sensors: single-axis inclination measurement, dual-axis inclination measurement and three-axis inclination measurement. In this design, since only the angle between the sailboard and the vertical direction is measured, single-axis inclination measurement is selected. The principle of single-axis inclination measurement is shown in Figure 2. A single axis (i.e., the x-axis) rotates through gravity.

b.jpg [page]

Since this method only uses a single axis and requires a gravity vector, the calculated inclination angle can only be accurate when the device has a specific direction and the x-axis is always in the center plane. According to basic trigonometric principles, the projection of the gravity vector on the x-axis will produce an output acceleration equal to the sine of the angle between the x-axis of the accelerometer and the horizontal line. The horizontal line is usually a plane perpendicular to the gravity vector. When the gravity is an ideal value of 1 g, the output acceleration is:
AX. OUT[g]=lgxsin(φ)
In actual use, referring to the technical manual of the sensor MMA7361 used and the principle of measuring angles using an accelerometer, the relationship between the output voltage and the measured angle is:
d.jpg
Wherein, VOUT represents the output voltage of the accelerometer, VOFFSET represents the offset of the accelerometer when the gravity acceleration is 0 g, e.jpg represents the sensitivity of the accelerometer, 1 g represents the gravity acceleration on the earth, and θ represents the deflection angle.
Therefore, the angle value can be obtained as follows:
f.jpg
The angle detection circuit diagram is shown in Figure 3. The angle detection module outputs the angle analog quantity, which is converted by the single-chip AD and calculated by the above formula to obtain the measured angle value.

c.jpg

[page]

1.3 Fan Control Module
PWM (Pulse Width Modulation) is a method of digitally encoding analog signal levels. It is a very effective technology for controlling analog circuits using the digital output of a microprocessor. Compared with the voltage speed control method, PWM speed control has the advantages of high precision and easy control. At the same time, the selected microcontroller integrates a PCA module, which can directly output PWM and is convenient to use.
This system uses a DC motor to drive the fan to rotate. The motor driver chip MC33886 is a monolithic integrated H-bridge component, which is suitable for driving low-power DC motors. This circuit selects the full-bridge working mode of MC33886. When using a single chip, the temperature of the drive circuit will be very high. Sometimes the temperature will exceed the maximum temperature of the MC33886 self-protection, causing the drive to stop working. In order to solve this problem, two identical MC33886s are connected in parallel, and it is found that the temperature is effectively controlled and the driving ability of the circuit is further improved. The circuit is shown in Figure 4.

g.jpg


In order to accurately control the fan speed and achieve the purpose of controlling the angle of the sailboard, the system uses the single-chip microcomputer to obtain the actual angle of the sailboard through the angle detection module, compares it with the preset angle, and outputs an adjustable PWM signal through the PI controller to drive the DC motor to rotate, thereby forming a wind speed closed-loop control system, that is, negative feedback control. The block diagram of the motor speed control module is shown in Figure 5.

h.jpg

[page]

2 System software design
The system software is mainly completed by the main program and various subroutines. In the main program module, it is necessary to complete the initialization of various parameters and interfaces, PCA module initialization, LCD screen initialization, angle acquisition, keyboard scanning, main loop and other tasks. The main program flow chart is shown in Figure 6(a). In the fan speed control, this system adopts the incremental PI algorithm, and the specific flow chart is shown in Figure 6(b).

i.jpg



3 Conclusions
The windsurfing control system designed in this paper can well complete the windsurfing angle measurement and control tasks. Among them, the STC12C5A60S2 single-chip microcomputer is very suitable for vocational college students to learn single-chip microcomputers. At the same time, the angle closed-loop PID control system of the system can quickly and accurately adjust the angle. The whole system runs stably, the human-computer interaction interface is friendly, and the number of devices used is small, the circuit is simple, and the cost performance is high.

Reference address:Design of windsurfing control system based on STC12C5A60S2

Previous article:Features and Applications of USB2.0 Controller CY7C68013
Next article:Single-chip DSP controller solution

Recommended ReadingLatest update time:2024-11-17 00:02

C51 microcontroller adjusts PWM wave through serial port
PWM is a commonly used electronic control technology PWM stands for pulse width modulation, which can be simply understood as the control of duty cycle. The figure below is an example of duty cycle, which is the ratio of high level time to cycle time in a cycle. Some MCUs now have built-in PWM control function,
[Microcontroller]
C51 microcontroller adjusts PWM wave through serial port
High-performance PWM modulated power management IC - ME8263
Nanjing Micro One Electronics Inc. recently launched a high-performance PWM modulated power management IC-ME8263, which is an AC/DC switching power supply controller specially designed for cost-effective small and medium power power adapters. ME8263 has lower standby power consumption, lower EMI (with frequency
[Power Management]
High-performance PWM modulated power management IC - ME8263
Working principle of single-phase full-bridge PWM rectifier circuit
By comparing the sine signal wave with the triangle wave and performing SPWM control on V1~V4 in Figure 6-28b, an SPWM wave uAB can be generated at the AC input terminal AB of the bridge. uAB contains a fundamental component with the same frequency and amplitude as the sine signal wave, as well as high-freq
[Power Management]
Working principle of single-phase full-bridge PWM rectifier circuit
Use the PWM output function of the STM32 timer to directly obtain the PWM waveform
This experiment shows you how to output a PWM waveform with a fixed duty cycle. 1. Establishment of the project: 2. Main function code: 3.pwm_output.c code: 4.output.h code: 5. Results: 6. If the result cannot be displayed, please refer to the articles in the previous sections, which have been resolved.
[Microcontroller]
#C51 interrupt timing (PWM output + external interrupt frequency detection)
Preface The C51 microcontroller itself has no PWM output, but can use the T1 timing interrupt to output a pulse signal of a certain frequency, and the duty cycle is adjustable, which is convenient for further development. Tip: The following is the main content of this article. The following cases can be used for ref
[Microcontroller]
#C51 interrupt timing (PWM output + external interrupt frequency detection)
PCA9685 PWM servo driver board 16-channel module IIC interface
16-channel module PWM servo driver board controller robot IIC interface user manual AdafruitPWMServoDriverLibrary microcontroller source code is as follows: /***************************************************   This is a library for our Adafruit 16-channel PWM & Servo driver   Pick one up today in the adafruit sh
[Microcontroller]
PCA9685 PWM servo driver board 16-channel module IIC interface
Embedded driver learning PWM buzzer driver
Development Environment Host development environment: Ubuntu 12.04 BootLoader:u-boot-1.1.6 kernel:linux-2.6.30.4 CPU:s3c2440 Development board: TQ2440 Development steps 1. Hardware Analysis The hardware circuit diagram is as follows: In the driver program, first initialize the function of the pin corresponding to
[Microcontroller]
Embedded driver learning PWM buzzer driver
STM32F103VCT6 Advanced Timer PWM Output
The following waveform is required : dead time 1us, phase difference between CH1 and CH2 3us, frequency 50HZ. 1. To get TIM1 counter clock at 72MHz, the prescaler is  computer  as follows:           Prescaler = (TIM1CLK / TIM1 counter clock) - 1      To objective is to genterate PWM signal at 50KHz:           -TIM1_
[Microcontroller]
STM32F103VCT6 Advanced Timer PWM Output
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号