Hardware and Software What is Mechatronics?

24 downloads 3541 Views 143KB Size Report
Software: ➢ Multitasking, drivers, servo, motion, communications, diagnostic ... Disadvantages: more expensive ... Specialized form of AC-synchronous motor.
Mechatronics System Components: Hardware and Software David M.Auslander copyright © 1998 – 2002, D.M. Auslander

1

What is Mechatronics?

• • •

And why should I (you) care? Computer control of mechanical systems Software has become the heart of mechanical systems ¾

• •

¾

Interacts directly with the physical world Constrained to respond in a timely way to external events

The problem: complexity The solution: design

copyright  1997-2002 D.M.Auslander

2

Machine Control

• •

Components commonly found in manufacturing machinery Hardware: ¾



Motors, amplifiers, instruments, motion-based events, digital I/O, analog I/O, wiring and grounding, communications, operator interface

Software: ¾

Multitasking, drivers, servo, motion, communications, diagnostic and setup, process control, operator interface, application, exceptions 3

Motors



Major manufacturing machine motor types: ¾ ¾ ¾

• •

¾

DC permanent magnet, brush DC permanent magnet, brushless AC induction Stepping motors

For positioning and some velocity control applications Wide range of capacities

4

DC Brushed Motors • •

Direct descendants of Faraday’s invention (~1830) Basic operating principle (as with all motors): ¾ ¾ ¾ ¾

• •

current, force, magnetic field are all tied together (Faraday) Establish fixed magnetic field - stator Run current through wire in that field to produce force (torque) - rotor Reverse the current at strategic moment to keep torque in same direction (commutation)

Sliding split contact for commutation DC “servo” motors use permanent magnet to establish the fixed field

5

DC Brushless Motors

• • •

Same operating principle Replaces split slip-ring/brush with logic/power electronics Reverse role of rotor, stator ¾ ¾ ¾

• •

Permanent magnet on rotor Switch current on stator coils to commute Requires separate angular position sensor and commutation logic

Advantages: lower maintenance, higher voltages Disadvantages: more expensive

6

AC Induction Motors

• •

Establish rotating field with stator (AC excitation) Induce current in rotor ¾ ¾

• •

¾

Rotor has longitudinal conductors, connected at end No connection to frame required A simple set of slip rings is sometimes used for control

Speed difference between rotating field and rotor produces torque Difficult to control

7

Induction Motor Toque/Speed Induction Motor Torque/Speed Characteristic Torque unstable

stable

Speed 8

AC Motor vs DC Motor

• • • • • •

DC motor produces predictable torque naturally Induction motor operates at predictable speed naturally Induction motor is much cheaper Control of Induction motors to make torque predictable is possible but complicated Currently in use for large motors Likely to propagate down to smaller motors also!

9

Stepping Motor

• • •

Specialized form of AC-synchronous motor Rotor lines up with applied field Excited by set of logic signals ¾



¾

Each combination determines new position Often excited by pair

Gives position control without any feedback

copyright  1997-2002 D.M.Auslander

10

Pro/Con of Stepper Motors

• • • • • • •

Save on cost of position instrument Simple to use (no parameter tuning as for servo motor) But … Not as good performance as similar sized servo Vibration Heat (current is always on) No true velocity control

copyright  1997-2002 D.M.Auslander

11

Amplifiers (Drives)

• • •

Modulate (control) power to motors Command is desired current (torque) Pulse-width modulation (PWM) essential for all but very small motors ¾



¾

PWM uses a fixed frequency ON/OFF signal with variable duty cycle Duty cycle = (On Time) / Period

Power amplifiers very difficult to design

12

Digital/Analog



Analog: ¾



¾

Resolving power (precision) depends on instrument granularity and noise in signal Information content per wire is high

Digital ¾ ¾ ¾ ¾

Fixed precision - normally one bit per wire Large error bound Perfection is possible (as an engineering approximation, anyway!) A crazy concept (for the 1930s) that has paid off wildly! 13

Digital Buffer Zone

• • •

Noise rejection depends on definition of buffer zone Signals inside buffer zone are undefined ¾

Example (TTL): ¾



Hardware can treat value as 0 or 1

¾

Output: V < 0.4v => 0; V > 2.4v => 1 Input: V < 0.8v => 0; V > 2v => 1

Simple buffer zone won’t work - noise can push a signal near the boundary over it!

14

Signal Modulation

• • •

“Raw” signals are instantaneous values of one of the signal variables (voltage/current for electrical) Modulated signals use a carrier; example: sine wave Carrier is “modulated” to encode the desired information

15

Modulation Uses • •

Examples: amplitude modulation (AM), frequency modulation (FM) Modulation is used to: ¾ ¾ ¾

Match signal to medium Reject noise Match device characteristics (e.g., PWM for amplifiers)

50% Duty Cycle

75% Duty Cycle

16

Instruments

• • • • •

Standard analog and digital instruments used all over machine -- interface described later Focus now on incremental encoder, rotary or linear Produces a two-channel, digital signal Used to indicate an “increment” of motion in either direction Counting done ultimately in software

17

Encoder Quadrature Quad A

Quad B

Position

• • •

Count on every transition (four counts per cycle) Count rate per channel up to several MHz Requires specialized interface to cope with high data rate

18

Motion-Based Events

• • •

Travel limits Position capture (based on external event) Internal events based on axis position

19

Digital I/O

• •

Instruments and actuators that generate/use digital (on/off) signals Interface: ¾

• • •

¾

Makes input signal values available to software Converts software values into electrical signals

Electrical isolation often required for safety, noise rejection Modest speed (compared to quadrature) Can be many of these (up to several hundred on a machine) 20

Analog I/O

• • • • •

