Key Technology of Embedded System Implementation for ... - CiteSeerX

1 downloads 16672 Views 293KB Size Report
2 School of Mechanical and Automotive Engineering, South China University of ... 3 Department of Computer, Guangdong College of Mechanical and Electrical ...
CHINESE JOURNAL OF MECHANICAL ENGINEERING Vol. 23,aNo. *,a2010

·1·

DOI: 10.3901/CJME.2010.**.***, available online at www.cjmenet.com; www.cjmenet.com.cn

Key Technology of Embedded System Implementation for Software-based CNC System WAN Jiafu1, 3, LI Di 2, *, and ZHANG Ping 1 1 College of Computer Science and Engineering, South China University of Technology, Guangzhou 510006, China 2 School of Mechanical and Automotive Engineering, South China University of Technology, Guangzhou 510640, China 3 Department of Computer, Guangdong College of Mechanical and Electrical Technology, Guangzhou 510515, China Received December 10, 2008; revised February 25, 2010; accepted January 28, 2010; published electronically March 5, 2010

Abstract: The software-based computer numerical control(CNC) system includes three types of tasks, periodic real-time tasks, aperiodic real-time tasks, and non-real-time tasks. The tasks are characterized by concurrency, hybridization, and correlation, which make system implementation difficult. The conventional scheduling algorithm can not meet the demands of system implementation in the software-based CNC system completely. The uncertainty factors when running real-time tasks affect control performance by degrading manufacturing accuracy as a result of system resource and processor use restrictions. To address the technical difficulty of embedded system implementation, a novel fuzzy feedback scheduling algorithm based on output jitter of key real-time tasks for a software-based CNC system is proposed here. Time characteristics, such as sampling jitter, input-output jitter, and non-schedulability are discussed, followed by quantification through simulations of the impact of time characteristics on manufacturing accuracy. On the basis of this research, the scheduler architecture is designed, and then the algorithm table is calculated. When the system resource changes, the key periodic real-time tasks meet their deadlines by means of dynamically adjusting the task period. The simulated results show that the machining precision rises by an order of magnitude for the proposed scheduler in resource-constrained software-based CNC systems. Moreover, unlike conventional feedback scheduling methods, the algorithm in this paper does not rely on the availability of task execution times and is easy to implement while incurring only a small overhead. Key words: software-based CNC system, embedded system implementation, output jitter, fuzzy feedback scheduling, manufacturing accuracy

1

Introduction

Nowadays, embedded computing is playing an increasingly important role in the equipment manufacturing community. An increasing number of real-time applications, such as the software-based computer numerical control(CNC) system, are being built on embedded systems. As a complex hybrid task system, the software-based CNC system includes three types of tasks, periodic real-time tasks, aperiodic real-time tasks, and non-real-time tasks, resulting in a challenge for a designer to carry out embedded system implementation. In this system, where the workload displays large fluctuations due to resource competition, a traditional real-time design, based on worst-case assumptions, may be infeasible. Assuming that all tasks are executed at their maximum rates and according to worst-case execution times(WCETs), the developer may * Corresponding author. E-mail: [email protected] This project is supported by National Natural Science Foundation of China (Grant No. 50875090, Grant No. 50905063), National Hi-tech Research and Development Program of China (863 Program, Grant No. 2009AA4Z111), and China Postdoctoral Science Foundation (Grant No. 20090460769)

be forced to choose a very powerful CPU, which will be under utilized most of the time[1]. On the other hand, basing the design on average-case conditions may result in temporary CPU overloads, which degrade the manufacturing accuracy of the software-based CNC system. In the traditional design method, the WCETs of tasks are assumed. In practice, however, estimating WCETs is difficult. An underestimation or overestimation may lead to CPU overload or resource waste, respectively. There are several other aspects that should also be considered for implementing an embedded system in a software-based CNC system. First, there is a strong trend today to use commercially available information technology and commercial off-the-shelf(COTS) components in real-time control systems[2]. These components have restricted configurability and may not be well suited for a software-based CNC system. Limited resources combined with non-optimized hardware and software-based components will introduce nondeterminism in the real-time system. Second, digital control theory normally assumes equidistant sampling intervals and a negligible or constant control delay from sampling to actuation. However, this can seldom be achieved in practice

