Sie sind auf Seite 1von 4

2014 7th International Conference on Intelligent Computation Technology and Automation

An Automatic Level Adjustment Device Based on STM32


1
1

Wang Yao-hui, 2Shi Jian-rong, 1*Bao Ke-jin

College of Computer Science and Telecommunication Engineering, Jiangsu University, Xuefu Road No.301,
Zhenjiang, 212013, China
2

Zhenjiang Metrological Verification and Test Center, Yihou road No.306, Zhenjiang, 212132, China
1*

bkj@ujs.edu.cn

AbstractHigher requirements of the placement of


numerous instruments are necessary in Industry,
Medical and Metering System. The device now
available is of low efficiency and accuracy. In view of
the problem, a new device was designed based on
STM32, According to the feedback of the angle sensor,
the PID closed-loop control algorithm was adopted. The
stepper motor and reduction gearbox were connected
by gears, and the gearbox made the screw rod rotate.
Then, the scissor jacks move up or down .The device
makes a more accuracy, much faster and high load
ratings way to get a horizontal plane.

consists of a level bar and seven electro optical


sensors, and the device cannot supply a high accuracy
horizontal measurement.
Although predecessors have already done some
researches, but theres still room to improvement.
This paper considered of control algorithm, actuator
and angle sensor, designed a more efficient, more
accuracy and high load rating auto level adjustment
device.
II.

Keywords-Angle sensor; Iterative Damping Filter;


Level Adjustment; Stepper Motor; Scissor Jack

I.

This device consists of four parts: Control Circuit,


Angle Sensor, Stepper Motor and Actuator, as is
shown in figure 1. The mentality of designing is get
angle between working plane and water level through
the angle sensor, and use PID close loop control
algorithm to make sure to the adjustment of the
horizontal plane in the shortest time. The MCU
control the stepper motor driver to drive stepper
motor rotate. The stepper motor control the scissor
jacks move up and down through reduction gearbox
to realize level adjustment. The device has three feet,
they distribute as regular triangle, one of them is
fixed, and the others can be adjustment. According to
adjusting those two feets height to realize the
balance of the working plane and a water level.

INTRODUCTION

Some precise instruments demand a highaccuracy horizontal plane to place on, such as
theodolite in the construction sites, the radioactivityinstrument in Medical filed, and the standard metal
measuring vessel in quantitative analysis field, which
need to place on a horizontal plan to guarantee the
accurate result.
The adjustment of the horizontal working plane
depends on manual work at the moment. This method
not only has a low efficiency, but also a low accuracy.
Taking verification oil machine for exampleits first
step is horizontal adjustment. According to
incomplete statistics, this work need to be reduplicate
more than a million times only in Jiangsu province,
which could be a heavy burden for those staff
members of the measurement test center. For this
reason, to design a more efficient, more accuracy
device has an urgent demand and a high research
value.
In recent years, numerous researchers have
already done some research on horizontal auto adjust
device in China. An auto level adjustment device
designed by He Rensheng[1] have already made an
efficiency and accuracy work. But the devices
actuator consists of stepper motor and arm brace with
tooth, they are mesh directly and this method lead to
the problem: The working plane cannot support a
heavy equipment because the stepper motor supports
all the gravity of the equipment, and the stepper
motor cannot offer enough torque. Another level
adjustment device base on single chip microcomputer
designed by Hou Jiansheng[2] can support a heavy
equipment, but his mentality of designing comes
from the traditional method. The devices angle
measurement part is simulating the humans eyes. It
978-1-4799-6636-3/14 $31.00 2014 IEEE
DOI 10.1109/ICICTA.2014.21

OVERALL DESIGN
SCHEMES

Figure 1. Overall Structure

III.

CIRCUIT DESIGN

The devices MCU is STM32F03ZET6, the MCU


drive the SCA100T-D01 Angle Sensor and AT24C02
EEPROM by I2C digital interface. SCA100T-D01 is
used to get the angles of different axle directions.
EEPROM is used to store the calibration data. The
MCU access Flash by SPI digital interface, The Flash
is used to download the program. SRAM and LCD
56

connect the MCU by FSMC interface, SRAM is used


to store the runtime data. The circuit has a RS-232
debugging interface, as is shown in figure 2.

Figure 3. Common anode method of Stepper Motor Driver

IV.

PROGRAM DESIGN

