wangkuo0203的个人空间 https://bbs.21ic.com/?697112 [收藏] [复制] [RSS]

日志

An Air Plie

已有 381 次阅读2016-12-10 21:10 |个人分类:Recent Projects|系统分类:嵌入式系统| MCU, Embedded

Abstract:
This essay records some details about the air plie project.

Requirements:
1.Input source: DC 12V 2A
2.Buttons: emergency stop, waist program, pelvis/foot program, buttock program and heating program
3.Output, DC12V
i.Air pump: PWM, duty cycle 85%
ii.Heating: PWM, duty cycle 13%. The load’s RMS voltage equals (12*12*13%)1/2, about 4.3V
iii.Magnetic valves: 3 in all. PWM, 100% for the first 300ms after electrified each time, then 80%
4.LED: 
i.1 Power LED, lighting when DC12V insertion
ii.3 LED for waist program, stretch program, exercise program
iii.2 LED for moulding program and beautiful feet program
iv.2 LED for buttock program and malaxation program 
v.1 LED for heating program
vi.ALL except power LED blink if an exception occurs
5.Autostop
i.Heating program stops after heating 20 minutes
ii.Others stop after one full program cycle
6.Watchdog timer required
7.FET fault detection, short circuit detection required.
Panel: as the right 

Function description:

1. All processes stop by pressing the Emergency Stop Button. All LED go out except the power LED.

2. LED1 lights on by pressing the Waist Program Button, and waist process runs. Switch among waist, stretch and exercise process by pressing this button again. LED1 - 3 respectively indicate these 3 different processes.

3. LED5 lights on by pressing the Moulding Program Button, and pelvis process runs. It also switches between pelvis and feet process. LED5 and LED6 indicate these two statuses.

4. LED8 lights on by pressing the Buttock Program Button, and buttock process runs. Switch between buttock and malaxation process. LED8 and LED9 indicate them.

5. LED11 and heating switch between on and off by pressing the Heating Button.

6. Heating ends in 20 minutes, and all other programs end after one program cycle.

7. Testing program: By press buttons combination for a long time, it enters the testing process which would detect hardware faults and throw out warnings.

Program Details:

Each program is provided in a table that contains step information. Each step information indicates the status (ON/OFF) of the air pump, the heater and the three magnetic valves. 1 indicates ON, while 0 or BLANK indicates OFF.

Here is an example.         Table 1

 This table contains 12 steps. The first step lasts for 10 seconds during which the air pump and magnetic valve 1 are ON. This process ends after step 12. It lasts 62 seconds in all.

Hardware solution

Power section

A voltage regulator and related electrolytic capacitors were needed for converting the input 12V DC to 5V.

Control section

There are 5 channels in all for the air pump, the heater, and the three magnetic valves. Each channel is similar. Take the air pump as an example.

A MOSFET was used for controlling the pump’s ON/OFF state and its current consumption via changing the pin’s state of microcontroller.



R16 was used for detecting current. While the pump signal is in a logical low state, Q1 was not supposed to be in ON-state, so we expected An-pump’s voltage to be 0. If a voltage of more than that was detect, we knew a MOSFET fault had occurred. In addition, if we detect an unusual high voltage here, an over current or a short circuit event had occurred. The threshold voltage for over current detection is Vth = Ith * R16. Here Ith  for this pump is 1A, so Vth eques 0.2V.

MCUs

                                                           MCU on the Control Board.

TM52F5268B Features:

1.      Standard 8051 Instructions set, six times faster than standard 8051

2.      8K Bytes Flash Memory supporting both ICP and IAP

3.      256 Bytes SRAM

4.      8051 Standard Timer 0/1/2

5.      In addition to 8051 Standard UART, this chip also PROVIDES ONE WIRE UART MODE to transmit and receive data USING TXD ONLY.

6.      12 BIT ADC with 10 channels external Pin input.

7.      Independent RC Oscillating Watchdog Timer

Other features unrelated to this essay are not listed.

As the figure above shows, P1 was a port for communicating using UART one wire mode with the other MCU on the UI Board.

                        MCU on the UI Board

As shown above, the UI Board also had a communicating port, P1, connected by three-core cable to the other board’s communicating port. There was a red LED lighting on whenever power source was on.

Keys and LEDs 

Here were the keys and LEDs required for users. A cycle contains six milliseconds during which the LEDs are lighted and the keys are read asynchronous. As there was only one resistance connected to all five keys together, combinational keys were not supported.

Software solution

Only a little code is shown here for respecting intellectual property.


This code is for turning off system while connection fails.

These tables contain all step information.

This code changes every output pin’s state each second (if needed)

THE END


路过

鸡蛋

鲜花

握手

雷人

全部作者的其他最新日志

评论 (0 个评论)