·2·

YWAN Jiafu, et al: Key Technology of Embedded System Implementation for Software-based CNC System

in a complicated system that is resource constrained. Timing variations in sampling periods and latencies degrade the control performance and, in extreme cases, may lead to reduced manufacturing accuracy. In addition, the control performance of a software-based CNC system depends on a control algorithm as well as latency and jitter related to the scheduling policy. Unreasonable latency and jitter have a pernicious influence on system stability. Third, in a complicated real-time control system, the tasks of a software-based CNC system are characterized by concurrency, hybridization, and correlation. For task scheduling of this hybrid system, the current main approach is that the scheduling thread of the operating system(OS) manages system tasks and distributes system resources in light of task priorities. However, the existing scheduling policy of the real-time operating system(RTOS) is a general purpose one not aimed at a special system, such as a software-based CNC system, and this may cause dramatic timing uncertainties. On the basis of research on time characteristic impacts on manufacturing accuracy, we follow the newly emerging methodology of feedback scheduling and propose an intelligent approach based on fuzzy logic to address these problems. Our goal is to obtain satisfactory manufacturing accuracy in the presence of CPU resource constraints and workload uncertainty. Here we will focus on a software-based CNC case where hybrid tasks are executed concurrently on the CPU. Considering aperiodic real-time tasks, a fuzzy feedback scheduler based on output jitter is developed to dynamically adjust the periods of key tasks so as to ensure that jitter range approximates to a desired level. Preliminary simulations are conducted to evaluate its performance. The remaining parts of this paper are as follows: Related works associated with our study are described in section 2. Section 3 analyzes the experimental procedure. Time characteristics that we consider in this study are described in section 4. The impact of time characteristics on manufacturing accuracy is presented in section 5. Section 6 describes the scheduling architecture and realizes the algorithm design. The performance of proposed approach is evaluated in section 7, and section 8 concludes this paper.

2

Related Work

In recent years, many studies have been devoted to feedback scheduling. The idea of using feedback in scheduling has, to some extent, been previously used in general purpose operating systems in the form of multilevel feedback queue scheduling. A more control-based approach is taken in Ref. [3] that presents a scheduling algorithm termed feedback control EDF(FC-EDF). CERVIN, et al[4], presented a feedback scheduling mechanism for hybrid controllers where the execution time may change abruptly between different modes. The proposed solution attempts to keep CPU utilization at a high level, avoid overload, and

distribute the computing resources evenly among the tasks. EKER, et al[5], designed an optimal feedback scheduler to distribute computing resources over a set of real-time control loops in order to optimize the total control performance. Its approximation versions are exploited in Ref. [6], where feedback scheduling is performed by simple rescaling of the task periods. XIA, et al[7], presented neural network techniques in feedback scheduling of control tasks and provided an almost optimal solution. Many additional references can be found in Refs. [8–9]. In the emerging field of fuzzy feedback scheduling, available literature is limited. In Ref. [10], a fuzzy feedback scheduler is proposed to improve the performance of iterative optimal control applications. As an anytime algorithm, the execution time of the controller is dynamically adjusted, while the sampling period is assumed to be constant. In this work, not only execution times but also sampling periods of control tasks will be adjusted by the feedback scheduler, whereas the aperiodic tasks are not considered. Similar references to this are provided in Refs. [11–12]. The impact of jitter on stepper motor control is analyzed in Ref. [13]. Jitter will contribute additional torque load to the motor that has the potential to exceed the available torque at high speeds and cause a loss of position steps. The magnitude of the additional torque is determined for several typical stepper motors at moderate to high speeds. For motion control system, FENG [14] used a model based on simulation to quantify the relationship between sampling jitter and controller performance. But the other parameters, such as input-output jitter, are not thoroughly analyzed, and a solution for improving manufacturing accuracy is not mentioned.

