EMF T V `
1.4.4 Function Block Design
VAR_OUTPUT
EMT: FLOAT;
MT: FLOAT;
FB_EXE: VECTOR;
END_VAR ALGORITHM
ALG_INI;
ALG_RUN;
ALG_UPDATE;
ALG_MON;
END_ALGORITHM END_FUNCTION_BLOCK
where, EMT is the estimated machining time based on the suggested machining data, which is accumulated and relayed along an MF-FB chain; MT is used to store the actual machining time accumulated during function block execution; MAC_ID passes the selected machine ID to the MF-FB for machine-specific local optimisation; OPER tells the MF-FB the type of machining operation such as roughing, semi-finishing or finishing; FB_EXE is a vector storing the execution status and cutting parameters of the function block for monitoring; and CC_UPD is another vector that can be used by an operator to override the auto-generated cutting parameters. Based on the external variables and embedded internal variables (not shown in Figure 1.10(a), such as machining feature ID, workpiece material), the four defined algorithms can provide the needed functions upon request.
In Figure 1.10(b), the START state is an initial idle state ready for receiving event inputs. EI_INI triggers the state transition from START to INI, and when state INI is active, algorithm ALG_INI is being executed for initialisation. Upon its completion, ALG_INI will fire an event EO_INI indicating the success of the initialisation. Similarly, for other state transitions to RUN, UPDATE and MON, different embedded algorithms ALG_RUN (MF-FB execution), ALG_UPDATE (cutting-parameter update), and ALG_MON (MF-FB monitoring) are triggered, correspondingly. An event “1” means a state transition is always true. That is to say, the state will transit back to the START state and be ready for receiving the next event input. If a START state is not ready, any arrival events will be ignored.
Table 1.2 lists the required machining information embedded in an MF-FB.
Table 1.2. MF-FB embedded machining information
Feature type Operation Cutter type
f: Feed per tooth n: Flute number L: Tool-path length
Roughing Finishing
Square end mill Square end mill (Diameter smaller than twice the corner radius) Suggested tool-path patterns
(1) (2)
Machining time estimation: T = L / ( fnrpm)
With the required machining data and the embedded algorithms, an MF-FB like this is empowered to make adaptive decisions at runtime with respect to the assigned resources (e.g. machine and cutters). For an MF-FB, the initialisation algorithm ALG_INI can fulfil the following tasks before actual fabrication:
• calculating optimal cutting conditions,G
• generating tool path according to suggested tool-path patterns, andG
• estimating or accumulating machining time.G 1.4.4.2 Event Switch Function Block
As mentioned in Section 1.3.4.2, while basic MF-FBs can define the functional relationships between events, data and algorithms for individual machining features fabrication, their combination can form a composite function block representing a setup. A composite function block may consist of several basic and/or composite function blocks with partially sequenced connections via events and data. The event flow among MF-FBs also determines their machining sequence. Figure 1.11 shows a composite function block, where the event flow (or sequence) among three MF-FBs is facilitated at runtime by an event switch function block (ES-FB).
Feature 1
Feature 2
Feature 4
Feature 5 ES-FB
342
Feature 3
Figure 1.11. An ES-FB in a composite function block
For example, if a machining sequence of “342” is given to the three machining features (Features 2–4), the ES-FB will fire events accordingly to appropriate MF- FBs for feature fabrications in the order of 342. It thus adds flexibility for the composite function block to dynamically adjust the machining sequence of non- critical machining features. Figure 1.12 gives the graphical definition of the ES-FB, where ROUTE is the only data input to the function block. It is used as a reserved port for controller-level operation planning to do the local optimisation of machining sequence. Once the final sequence becomes explicit for those parallel features, a string of integer numbers indicating the sequence is applied to the port. The function of event switching is realised by an internal algorithm ALG_SWITCH, which parses the input data string and triggers one execution event at a time until the entire string is exhausted. An acceptable string must (1) only consist of non-repetitive numbers, e.g. “342”, and (2) represent all parallel features needed for switching.
EO_INI EO_P1
EI_P EI_INI
Event Switch FB
Internal Algorithm ALG_INI ALG_SWITCH
EO_Pn
……
ROUTE
EO_DONE EO_P2
Figure 1.12. Event switch function block
Denoting an acceptable string as Str for an event-switch state machine M yields
^ ` °¿
°¾
½
°¯
°®
d e
tr I I I
DONE x START I
x M
S ,
, ,
G* (1.13)
where, START and DONE are the initial and final states; I is the set of both event input Ie and data input Id.
i pd x x x x
I 1, 2,, ,, , xi
xiI,idp (1.14)where I is a set of positive integers; p is the number of all parallel features; and
j
i x
x z when iz j
i,j 1,2,3,,p. As we are only interested in data inputs when forming an acceptable string for an ES-FB, Equation (1.13) can be rewritten as
^
x I START x DONE`
M
Str d G* , (1.15)
1.4.4.3 Service Interface Function Block
In addition to MF-FBs and ES-FB, a service interface function block (SI-FB) is designed to facilitate the execution control of MF-FBs in DPP. It also enables machining-process monitoring during function block execution. As mentioned earlier, all MF-FBs are grouped in setups before being dispatched to appropriate machines. Each setup is a composite function block. An SI-FB is plugged to each composite function block with the following assigned duties: (1) to collect the runtime execution status of an MF-FB including its ID, cutting parameters, and job- completion rate; (2) to collect machining status (cutting force, cutting heat, and vibration, etc.) if made available; and (3) to report any unexpected situations to the execution control module of DPP, e.g. security alarms and tool breakage, etc.
Similar to other function block types, an SI-FB is designed (as illustrated in Figure 1.13) with five embedded algorithms for requesting and reporting execution status (ES), machining status (MS), and unexpected situation (US) from MF-FBs and to the Execution Control module (see Figure 1.2), respectively. In order to monitor the machining process during execution, an SI-FB can be connected to a composite function block as shown in Figure 1.14. At each request of the Execution Control module, the SI-FB will pass the request (EI_ESR, execution status request) to the composite function block, which will then return an array of FB_EXE
containing runtime execution status back to the SI-FB and finally to the Execution Control module. The SI-FB is of vital importance for machining-process monitoring and dynamic rescheduling in case of machine failure.
EO_ESR EO_ESS EI_MSR
EI_ESS EI_ESR
Service Interface FB
FB_EXE
Internal Algorithm ALG_ES_REQ ALG_ES_SEND ALG_MS_REQ ALG_MS_SEND ALG_US_SEND
EO_MSS
US MS US
EI_MSS
MS
FB_EXE EO_MSR
EI_USS EO_USS
Figure 1.13. Service interface function block
FB_EXE
EI_ESR
MT EMT EI_INI
EI_UPD EI_RUN
EO_INI EO_RUNRDY
EO_ESS
FB_EXE EMT
MT
Step MF-FB
F25
EO_INI EO_P1 EI_P EI_INI
ES-FB
ROUTE EO_DONE
EO_P2
Chamfer MF-FB
F23
Sunk Hole MF-FB
F26 EI_ESR
MAC_ID OPER CC_UPD ROUTE
F24
EO_ESS EI_MSR
EI_ESS SI-FB
FB_EXE ALG_ES_REQ
ALG_ES_SEND ALG_MS_REQ ALG_MS_SEND ALG_US_SEND
EO_MSS
US MS US
EI_MSS
MS
FB_EXE EO_MSR
EI_USS EO_USS
Execution Control Machining Selection
FB Dispatching Process Monitoring
Figure 1.14. An SI-FB linking to a composite function block for process monitoring