Design of windsurfing control system based on AVR single chip microcomputer

Publisher:春水碧于天Latest update time:2012-12-18 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Design Tasks

Design and make a sailboard control system, which can adjust the wind force and change the sailboard turning angle θ by controlling the fan speed, as shown in Figure 1. The sailboard form and specific manufacturing dimensions are shown in Figure 2.

Figure 1 Schematic diagram of windsurfing control system

Figure 2: Dimensions of sailboard production

According to the requirements of the topic, the design task is to achieve that when the distance between the fan and the sailboard changes within a certain range, the sailboard is automatically adjusted to reach the preset angle set by the keyboard (hereinafter referred to as: preset parameters) within the specified time, and the relevant data in the control process is processed and displayed in real time.

Design idea: With AVR single-chip microcomputer as the core, closed-loop control is adopted. The angle sensor detects the actual rotation angle of the windsurfing board. The single-chip microcomputer collects the data at a fixed time and compares it with the preset parameters of the windsurfing board to generate a PWM signal for regulating the fan motor. The LCD screen is used to display the preset parameters, the rotation angle of the windsurfing board, the PWM signal used for adjustment, and the time when the regulation process is completed.

System hardware design and implementation

Hardware Overview

The system consists of the following basic modules: power module, single chip control module, motor drive module, display and sound and light alarm module, keyboard module and angle detection module. The whole system block diagram is shown in Figure 3.

Figure 3 System block diagram

(1) Control module: AVR microcontroller control;

(2) Angle detection module: using ADXL345 angle sensor;

(3) Fan type: Axial flow hair dryer fan;

(4) Motor drive mode: using L298 motor drive chip;

(5) Display module: LCD1602 liquid crystal module is used for display;

(6) Power module: uses LM2576 switching step-down voltage regulator chip.

Angle detection circuit

The angle sensor uses the three-axis accelerometer ADXL345. Its output data is in 16-bit binary complement format and can be accessed through SPI (3-wire or 4-wire) or I2C digital interface. The data of ADXL345 is sampled 50 times cumulatively and the average value is taken as the result. This method successfully solves the problem of unstable sail swinging. The microcontroller calculates the value and preset parameters based on the value, and finally generates a PWM signal to adjust the speed of the fan motor.

ADXL345 communicates with the microcontroller in I2C mode, and the circuit is shown in Figure 4. The angle detection circuit consists of IC1, IC3, R15, and R16.

Figure 4 Angle detection circuit

Drive circuit

The motor driver module L298 contains a 4-channel logic drive circuit. It is a dedicated driver for two-phase and four-phase motors. It contains two H-bridge high-voltage and high-current dual full-bridge drivers, receives standard TTL logic level signals, and can drive dual motors. The motor drive wiring circuit is shown in Figure 5.

Figure 5 Motor drive circuit

In the circuit, the fan motor is connected to the OUT1 and OUT2 output ports of L298. The two input pins for controlling the forward and reverse rotation of the motor, pin 7 is connected to the power supply through resistor R4, and pin 9 is directly grounded. The PWM signal for controlling the speed of the fan motor is output by the PD5 pin of the microcontroller and connected to the enable control terminal pin 8 through the isolation optocoupler IC5. The on-off time of the L298 output is controlled by the change of PWM, which enables the microcontroller to adjust the speed of the fan motor and ultimately controls the strength of the wind that blows the sailboard to rotate. D1~D4 in the circuit act as freewheeling diodes.

Sound and light alarm and button circuit

An audible and visual alarm circuit is designed in the system, as shown in Figure 6. When the sailboard rotates to the preset parameters, the single-chip microcomputer controls its operation and the alarm lasts for 5 seconds. It consists of resistors R5, R18, light-emitting diode D5, transistor Q1 and speaker LS1. When the PA5 pin of the single-chip microcomputer outputs a low-level signal, the diode emits light and the buzzer sounds, realizing the audible and visual alarm.

Figure 6 Sound and light alarm, keyboard circuit

The key functions in the system are to control the movement of the sail motor and set the angle parameter value of the sailboard. The functions of each key are as follows:

S1: Start button, after pressing, the motor starts;

S2: Stop button, after jogging, the motor stops;

S3: Confirmation key, first operation, allows setting preset parameters, second operation, exit, and store parameters (preset parameters are stored in the EEPROM of the microcontroller);

S4: Add 1 key, jog once, the value of the preset parameter's unit digit increases by 1;

S5: Add 1 key, press once, and the tens digit of the preset parameter will increase by 1.

power supply

The efficiency of the LM2576 switching regulator is much higher than that of the three-terminal linear regulator, and it has excellent linearity and load adjustment capabilities. It contains a frequency compensator and a fixed frequency oscillator, which can reduce the number of external components to a minimum and is easy to use. The power supply circuit is shown in Figure 7.

Figure 7 Power supply circuit [page]

Design Tasks