3

Experimental Procedure

In order to reduce the effect of uncertainty factors during runtime on manufacturing accuracy in software-based CNC systems, a CNC model based on Matlab/Simulink and the TrueTime toolbox[15] was used. The analytic process is shown in Fig. 1. Implementation Evaluation

Fuzzy Feedback Scheduling Analysis

Existing Scheduling

Time Characteristics

Proposed Scheduling

Embedded Controller

Software-based CNC Model

Output Jitter

Software-based CNC system

Time Parameters

Fig. 1. Analytic process

Due to the influence of the scheduling algorithm, task complexity, and system resources, crucial tasks such as

CHINESE JOURNAL OF MECHANICAL ENGINEERING servo tasks and interpolation tasks may be so uncertain as to result in output jitter. We therefore defined the related parameters, analyzed the time characteristics and the impact of time characteristic on manufacturing accuracy. In this way a method of error analysis was introduced and the best model for implementation was established, based on the TrueTime toolbox. Matlab version 7.0 and TrueTime version 1.5 were used. TrueTime was used to imitate the scheduling kernel of the embedded controller. For verifying the proposed scheduling algorithm, a circle with a radius of 1 000 mm was machined. By comparing the mismachining tolerances, the scheduling algorithms for the software-based CNC systems were assessed.

4

Fig. 2.

·3·

Basic timing parameters of a control task

Normally, it can be assumed that the minimum sampling latency of a task is zero, in which case we have Js = Lsmax. Jitter in the sampling latency will of course also introduce jitter in the sampling interval T. It is obvious that T is only a nominal sampling period. From Fig. 2, it is seen that the actual sampling interval Tk in period k is given by

Tk = T + Lks − Lks −1 ,

(2)

where Tk—Actual sampling interval, Lks —Actual sampling interval Tk in period k. The sampling interval jitter JT is quantified by

Time Characteristics during Embedded System Implementation

J T = T max − T min ,

Timing uncertainties during task executions owing to resource competition lead to input-output jitter, sampling jitter, and even non-schedulability. In this section, the cause of jitter is reviewed by analyzing related parameters.

where JT—Sampling interval jitter, T max —Maximum of sampling interval, T min —Minimum of sampling interval. We can see that the sampling interval jitter is upper bounded by

4.1 Timing parameters Generally, a control task consists of three distinct operations: input data collection, control algorithm computation, and output signal transmission. The timing of the operations is crucial to the performance of the controller. Ideally, the control algorithm should be executed with perfect periodicity, and there should be zero delay between the reading of the inputs and the writing of the outputs. This will not be the case in a real implementation, where the execution and scheduling of tasks introduce latencies. The basic timing parameters of a control task are shown in Fig. 2. It is assumed that the control task is released periodically at times given by rk=kT, where T is the sampling interval of the controller. Due to preemption from other tasks in the system, the actual start of the task may be delayed for some time Ls. This is called the sampling latency of the controller. A dynamic scheduling policy will introduce variations in this interval. The sampling jitter is quantified by the difference between the maximum and minimum sampling latencies in all task instances, J s = Lmax − Lmin s s ,

(1)

where Js—Sampling jitter, —Maximum of sampling latency, Lmax s —Minimum of sampling latency. Lmin s

Lks −1 Lkio−1

Lks

Lkio

Jh ≤ 2Js ,

(3)

(4)

where Jh is the maximum sampling jitter. After some computation time and possibly further preemption from other tasks, the controller will actuate the control signal. The delay from the sampling to the actuation is the input-output latency, denoted Lio. Varying execution times or task scheduling will lead to variations in this interval. The input-output jitter Jio is quantified by min J io = Lmax io − Lio ,

(5)

