We have made significant progress toward solving the design problem presented in Section 2.9. Of the four functional requirements R1–R4, we have solved R1 (user input) and R2 (user display) by writing C functions for the keypad and display user interface (UI) devices in 4n,us,rq. Along the way, we have learned a great deal about real-time computing, algorithms, digital communication, and programming in C. Solving the remaining two functional requirements, R3 and R4, will be the focus of the rest of the book:
Target system!design of the!requirements for Target system!design of the!position control
These two requirements involve the speed and position control of the target rotational mechanical system. The target computer must control the mechanical system by doing the following tasks:
Approaches to the first two tasks are presented in this chapter through wait-based timingWait-based timing and open-loop controlOpen-loop controlControl systems!open-loop. The third task requires greater understanding of feedback control and advanced timing, which will be explored in tc,g8,8u,kh.
Wait-based timing is the regulation of timing by waiting some more-or-less fixed duration at specific moments in our program. Open-loop control is the technique of applying an input to a system to achieve some output that is predicted by a system model. The limitations of these real-time computing and control techniques will motivate the techniques of the chapters that follow.
The first two tasks given here, actuating and measuring the motion of the target motor, will be achieved in this chapter. The dynamics of the motor must be modeled if we are to use it to control the motion of the electromechanical subsystem. A linear model is developed in Section 5.1. In 8u,kh, we will make extensive use of this model for feedback control. For now, the model is used only for open-loop control and for understanding the electrical side of the electromechanical subsystem. The electrical system is considered extensively in Section 5.3, where we learn how to drive DC motors, and ours in particular. In Section 5.4, we consider how to measure the position and velocity of the motor shaft with an encoder.
As you may have noticed, the complexity of our system is growing. The target computer is already handling the user interface, and in this chapter, it will control the actuation and measurements associated with the electromechanical subsystem. A useful way to organize all this is with a system model called a "finite-state machine (FSM)"Finite state machines (FSMs), introduced in Section 5.5. An FSM models the behavior of a system as a finite number of states and transitions thereamong. In Lab Exercise 5, we will use an FSM model to implement a basic motor control scheme.
Target system!design of the!position control Target system!design of the!requirements for
The chapter concludes in Section 5.6 with a discussion of the simple real-time computing technique of waiting used in Lab Exercise 5 to govern timing. This will give us an opportunity to better understand how a processor handles task scheduling, and to set up our further consideration thereof in Chapter 6.