Design and make a sailboard control system, which can adjust the wind force and change the sailboard turning angle θ by controlling the fan speed, as shown in Figure 1. The sailboard form and specific manufacturing dimensions are shown in Figure 2.

Figure 1 Schematic diagram of windsurfing control system

Figure 2: Dimensions of sailboard production

According to the requirements of the topic, the design task is to achieve that when the distance between the fan and the sailboard changes within a certain range, the sailboard is automatically adjusted to reach the preset angle set by the keyboard (hereinafter referred to as: preset parameters) within the specified time, and the relevant data in the control process is processed and displayed in real time.

Design idea: With AVR single-chip microcomputer as the core, closed-loop control is adopted. The angle sensor detects the actual rotation angle of the windsurfing board. The single-chip microcomputer collects the data at a fixed time and compares it with the preset parameters of the windsurfing board to generate a PWM signal for regulating the fan motor. The LCD screen is used to display the preset parameters, the rotation angle of the windsurfing board, the PWM signal used for adjustment, and the time when the regulation process is completed.

System hardware design and implementation

Hardware Overview

The system consists of the following basic modules: power module, single chip control module, motor drive module, display and sound and light alarm module, keyboard module and angle detection module. The whole system block diagram is shown in Figure 3.

Figure 3 System block diagram

(1) Control module: AVR microcontroller control;

(2) Angle detection module: using ADXL345 angle sensor;

(3) Fan type: Axial flow hair dryer fan;

(4) Motor drive mode: using L298 motor drive chip;

(5) Display module: LCD1602 liquid crystal module is used for display;

(6) Power module: uses LM2576 switching step-down voltage regulator chip.

Angle detection circuit

The angle sensor uses the three-axis accelerometer ADXL345. Its output data is in 16-bit binary complement format and can be accessed through SPI (3-wire or 4-wire) or I2C digital interface. The data of ADXL345 is sampled 50 times cumulatively and the average value is taken as the result. This method successfully solves the problem of unstable sail swinging. The microcontroller calculates the value and preset parameters based on the value, and finally generates a PWM signal to adjust the speed of the fan motor.

ADXL345 communicates with the microcontroller in I2C mode, and the circuit is shown in Figure 4. The angle detection circuit consists of IC1, IC3, R15, and R16.

Figure 4 Angle detection circuit

Drive circuit

The motor driver module L298 contains a 4-channel logic drive circuit. It is a dedicated driver for two-phase and four-phase motors. It contains two H-bridge high-voltage and high-current dual full-bridge drivers, receives standard TTL logic level signals, and can drive dual motors. The motor drive wiring circuit is shown in Figure 5.

Figure 5 Motor drive circuit

In the circuit, the fan motor is connected to the OUT1 and OUT2 output ports of L298. The two input pins for controlling the forward and reverse rotation of the motor, pin 7 is connected to the power supply through resistor R4, and pin 9 is directly grounded. The PWM signal for controlling the speed of the fan motor is output by the PD5 pin of the microcontroller and connected to the enable control terminal pin 8 through the isolation optocoupler IC5. The on-off time of the L298 output is controlled by the change of PWM, which enables the microcontroller to adjust the speed of the fan motor and ultimately controls the strength of the wind that blows the sailboard to rotate. D1~D4 in the circuit act as freewheeling diodes.

Sound and light alarm and button circuit

An audible and visual alarm circuit is designed in the system, as shown in Figure 6. When the sailboard rotates to the preset parameters, the single-chip microcomputer controls its operation and the alarm lasts for 5 seconds. It consists of resistors R5, R18, light-emitting diode D5, transistor Q1 and speaker LS1. When the PA5 pin of the single-chip microcomputer outputs a low-level signal, the diode emits light and the buzzer sounds, realizing the audible and visual alarm.

Figure 6 Sound and light alarm, keyboard circuit

The key functions in the system are to control the movement of the sail motor and set the angle parameter value of the sailboard. The functions of each key are as follows:

S1: Start button, after pressing, the motor starts;

S2: Stop button, after jogging, the motor stops;

S3: Confirmation key, first operation, allows setting preset parameters, second operation, exit, and store parameters (preset parameters are stored in the EEPROM of the microcontroller);

S4: Add 1 key, jog once, the value of the preset parameter's unit digit increases by 1;

S5: Add 1 key, press once, and the tens digit of the preset parameter will increase by 1.

power supply

The efficiency of the LM2576 switching regulator is much higher than that of the three-terminal linear regulator, and it has excellent linearity and load adjustment capabilities. It contains a frequency compensator and a fixed frequency oscillator, which can reduce the number of external components to a minimum and is easy to use. The power supply circuit is shown in Figure 7.

Figure 7 Power supply circuit

Reference address:Design of windsurfing control system based on AVR single chip microcomputer

Previous article:Research on bridge monitoring system based on wireless sensor network
Next article:Design of automatic tracking control system for dish-type Stirling solar system

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号