where Jio—Input-output jitter, —Maximum of input-output latency, Lmax io —Minimum of input-output latency. Lmin io According to the definitions of sampling jitter and input-output jitter, combined with timing parameters of hybrid tasks, sampling jitter and input-output jitter display varieties of nominal sampling period and task executions, respectively. Additionally, in order to review the relation between jitter and control performance, and to describe that jitter variation leads to system performance degradation, the percent of nominal sampling period is used to denote jitter variation, named jitter range. 4.1.1 Sampling jitter To some extent, sampling jitter and task period are extremely interrelated. From the view of real-time scheduling, the sampling period is namely a task period. A short sampling period leads to a probability increase of system resource competition, which results in some jobs that can not be executed in the desired time point. On the other hand, in the control field, the sampling period can

·4·

YWAN Jiafu, et al: Key Technology of Embedded System Implementation for Software-based CNC System

generically be decided by, for example, dynamic characteristics and closed loop performance. An experience theorem for determining sampling period is given by 4≤

Tr ≤ 10, T

(6)

where Tr is the rise time. Obviously, due to Eq. (6), the factor of embedded system implementation is neglected. In order to design a high-performance system, we should further consider non-determinacy of task timing characteristics. As shown in Fig. 3, τs is the latency from the start of sampling execution to the servo control signal output, where the starting point of the signal output is when the corresponding task enters the running state. Objectively speaking, the impact of τs on system performance is non-neglectable; therefore, it is necessary to quantify the relationship between τs and the manufacturing accuracy of a software-based CNC system.

input-output jitter and sampling jitter are introduced if the key real-time task period is selected irrationally and there are no special schedulers for management and control of hybrid tasks. In the extreme case, some jobs cannot be finished before the desired time point, thus degrading system performance. Fig. 5 presents non-schedulable jobs. In Ref. [15], the example of a DC-servo process is used to clarify the impact of non-schedulable jobs on control system performance.

Fig. 4.

Input-output jitter in servo process

Lks

Lks −1

Fig. 3.

Sampling jitter of servo task

4.1.2 Input-output jitter In the software-based CNC system, the servo control task during the very execution period can be divided into three parts, namely: data sampling, servo control algorithm execution, and signal output. In a general way, assuming that scheduling policy is based on priority, threads at a lower priority do not run until all threads with a higher priority have either finished or have been blocked. If one thread is running and a thread of higher priority is unblocked, the lower priority thread is immediately suspended and the higher priority thread is scheduled. Therefore, the servo control task may possibly be interrupted so that latency τc may be caused between sampling start and control signal output. If latency is a variable value, then input-output jitter is introduced. In task implementation, whether this is a system task or an application task, at any time each task exists in one of a small number of states, including ready, running, or blocked. The relationship between state transitions and input-output jitter is shown in Fig. 4. It can be seen that latency τc is the interval of state transitions. 4.2 Non-schedulability In the resource-constrained embedded system, noticeable

Fig. 5.

5

Lkio

Non-schedulable jobs

Impact of Time Characteristic on Manufacturing Accuracy

5.1 Assessment of performance Assuming that the sampling interval of the simulation model is a constant step, the nearby output positions of the control object are A: pi–1(xi–1, yi–1) and B: pi (xi, yi). Because the nearby time interval is small, the movement from A to B is regarded as an approximate straight line, as shown in Fig. 6. Under C at the midpoint of the straight line AB from Fig. 6, we can see that the following error at the C position is the distance from C to E. D is the joint between the extended line of OC and the ideal contour line, and the length of CD approximates that of CE. To simplify the computation, the length of |CD| is regarded as a contour error, and the square of the contour error (|CD|2) is the criterion as performance assessment for a software-based CNC system. Fig. 6 shows that the coordinate of C is given by xi′ =

xi + xi −1 y + yi −1 , yi′ = i . 2 2

(8)

CHINESE JOURNAL OF MECHANICAL ENGINEERING According to Fig. 6, we have 2

2

