2011年11月29日星期二

51 single-chip closed-loop PWM DC motor speed control system design

51 single-chip closed-loop PWM DC motor speed control system design
    Hardware circuit DC motor closed-loop system using the speed control is in practice for many years, the complexity of the hardware components, adaptation, flexibility, lack of supervision. This article describes a closed-loop PWM DC motor control system speed, the use of low-cost 89C2051 chip microcomputer as the core to achieve closed loop control, and speed can be set to a digital display, easy to use. The motor speed using pulse width modulation, compared to control how fast the Thyristor with advanced technology, can reduce the strength of pollution. The system was used to speed up the treadmill condition, reliable, with favorable results. Figure 1 shows a diagram of this system the main PWM signal, closed loop control for your computer speed DC motor of several parts.
 development board
The PWM signal generating circuit
    PWM waveform output PWM microcontroller (such as the 80C198, etc.) produced by the program can also be used to achieve the PWM ASIC. Wave of the PWM frequency is too high, the DC motor drive
Power control requirements are too high, too low electromagnetic noise generated over. Practical application of the PWM frequency of 18 kHz wave about better. After complete analysis, the system uses two 4-digit and 12-bit comparator 4585 against the 4040-series form of the circuit produces a PWM signal. Two of the control group U3, U2 4040 count as a group, then the output Q2 ~ K9-hand, group B received a single-chip microcomputer port P1. Change the output port P1, the use amount of the PWM signal can produce changes in speed. 4040 account from the CLK input crystal oscillator output connected to the XTAL2 microcontroller 2051. When using a 18MHz crystal, ~ QO Q2 divided by 8, Q2 ~ Q9 frequencies 256, resulting waveform for the PWM frequency of 17.6kHz, connector and power switch on fieldwork reasonable.
    4040-8 received per pulse, the output Q2 Q9 ~ 1, if the number is less than or equal to the value of the output port of the microcontroller X, P1, U2 (> B) to maintain production at a low number of large X, U2, (> B), output is high. As the count increases, Q2 Q9 ~ all "1" for all "O" in (> B), then output goes low, so that U2 (> B) side of the PWM signal duty cycle (255-X/255) × 100%, change the value of X can change the amount of use of the PWM signal, the continuous control of engine speed. Use this method to set the Chip output below the value of X, the PWM signal to the three multi-purpose digital circuits, software to make a very simplified, single-chip system favors the work. As a single chip power reset output port P1 to all "1", use the B-group, and 4585 connected to port P1 or port speed of the Directorate-General X of certain rules to reduce the production of more time for deceleration according to certain rules.
Figure 1 Closed-loop DC motor PWM speed control schematic
2 single-chip microcomputer closed-loop speed control
    
Back to the embedded system is used for low-cost microcontroller 89C2051, 80C552 and 80C198 and the PWM output is compared to the expansion of the external EPROM, and the price is much lower. 2051 micro-chip is a 2K Flash Program Memory, 15 I / O ports, two 16-bit timer / counter, instruction, and interrupt system is compatible with 8031, the speed control loop is closed very flexible.
    
Closed speed control sensor Hall effect sensor selection, a small magnet attached to the shaft under test pulse for each revolution of the output signal. Speed ​​pulse signal through a Schmitt trigger U6 1, U6-2 Reconstructive Surgery, 2051 MCU in the interrupt input port port P3.2. The software, which was abandoned in the interrupt service routine is a timer / counter synchronization S in terms of revolutions per cycle is controlled by the software to calculate the value of X, P1 to the PWM output port number of service cycle control. The software can also display the track or the angular velocity of the conversion calculation, eight-yard drive LED digital tube display. As the key cruise S1, S2 input, "+" "-" control, but also pre-qualified LED digital display.
    