According to angle sensor, MCU gets the angle


between working plane and water level, than MCU
set the stepper motors direction and step pluses
numbers to drive the stepper motor until the working
plane is horizontal. The algorithm flowchart as figure
4.

Figure 2. Hardware Circuit

The core of STM32F013ZET6 is ARM Cortex


M3[3], belonging to ARM v7 instruction architecture.
It has greater performance efficiency, allowing more
work to be done without increasing the frequency or
power requirements. The interrupts serve as quickly 6
to 12 system clock cycles. Many instructions,
including multiply, are single cycle. Only support
Thumb2 instruction set which is a new superset of
16-bit
Thumb instructions and 32-bit ARM
instruction, there is not only no need to speed time
switching between the ARM state (32-bit) and the
Thumb state (16-bit), but also greatly increased code
density and reduced memory requirements. And more
importantly, the chip is a lower-cost solution,
reducing 32-bit-based system costs close to those of
legacy 8-bit and 16-bit devices.
The SCA100T Series is a 3D-MEMS-based dual
axis
inclinometer
family
that
provides
instrumentation grade performance for leveling
applications. The measuring axes of the sensing
elements are parallel to the mounting plane and
orthogonal to each other. Low temperature
dependency, high resolution and low noise, together a
with robust sensing element design, make the
SCA100T the ideal choice for leveling instruments.
The VTI inclinometers are insensitive to vibration,
due to their over damped sensing elements, and can
withstand mechanical shocks of up to 20000g.
The stepper motor driver we selected M542, The
device has two ways to connected with MCU, one is
common cathode, another method is common anode.
Because of the device need 5v voltage to drive, but
the MCU only can provide 3.3v voltage, so we choice
the common anode way to connect with MCU, we
should be careful about the pins select of MCU
some pins can not tolerate 5v voltage, if the pins
selected a wrong one, it may be damage the MCU.
The common anode method as is shown in figure 3.

Figure 4. Algorithm Flow Chat

In actual measurement, SCA100T-D01 output


data is not stability enough even it has over damped
sensing elements. In order to get a stable data,
elimination jitter, we design a filter algorithm:
Iterative Damp Filter. The source code as followed.
float cal_DampK(float f){
float f1;
f1 = 2 * f + UPDATERATE;
if(f1)
return (2 * f - UPDATERATE) / f1;
else
return 0.006; }
DampK=cal_DampK(dampvalue)
The algorithm setting an initial damp, if the
SCA100T-D01 output the mutagenicity data,

57

according to calculate, the damp will restrain the data


change. If this is caused by noise, the algorithm will
filter the noise. If the data change is really caused by
the working plane change, according to calculate, the
damp will be very small, it cannot restrain the data
change, the program output the right data. The result
of this filter algorithm is as figure 5.

Figure 6. Rectangle Thread Force Equilibrium Analysis

By using the methods of table lookups, we get the


friction coefficients range, than friction angle:
(3)
As the result of lead screw mathematic model
analysis, the lead screw efficiency =31.3%, screw
threads pitch P=2mm, helix angle =2.8.
If the working plane s weight is 38kg, the
reduction gearbox reduction ratio is 1:5, the angle
between Scissor Jacks arm and horizontal direction
is, the stepper motor have 50% more torque than
actual requirements, we work out the stepper motor
torque is, the function curves as figure 7.

Figure 5. Iterative Damp Filter Result

V.

ACTUATOR DESIGN

The actuator is consisted of Reduction Gearbox,


Scissor Jacks and Stepper Motor. There are three
reasons to select Scissor Jack as actuator, one is
screw thread angle is less than equivalent friction
angle of screw pair[4], so the device has good selflocking and the stepper motor neednt to provide a
large holding torque. The second reason is the Scissor
Jacks construction decomposition of gravity force
to horizontal direction and vertical direction, so the
stepper only need to provide a small torque. Last but
not least, the Scissor Jacks is also a reduction unit
which can enhance the step precision.

Fig
ure 7. The relationship between Stepper Motor torque T and angle
.

A.

Stepper Motor Mathematic