⎛x +x ⎞ ⎛ y +y ⎞ OC = xi′2 + yi′2 = ⎜ i i −1 ⎟ + ⎜ i i −1 ⎟ . ⎝ 2 ⎠ ⎝ 2 ⎠

(9)

Furthermore, the following expression can be concluded: 2

CD = (r − OC ) 2 .

(10)

y pi ( xi , yi )

yi

B E

yi'

yi −1

scheduling module, and cost function calculation. The transfer function of the DC servo system is given by Eq. (12). The real-time kernel in the scheduling module, based on the true-time toolbox in Matlab, is part and parcel of this model, which is used to simulate hardware platform and real-time tasks[15]. In the kernel all types of tasks, such as interpolation task and position servo task, may be embedded. The output variables of the controller module include interpolation output, position servo output, and arc radius output. Since arc radius outputs connected to the contour error calculation module, the contour error can be obtained according to Eq. (10).

pi' ( xi' , yi' )

D

C

·5·

r A

pi−1 ( xi−1, yi−1 ) Ideal contour line Tracking contour line

O

xi

' i

xi −1

x

Fig. 6.

(a) Coordinates of tool path

x 250 s 2 + 25s

Contour error

Obviously, |CD|2 varies along with t during system implementation. The following input instruction error is one of the most important performance indexes in a servo system. Therefore, considering the effect of jitter and nonschedulability on servo system performance, we mainly evaluate the following error. The cost function of the following error is given by 1 Tt →∞ T t

J = lim



Tt

0

e (t ) 2 d t ,

(11)

where J —Cost function value, Tt —Simulation time, e(t)—Error between the desired position and actual position at time t; e(t) is derived from Eq. (10) once t is determined. 5.2 Analysis model for manufacturing accuracy The DC servo system is described by the transfer function[14] as follows: G( s) =

250 , s 2 + 25s

(12)

Assuming that the parameters of PID controller are kp=8.5, ki=0.38, and kd =0.36, we build a simplified software-based CNC system to quantify the impact of time characteristic on manufacturing accuracy, as shown in Fig. 7. The experiment of a two-axis motion control system is carried out by means of a simulation model, and the model includes several parts, such as control object,

250 s 2 + 25s

(b) Control of coordinates

Fig. 7.

A simplified software-based CNC system

5.3 Simulation and analysis Using a rate monotonic(RM)algorithm, we can get the executions of the servo task and interpolation task. Ideally, the interpolation task and servo task execute periodically at times given by rk=kT, where the constant interval T is 8 and 4 ms, respectively. For interpolation output, the servo system separates interpolation result to command register twice so as to control the axis movement. That is to say, during every interpolation period, the servo control task will be completed twice. Along with the increase in jitter and non-schedulable jobs, contour error varies remarkably. Combined with the variation of sampling period, the cost function values for jitter and non-schedulable jobs are shown in Fig. 8, and the impact of time characteristics on manufacturing accuracy is quantified. This is an important reference for softwarebased CNC system implementation.

6

Fuzzy Feedback Scheduling Algorithm Based on Output Jitter

6.1 Scheduling architecture To address the above problem, this section proposes an

·6·

YWAN Jiafu, et al: Key Technology of Embedded System Implementation for Software-based CNC System

intelligent feedback scheduling scheme based on the fuzzy control technique. A remarkable feature of this scheme is that the output jitter of real-time tasks serves as a feedback variable. Fig. 9 depicts the architecture of the proposed scheme. Aside from the control loops, an outer feedback loop is introduced to implement feedback scheduling. The basic role of the feedback scheduler is to adjust the periods of the control tasks dynamically to achieve a desired level of output jitter. The timing attributes of all non-control tasks cannot be changed by the feedback scheduler.

where U—CPU utilization, ck—Task execution time, Uothers—Total CPU utilization of all non-control tasks.

}

Fig. 9. Two-dimensional fuzzy feedback scheduler architecture