It uses a series of highly integrated MAX7219 LED display driver for driving eight LED digital tube, the first four shows of the current speed, constant speed after the show.MAX7219 is a 24-pin narrow package of the chip, the serial port for a maximum operating frequency of 10MHz, eight LED display, via the disassemble mode register programming, you can control the display (BCD code or decoding) display of on-chip scan mode dynamic resistance and can be programmed to control the brightness and shows up more than 64-bit chips in series by a common cathode LED digital tube. MAX7219 DIN input data, a clock terminal CLK, a data latch half liter, respectively, and the 2051 microcontroller P3.0, P3.1, P3.5 phase ports. The adjustable resistor R6 resistance to change screen brightness, R6 values ​​between 3.9 ~ 10kQ. Using the MAX7219 not only reduces the system hardware, such as on-chip dynamic display, scan, and can reduce energy consumption and simplify software design.
    
2051 single-chip microcomputer is reset by the function of password * MAX812 voltage equipment, power of about 200 ms of delay, so the normal reset. To avoid loss stop after the preset number to use a battery backup to protect the value of the 2051 MCU on-chip RAM. To repair the transformer, through the AC-DC switching power supply output 5V DC supply voltage of the microcontroller system throughout the three-terminal regulator component 7812 to the output voltage of 12V to drive the switch power to use them. Power single-chip and the drive circuit of isolation, to improve system reliability and security.
DC motor drive circuit 3
    
DC motor system in Figure 2

STC 8051 Starter Kit

On-board resources
●    Default processor is STC12C5A60S2
●    Default clock is 11.0592MHz
●    Eight LED
●    Common anode four in one 7 -segment LED
●    One passive buzzer
●    1602LCD port


●    4x4 keyboard matrix
●    Four AD signal: Potential meter, photo resistor, thermal resistor and supply voltage.
●    DS18B20 temperature sensor port
●    Two serial ports:  (P3.0,P3.1)  and  (P1.2,P1.3)
●    One STC serial programmer port
●    USB to UART bridge chip PL2303HX
●    RS232 to TTL level convertor chip SP3232EEN
http://www.siliconray.com/stc-8051-starter-kit.html
Sample program code
1、  LED driving
2、  The static status display of 7-segment LED
8、  Four AD signal sensor
9、  1602 liquid -crystal display
10、1602 LCD AD signal sensor result
11、1602 LCD DS18B20 temperature sensor structure
12、 UART test
3、  The dynamic display of 7-segment LED
4、  keyboard matrix test
5、  Four independent key query mode test
6、  Four independent key interrupt mode test
7、  Buzzer test

2011年11月28日星期一

the usefulness of microcontroller development board

Microcontroller development board was used to train 51, ​​CTS, laboratory equipment, the standard AVR microcontroller. There used to model 51 single chip development, the development of STC microcontroller board, Microcontroller Development Board in April, widespread support material, source code, test programs, circuits, printed circuit board layouts, and other educational materials. Microcontroller development board, such as e-people need special support to some scholars, VB development PC game development tutorials and other teaching materials. MCU Development Board to develop these companies generally complete after-sales service and technical support.

siliconray:Arduino ATmega2560-16AU

Features





Microcontroller

ATmega2560




Operating Voltage

5V




Input Voltage (recommended)

7-12V




Input Voltage (limits)

6-20V




Digital I/O Pins

54 (of which 14 provide PWM output)




Analog Input Pins

16




DC Current per I/O Pin

40 mA




DC Current for 3.3V Pin

50 mA




Flash Memory

256 KB of which 4 KB used by bootloader




SRAM

8 KB




EEPROM

4 KB

Clock Speed

16MHz


Arduino ATmega2560-16AU is the newest and most powerful arduino board. Comparing to ATmega 128 it has the following 2 new features:
1. ATMEGA2560 is used, the memory size is doubled comparing to ATmeaga 128
2. ATmega8U2 is used as replacement of FT232RL as USB bridget. Besids USB-UART bridge, it can also be configured as mouse, joystick, camera or keyboard.

2011年11月25日星期五

What is a development board?

Development board (demoboard) is used for embedded system development board, including the central processor, memory, input devices, output devices, data access / bus interfaces and external resources and a series of hardware components. Development board for embedded systems developers generally according to their custom development needs, but also by user-research and design.