Model Analysis
The Stepper Motor drive the rectangle thread lead
screw through reduction gearbox. Firstly, we study
the forces relationship on the rectangle thread lead
screw. We spread the rectangle lead screw along its
pitch diameter, than we get an inclined plane which
lead angle is[5], as figure 6. When we use a force to
push the block which subject the force along the axis,
if the block move up along the inclined plane
(equivalently prismatic pair move inward along the
axis, the Scissor Jacks rise). For this time, it should
satisfy the force equilibrium conditions.
(1)
In the formulas, is friction coefficient, we use
friction angle instead of and calculate, than we get
the formulas:
(2)

B.

Level Adjustment Algorithm


Design
As figure 9, in space rectangular coordinate
system, the plane ABC initialize position.is water
level. We place SCA100T-D01 angle sensor on
equilateral triangle ABCs middle point of BC edge.
The SCA100T-D01 s X axis must coincide to
triangles edge BC. The length of triangles side is.

Figure 9. Water Level and Working Plane

58

the result is Point B need to fall 38.34cm, point C


need to fall 6.94mm, and to actual stepper motor B
send 11755 step-by-step impulses. Send 1685 stepby-step impulses to stepper motor C. After the
adjustment, the device continue to judge whether the
working plane have reached a water level. If the
working plane is water level, the program stop, if the
working plane is not water level, the program repeat
the steps as above description.
The figure 10 is our first working prototype. In
the test, the device reach a 6 ( 0.1 ) level cost
less than 2 minutes. The other devices cost almost 5
minutes. We saved more than a half time. And the
device can reach a higher accuracy (0.04) with a
no shock situation. Whats more, the device is more
easy to use and service than a hydraulic one. It never
have the oil spilling
p
g pproblem[7].
[ ]

When it is water level, the coordinates of each


point as follows:
A (0, 0, 0)
B ()
C ()
Now, the data collected through SCA100T-D01
angle sensor is along X axis, along Y axis, the
coordinates of each point as follows:
A (0, 0, 0)
B:
C:
So, the adjustment strategy is shown below.
Table 1. Adjustment strategy.

Point B

Point C

Figure 10. Working Prototype

VII.
+

CONCLUSIONS

Compared with the traditional approaches, the


paper come up with a more efficient and more
accuracy scheme to level adjustment. Compared with
hydraulic device, the electric one can be faster and
more accurate. It is also more reliable and easy to fix.
The device can be used in several field, such as
Metering System and any other equipment which
need to working on a water plane. The device can be
improved for its actuator, although it has several
advantages, such as good self-locking, but it also has
the problem, for example, it makes the stepper motor
drive impulse calculate changed from linear to
sinusoidal which is disadvantage to automatic control.

REFERENCES
[1]. Rensheng He, Jiazhen Zhang, Huahu Ying, A New Type of
Level Adjustment [J], Journal of Hunan University, Vol.35,
Issue 11, 2008, pp.32-35(in Chinese)
[2]. Jiansheng Hou. An Automatic Horizontal Adjustment System
Based on MCU [J].Automation & Information Engineering,
Issue 3, 2011, pp.38-40. (in Chinese)
[3]. Joseph Yiu. The Definitive Guide to the ARM Cortex-M3 [M],
Charon Tec Ltd, Newnes, 2007
[4] Yong Yin. Use Frictional Angle to Solve Mechanics Problem
[J]. Physics Teaching, Vol 34, Issue 12, 2012, pp.37-39(in
Chinese)
[5] Yan Piao. The Design and Calculate of Screw Joint [M],
BeiJing: Higher Education Press, 1995(in Chinese)
[6] Yan Chen. The Research of New Type Electric Jack [D] South
China University of Technology, 2003(in Chinese)
[7] Dike Li, Meng Li, Jianbo Meng,Jinjiang Liu, Dawen Wang,
Jiang Liu, The Design of A Radar Automatic Leveling Control
System[J] , Journal of Chongqing University, Vol 27, Issue 6,
2004, pp.93-95in Chinese

If the result is positive, the Scissor Jack will


rising up, if the result is negtive the Scissor Jack will
falling down. If the result is zero the Scissor Jack
will keep still. But in experiment the result is so hard
to keep zero,so we make a range[-0.04~+0.04],if the
result belong to the range, we regard it as zero.
VI.

EXPERIMENTAL RESULT

The first step to use the device is hardware initial,


after that we get the angle through angle senor, the
data is +3 along X axis, +5 along Y axis, the
length of triangles edge is 60cm.
The program calculate the distance need to be
adjust according the algorithm as above description,

59

Das könnte Ihnen auch gefallen