In the system considered here, ck and Uothers are unavailable to the feedback scheduler. The information available to the feedback scheduler includes CPU utilization U and the actual sampling periods Tk. According to the variation of Tk, the output jitter Js can be derived to control the task. The scheduler is designed only when both of the following criteria are met: (1) all control tasks are finished before their deadlines, that is, U≤1, and (2) the output jitter is controlled within a range that meets the given condition:

(a) Relationship between sampling jitter and error

N

150

∑ (J

srk

− J sk ) 2 ≤ J sr 2 ,

(14)

k =1

100

where Jsrk —Factual output jitter of task k, Jsr—Desired output jitter.

50

0 10

6.2 Algorithm design According to Eq. (14), which is combined with the above mentioned simplified example, the following expression can be easily obtained:

80 60

5 0

40

20 0

(b) Relationship between input-output jitter and error

( J sr1 − J s1 ) 2 + ( J sr 2 − J s2 ) 2 = J sf ≤ J sr .

5000 4000

(15)

Assuming that the upper limit of output jitter is no greater than 20% of the servo task period, the desired upper limit of Jsr can be calculated, for example, if the nominal servo period is 2 ms, Jsr is equal to about 0.566 ms. Table 1 shows the relation between Jsf and the nominal task period.

3000 2000 1000 0 10 60 5

Table 1.

40

Relation between Jsf and the servo task period

20 0

Feedback variable

0

(c) Relationship between non-schedulable jobs and error

Fig. 8.

Cost function value of jitter and non-schedulability

Without loss of generality, assume that the CPU utilization is calculated by: ck + U others , k =1 Tk N

U =∑

(13)

Jsf

Nominal servo period t/ms

1.131

0.566

0.283

4

2

1

The key to this algorithm is building the fuzzy scheduling table on which the fuzzy feedback scheduler performance depends heavily. According to fuzzy theory, a two-dimension fuzzy controller is used, with two input variables (e, de) and one output λ. The universes of discourse for e, de and λ are chosen to be [–0.6, –0.4, –0.2,

·7·

CHINESE JOURNAL OF MECHANICAL ENGINEERING 0, 0.2, 0.4, 0.6], [–0.3, –0.2, –0.1, 0, 0.1, 0.2, 0.3] and [0.6, 0.4, 0.2], respectively. In the designing of the fuzzy feedback scheduler, we employ the following settings for inputs and outputs. Both of the sets of linguistic values for linguistic variables e and de are {NB, NM, NS, Z, PS, PM, PB}, and the set of linguistic values for output variable is {PB, PM, PS}, where NB represents negative big; NM represents negative medium; NS represents negative small; Z represents zero; PS represents positive small; PM represents positive medium; and PB represents positive big. The linguistic rules are established on the basis of analysis of system behavior under different situations as well as related control theory and real-time scheduling policy. As shown in Table 2, a total of 17 linguistic rules are built for a software-based CNC system. Table 2. Variable e NB NM NS Z PS PM PB

NB

NM

Linguistic rule NS

Variable Z

de PS

PM

PS PS

PS

PS PS PM

PM

PM PM

PB

PM PM PM

PB

PB PB

PB

Table 3. Variable de –0.3 –0.2 –0.1 0 0.1 0.2 0.3

7

–0.6 0.2 0.2 0.2 0.2 0.2 0.4 0.4

Variable e –0.2 0 0.2 0.2 0.2 0.2 0.2 0.4 0.4 0.4 0.4 0.4 0.4 0.6 0.6 0.6

0.2 0.2 0.4 0.4 0.4 0.6 0.6 0.6

0.4 0.4 0.4 0.4 0.6 0.6 0.6 0.6

0.6 0.4 0.4 0.6 0.6 0.6 0.6 0.6

Performance Evaluation