Interface for instruments/actuators based on analog signals Conversion is to/from a set of digital values (i.e., a “word”) Analog: voltage in the physical world Digital: a number in software (finite precision) Conversion precision a key factor ¾

Common range: 8 to 20 bits (1:250 to 1:1,000,000)

21

Wiring and grounding



Considerations: ¾ ¾

• •

¾

Signal integrity System reliability (wire flexing, etc.) Manufacturing cost

Grounding - incorrect grounding can lead to serious signal degradation Isolation ¾ ¾ ¾

Safety Establish independent grounding zones Separate analog and digital domains 22

Communications

• • • • • •

Point-to-point (usually serial, RS232 or RS422) No established protocols above the character layer Physical layer only partially specified Networks - well developed and specified protocols Control-critical networks: high reliability, private Other networks (including Internet) for operational information, status, remote monitoring, etc.

23

Network Options

• • • • • • •

Multi-drop serial (RS485 and related protocols) CAN-Bus and derivatives (DeviceNet, Profibus) Used as instrument buses in high speed (machine) systems OK for distributed control in lower speed systems (e.g., HVAC) TCP/IP (Internet) - most widely used Many physical forms (twisted pair, coax, fiber) Token ring - less common but more predictable performance than TCP/IP

24

Operator interface

• • • • • • •

Traditional operator interface (buttons, switches, meters) disappearing in favor of computer displays Computer displays give context-based op. interface Cheaper than traditional Must be hardened for factory usage, CRT, LCD Long distances, electrical noise cause troubles Mouse, trackball, keyboard not always suitable Touch screen best solution so far

25

Software

• • • • •

Often the most critical machine component That is, more machine improvement can be realized by working on software than any other single area Real time constraints govern all aspects of operation Safety critical Structure is hierarchical

26

Software Problems

• • • •

Very often under-designed and under-documented Maintenance can dominate lifetime cost Complexity well beyond human holistic grasp Asynchronous operation - leads to bugs that are probabilistic ¾



¾

Next to impossible to find in lab Nearly certain to appear at customer site

Modular design is essential

27

Multitasking

• • • •

Machine components operate in parallel (simultaneously) Software must reflect this structure Computers are inherently sequential devices, however Internal software design must allow for pseudosimultaneous operation of software modules

28

Multitasking Basics

• •

Computer’s attention (“context”) is switched from one activity to another fast enough to appear simultaneous to the machine being controlled Activities have different requirements for: ¾ ¾



¾

Importance (priority) Latency (time between occurrence of an event and execution of the associated software) Computing resource

Multitasking must manage a wide range of time scales

29

Drivers

• • • •

Every device connected to the computer has special interface needs Driver modules isolate the application programs from the details of the device interface Devices can be computer peripherals or control system components Driver software often has stringent real time constraints

30

Servo

• • • •

At every moment each motor (“axis”) has a desired velocity and position (setpoints) Servo software uses measured position and velocity information to determine what actuation (current) to apply to the motor to realize the desired position and velocity Runs frequently - a fraction of a millisec to several milliseconds, depending on size of motor/load Monitor for position, velocity, torque errors

31

Feedback Control Performance

• • • •

Feedback (servo) control has parameters (“gains”) that must be adjusted (“tuned”) for satisfactory performance Improper application of feedback control can cause instability In some cases gains must be changed as circumstances change ¾

Example: winding material onto a roll

Servo control works best with low mechanical compliance

32

Motion

• • • •

Figures out what setpoints should be sent to the servo modules Allows for a variety of modes of motions Move axes independently or coordinate several axes Examples: ¾ ¾ ¾ ¾

Point-to-point profile Velocity Master-slave Cam 33

Communications (App Layer)

• • • • • •

Network protocols are layered for maximum portability and predictability Top layer is application Examples, standard Internet applications: FTP (file transfer), HTTP (web), SMTP (mail) Public and private protocols needed Private for communication among control system components Public for communication with the outside world 34

Communication Protocols

• •

Custom protocols for communication in distributed control ¾

Standard external protocols ¾



Must be fast and designed for controller needs

¾

Secs-II, GEM, TCP/IP Proprietary (or semi) such as Devicenet

Point-to-point (serial) protocols often very weak

35

Diagnostic and setup

• • • • •

Symbolic references for I/O devices and drivers Insulates application software from low-level physical changes Testing and maintenance require easy access to devices Setup to establish device names, scales, alarm conditions, axis parameters, etc. On line diagnostics to give early trouble indicators

36

Process control



Feedback loops (other than servo) ¾ ¾

• •

¾

Temperature Flow Tension, …

Generally slower than servo Usually use standard control algorithms (PID)

37

Operator interface

• • • •

Timely update of screen information Response to operator commands High-level construction of interface components Connection of operator interface components to control program modules

38

Application Software

• • • • • •

Machine-specific software Only a modest fraction of total software Medium speed, priority (compared to servo, drivers, etc.) Heavily multitasking State oriented Leverages parallelism in machine to improve productivity

39

Control and State

• • •

State information: sufficient information to predict future system behavior if combined with future actuation information If full state information were known a strategy could be determined to meet any physically realizable performance objective State information in a machine: positions and velocities of all axes, temperatures, program status information, etc.

40

How Much State Information?

• • • •

You can never have too much information! But … processing power is finite Careful design must consider which state information is most valuable Compromising on important state information can lead to substantial loss of performance and/or reliability

41

Exceptions



What to do when something unanticipated happens ¾ ¾ ¾



Computational error such as divide by zero Physical error such as travel limit violation Violation of internal rule base (motor over-torque, following error, variable out-of-limits)

“Anticipated error” is an oxymoron! ¾

If it is anticipated, it should be included in main application code

42

Dealing with Errors

• • •

Safety first consideration Protection of machine second Preservation of product next

copyright  1997-2002 D.M.Auslander

43