• No results found

CHAPTER 5: OPPORTUNITIES CREATED BY PERVASIVE MICROPROCESSING

5.3 Controller architecture

The control in this thesis is an implementation of an open architecture controller (OAC). It consists of four control programs executed independently on different processing units, namely, the executive program or operating system, the interpolation program or motion controller, the

Figure 48. Software (a) and hardware (b) architecture of the controller

107

servo control program and the PLC. The executive program is a PC-based application in charge of managing the non-real time services of the architecture; the interpolation program is a micro-controller program in charge of the online coordination of the axis, feed rate control, acceleration and deceleration; and the servo control, in turn, executes in a micro-controller and drives each axis independently with a velocity close-loop control. Finally, the emergen cy control corresponds to an interrupt service routine (ISR) that responds to discrete events requiring immediate action such as an overload of the drive unit or hitting a limit switch, and it has higher priority.

5.3.1 Hardware architecture

Figure 48 shows a possible hardware architecture and its implementation to a 3-axis CNC machining center. In this example, each microprocessor is on a separate board and talks to other components in the architecture through a communications network. The executive program connects to the native human machine interface (HMI) application via transition-protocol (TCP) socket for inter-process communications. It also communicates to the PLC and to the Interpolator through the primary communications bus via serial port. The PLC connects to the servo control units via Inter-Integrated Circuit protocol of communication (I2C). This component executes automatic motion routines, and allows users to program their own applications based on logic operations and the I/O signals from the machine peripherals.

Figure 49. Three different variants of the open architecture for control.

Figure adapted from [117]

108

The machine executive transmits the vector of motion commands (with desired machine states) to the interpolator via serial port and the configuration parameters to the servo controllers via I2C.

Position updates from the servo controller and reported to the executive program through these channels, keeping an open flow of machine states. There is a secondary bus of communication transmitting the train of pulses, to drive the position of the axes, from the interpolator to the controls. The communication of the pulses is handled by hardware interrupts in the servo-controllers, triggered by changes in the digital signals coming from the interpolator.

Routing the communications from the machine executive to the servo-controllers through the Interpolator and PLC components, reduces the number of communication peripherals handled by the machine executive with the caveat of slowing the communications in the architecture. Figure 49 shows 3 possible variations of hardware architecture for different Hardware capacity, and their corresponding software structure [117]. The control architecture in figure 48 correspond to variant (b). In variant a), a bus master transmits the vector of motio command to the interpolator and receives the position updates from the servo controllers. This is the lower perfomance electronics configuration and the highest latency one. In variant c), higher performance processors allow the interpolator and the PLC to be combined into a single unit leading to a reduction of the number of processors and a more compact controller. In the example of figure 48, the executive program runs on a PC; the PLC and Interpolatro program are program in an Arduino Mega 2560 board; and the servo controller runs in an Arduino Nano, based on the microprocessor ATmega328.

5.3.2 Software architecture

Figure 48 (a) shows a diagram with the software architectures of the controller to a 3-axis CNC machining center. The control architecture in this paper is a component-based approach aimed to achieve software modularity. This means that, each of the components have unique finite state machine (FSM) model that guarantees the successful execution of tasks in the controller and the proper collaboration with the other the components. In this manner, a new component such as a servo-control could be added as building block for a different CNC application without conflicting with the previous control kernel.

Figure 50 shows a simplified version of the finite state machine models of the interpreter, the interpolator and the servo control unit. Every vector of motion commands arriving from the interpreter in the executive program is put in wait state by the interpolator. The wait state has a

109

first in first out (FIFO) buffer that stores incoming commands. It notifies the executive program whenever a command is executed (form the tail of the buffer) so that a new command can be stored. The vector of motion commands (with the desire state of the machine) is taken from the wait state to the load interpolation state where the values of the velocity registers and targets are initialized according to the desired state of the machine. The interpolation state corresponds to an ISR with either a reference pulse [55] or reference word [56] interpolation algorithm for the generation of digital pulses to drive the axis.

The servo-control FSM model is mainly driven by the execution of three independent interrupts. These include the emergency-control interrupt (highest priority interrupt); the set-point external interrupt, which increments an up-down counter whenever the interpolator requests a pulse; and the servo-control interrupt which calculates the control output to the motor driver based on the instantaneous error count in the servo. The emergency control is in charge of the housekeeping operations and safety checks in the servo such as limit switches, error limits,

Figure 50. A simplified finite state machine (FSM) diagram of the architecture

110

maximum velocities and accelerations. The emergency control responds to these events by taking the program execution to the Emergency Stop (E Stop) state where all the motions are stopped immediately. There is an additional timer interrupt for the communication of servo updates UPDT (positon, velocity, and torque) and loop configuration parameters CFG (loop gains and interrupt frequency).

This software architecture guarantees the successful execution of interpolation and servo control task while allowing an open flow of machine states between the components of the control.

It meets the definition of a component-based approach by offering the possibility of adding micro-processing units and physical axes of motion (up to the maximum number supported by the interpolator) without changing the length of the servo algorithms and, most importantly, their execution time. This is important as the topology of the control can be modified to meet different processes standing for an interchangeable, portable and scalable control. The following section discusses the main programs and algorithms in the control architecture.

Related documents