In this section, the simulation experiments on the software-based CNC system described in section 5 are conducted in order to assess the performance of the fuzzy feedback scheduler designed above. By comparing the presented fuzzy feedback scheduler against the traditional RM algorithm, contour errors in contrast reflect algorithm performance under the same resource circumstances. For the key periodic tasks, simulation parameters are listed in Table 4. The nominal period for each task is 2, 2, and 4 ms, respectively. Additionally, as a hybrid task system, aperiodic tasks in the software-based CNC system also need system resources. Therefore, we assume that CPU utilization U for non-periodic tasks is 0.3.

PB

Table 4.

For the linguistic rule in Table 2, combined with the fuzzy set algorithm, the fuzzy relation R can be determined by (16)

R = R1 U R2 UL U R49 ,

⎧ R1 = D1L × ( PB)U , D1 = ( PB )e × ( PB)ec , ⎪ ⎨ M ⎪ R = D L × ( NB) , D = ( NB ) × ( NB) , 49 49 U e ec ⎩ 49

where

–0.4 0.2 0.2 0.2 0.2 0.4 0.4 0.4

Algorithm table

D1 = ( PB )e × ( PB )ec = ( PB )eL o ( PB ) ec , with

(17)

the

solution ⎛0 ⎜ ⎜0 R = R1 U R2 ULU R49 = ⎜ M ⎜ ⎜1 ⎜ ⎝1

0.5 0.5 M 0.5 0.5

1⎞ ⎟ 1⎟ M ⎟. ⎟ 0⎟ 0 ⎠⎟

For the proposed scheduling algorithm, output U is given by

U = (e × ec ) o R.

(18)

Based on the maximum degree of membership, we calculate the algorithm table for the fuzzy feedback scheduling as shown in Table 3.

Simulation parameters for fuzzy feedback scheduling

Task Servo task 1 Servo task 2 Interpolation task

Nominal period t/ms 2 2 4

Jitter range at time E JE% 18 16 15

Jitter range at time F JF % 80 60 60

According to the simulation parameters in Table 4, using the RM algorithm, the periods of key real-time tasks are the same at time E and time F, so the mismachining tolerance caused by the extreme jitter exceeds the expected value. For the proposed algorithm, the output jitter is controlled within the prescribed scope through adjusting the task periods. In this way, the manufacturing accuracy can be improved for the limited resources of software-based CNC system. At approximately time F, 30 equidistant contour values are selected, as shown in Table 5. By comparing mismachining tolerance under different scheduling algorithms, we can evaluate algorithm performance. The simulated results illustrate that error is up to 11.9% for the traditional RM algorithm and error maximum is 1.04% for the presented scheduler, which proves that the novel scheduling policy for software-based CNC system is efficient. So, it is obvious that the proposed scheduler improves manufacturing accuracy for handling resource constraints in embedded software-based CNC systems.

·8·

YWAN Jiafu, et al: Key Technology of Embedded System Implementation for Software-based CNC System

Table 5.

Comparison table of mismachining tolerance RM algorithm

No.

Error at time F eF/mm

1 2 3 M 23 24 25 M 29 30 Variance

8

93.228 0 81.404 4 65.426 1 M 101.448 2 117.872 1 119.416 2 M 52.080 1 35.213 0 4 834. 7

Period at time F tF/ms 2 2 2 M 2 2 2 M 2 2 0

Proposed algorithm Error at time F eF/mm –5.596 3 –4.725 0 –3.140 1 M –10.417 5 –8.958 0 –7.224 4 M –1.839 2 –3.028 1 7.017 0

Period at time F tF/ms 4 4 4 M 4 4 4 M 4 4 0

Conclusions

(1) According to the analysis of embedded system implementation, the uncertainty factors of hybrid tasks during runtime affect control performance. A simulated mismachining tolerance analysis method is used to quantify the relationship between uncertainties of software-based CNC real-time tasks and manufacturing accuracy. (2) In the software-based CNC system, it is difficult to identify the tasks’ temporal attributes, such as execution time. With some essential information lacking, we designed a novel fuzzy feedback scheduling algorithm for a software-based CNC system considering time characteristics of hybrid tasks from a new viewpoint. For a set of hybrid tasks, the key periodic real-time tasks meet their deadlines by means of dynamically adjusting the task period. (3) By comparing the presented algorithm against the traditional RM algorithm, the simulated results indicate that machining precision rise by an order of magnitude or more, so the availability of fuzzy feedback scheduling is validated. References [1] CERVIN A. Integrated control and real time scheduling[D]. Sweden: Department of Automatic Control, Lund Institute of Technology, 2003. [2] CERVIN A, HENRIKSSON D, LINCOLN, B, et al. How does control timing affect performance[J]. Control Systems Magazine, 2003, 23(6): 17–30. [3] STANKOVIC J A, CHENYANG L U, SON S H, et al. The case for feedback control real-time scheduling[C]//Proceedings of the 11th Euromicro Conference on Real-Time Systems, York, UK, 1999: 11–20. [4] CERVIN A, EKER J. Feedback scheduling of control tasks[C]// Proceedings of the 39th IEEE Conference on Decision and Control,

Sydney, Australia, December, 2000: 4 871–4 876. [5] EKER J, HAGANDER P, ARZEN K E. A feedback scheduler for real-time controller tasks[J]. Control Engineering Practice, 2000, 8(12): 1 369–1 378. [6] CERVIN A, EKER J, BERNHARDSSON B, et al. Feedbackfeedforward scheduling of control tasks[J]. Real-time Systems, 2002, 23(1): 25–53. [7] XIA F, LI S B, SUN Y X. Neural network based feedback scheduler for networked control system with flexible workload[J]. Lecture Notes in Computer Science, 2005, 3 611: 242–251. [8] YUAN P, MOALLEM M, PATEL R V. A feedback scheduling algorithm for real time control systems[C]//Proceedings of 2005 IEEE Conference on Control Applications, Toronto, CA, August, 2005: 873–878. [9] HENRIKSSON D, CERVIN A, AKESSON J. Feedback scheduling of model predictive controllers[C]//Proceedings of 8th IEEE Real-Time and Embedded Technology and Applications Symposium, San Jose, CA, September, 2002: 207–216. [10] XIA F, SHEN X F, LIU L P. Fuzzy logic based feedback scheduler for embedded control systems[J]. Lecture Notes in Computer Science, 2005, 3 645: 453–462. [11] JIN H, WANG H A, TANG X M, et al. Fuzzy scheduling design in computer control[J]. Chinese Journal of Computers, 2006, 29(3): 414–421. (in Chinese) [12] JIN H, WANG H A, FU Y, et al. A fuzzy feedback control real-time scheduling algorithm[J]. Journal of Software-based, 2004, 15(6): 791–798. (in Chinese) [13] PROCTOR F M, SHACKLEFORD W P. Real-time operating system timing jitter and its impact on motor control[C]//Proceedings of SPIE, Boston, USA, 2001: 10–16. [14] FENG S T. Research on motion control system design based component, real-time performance analysis and optimized design method[D]. Guangzhou: South China University of Technology, 2007. (in Chinese) [15] OHLIN M, HENRIKSSON D, CERVIN A. TrueTime 1.5- reference manual[EB/OL]. (2007-01-05) [2008-03-15]. http://www.control.lth. se/truetime/.

Biographical notes WAN Jiafu, born in 1976, is currently a post-doctoral in College of Computer Science and Engineering, South China University of Technology, China. He received his PhD degree from South China University of Technology, China, in 2008. His research interests include embedded system design method and software-based CNC system. Tel: +86-20-61362192; E-mail: [email protected] LI Di, born in 1965, is currently a professor in South China University of Technology, China. She received her PhD degree from South China University of Technology, China, in 1993. Her research interests include numerical control system and embedded software-based. Tel: +86-20-87114637; E-mail: [email protected] ZHANG Ping, born in 1966, is currently a professor in South China University of Technology, China. He received his PhD degree from Tianjin University, China, in 1993. He research interests include man-machine system and intelligent robotics. E-mail: [email protected]

Suggest Documents