Title: Real Time Control via the Internet
1Real Time Control viathe Internet
- Benjamin Yoo
- Vladimeros Vladimerou
2Agenda
- Overview
- Speed Control via Internet
- Experimental Results
- Future Work
3Networked Control Systems
- Control loops closed over a communications
network - Allow sensors and actuators to talk with
controller over common pipeline
Actuator
Sensor
Plant
Controller
Communication Network (Internet)
Actuator
Sensor
Plant
Controller
4Why NCS?
- Decrease cost and complexity
- Distributed processing by individual units
- Easier installation and removal
- Design flexibility
- Examples
- Manufacturing systems
- Vehicles
- Aircraft
- Robotics teleoperation
5Issues in NCS
- Delay during data transmission
- time-varying and unpredictable
- Sampling rates
- Communication protocols
- Ethernet, ControlNet, DeviceNet
- Decreased system performance or instability
6Previous Work
- Current work done in the area
- Nilsson
- Walsh
- Branicky
- Tilbury
- Remote access of Polytechnic Universitys control
engineering lab
7Speed Control of DC motor
- Objective
- regulate speed of DC motor
- Process
- make measurements
- compare measurement to desired value
- calculate and supply appropriate input
- repeat process
8What we eventually want
Plant
INTERNET
- Use Internet Protocol
- Multiple Plants, Actuators
- Timing Coordination of Actuators
Control Unit
9Our implementation
Reference Input
Output (speed read from tachometer)
Motor
Control Unit
tachometer
Delayed feedback
10Our implementation (continued)
Motor
Output feedback
Reference Input
Somewhere in here is our server!
11Controller
- Calculate error using reference and feedback
signals - Determine PI control from error
- P gain to increase response
- I gain to eliminate steady state error
- Send control signal to motor
12Motor Transfer Function
- Determines Output from Input
- Modeled as a first order function
13Experimental Setup
VB
DC Motor
Server
RTI-815 Interface Board
Internet
Client
14Hardware Setup
- Hardware in the Mechatronics Lab
- RTI-815 interface board
- Minertia Series DC motor
- PII-233 MHz computers
- 10 Mbit Ethernet
- Networking Lab
- Grex Cyberspace.org Account
15Internet Overview
Layers
Examples
16Internet Overview (continued)
Rectangle indicates area we should be working on
(TCP or UDP)
/ UDP
/ UDP
17The IP protocol
- Addressing.
- 32-bit (128-bit for IPv6) addresses
- Fragmentation.
- Reassemble transparently or discard
- Packet timeouts.
- TTL (Time To Live)
- Type of Service.
- prioritization, IPv6 to support real-time!
- Options.
- source routing, record route and security
18The IP protocol (continued)
The IP header
Each packet must contain complete addressing
information. Also, IP makes no attempt to
determine if packets reach their destination or
to take corrective action if they do not. Nor
does IP checksum the contents of a packet, only
the IP header.
19The TCP protocol
- Streams
- datagram nature concealed, byte streams
- Reliable delivery
- correct and in order
- Network adaptation
- learns delay, maximizes throughput
- Flow control
- end-to-end congestion control, databuffers
sliding windows
20The TCP protocol (continued)
The TCP header
Round Trip Time (RTT) estimation and Buffering
help control flow.
21The UDP protocol
- Provides IP services as well as
- Port numbers
- supports many connections on one host
- Checksum
- Detects errors, discards erroneous datagrams
- TCP too supports Port numbers of course. TCP
resends bad packets, always in order. UDP does
not use acknowledgements.
UDP header
22UDP implementation
- 1. Perfect Delivery
- 2. Delay ? jitter
- - Trade-off between latency and continuity
- 3. Loss
- - Forward error correction, retransmission or
interpolation - 4. Out-of-order arrivals
- - Assume samples are lost or late
- 5. Duplicate arrivals
- Simply ignore
23Timing
- Time-stamping used for Measuring RTT or one way
delay time - TCP uses ACK numbers and a timer (no time
indicated in header) - Could transmit data time in a packet
- Our scheme only needs a timer to determine RTT
transmit
DATA
time
DATA
time
Application
Compare, Determine delay
timer
timer
Synchronize hosts (RTT/2 (?),Coordinated
Universal Time WWV, GPS)
24Sockets
- Applications interface to lower levels
- Transport layer
- Network layer
- Datalink layer
- Multiplexing
- Connected
- Connectionless
- Data structures, descriptors
- Common types
- Datagram
- Stream
- Raw
- Common commands
- Receive, Send, Connect, Listen
25Software Setup
- Platforms / Kernels
- Solaris
- Windows NT w/ RTX
- Compilers / Interpreters
- Visual Basic
- Java
- C / C
- Protocol
- TCP/IP with artificial random delays
26Communication Scheme
RTX sampler, VB transmits and receives
Server side (simple echo server w/ added delay)
Client side (motor and controls)
delay
Continuous control based on latest
feedback received through network
delay
delay
time
Output to motor
27Software Interfacing
C
Visual Basic
Mecha.dll
RTSS Kernel
28VB Frontend
- Access shared memory with C code through DLL
- Polls Data every 20 ms
- TCP communication handled through Winsock
29VB Server
- Holds incoming data with variable delay
- TCP communication through Winsock
30C Flowchart
Foreground Handle Commands
Background PI Controller
31C Timer Flowchart
3220-40 ms Delay
3320-40 ms Delay
3420-40 ms Delay
3540-80 ms Delay
Kp0.1 Ki0.005
RTX 10 ms VB 20 ms
3640-80 ms Delay
3740-80 ms Delay
3880-120 ms Delay
Kp0.1 Ki0.005
RTX 10 ms VB 20 ms
3980-120 ms Delay
4080-120 ms Delay
41Cyberspace.org Test
42Cyberspace.org Test
43Cyberspace.org Test
44More Observations
- Varying setpoint and finding critical delay
- Set Point of 2V 115 ms delay
- Set Point of 4V 161 ms delay
- Set Point of 6V 155 ms delay
- Friction from motor as explanation of above
results
45Future Work
- TCP is NOT supposed to work.
- Why?
- Use timestamped UDP instead
- Need to reconfigure our ad hoc scheme
- Delay causes
- Exponential network delay growth for TCP
- Kernel issues
- Better Interfaces
- GUI interface
- Collect MATLAB data
- More network stats
46Future Work
- Analysis of delay
- Determine maximum delay before instability
- Develop appropriate controller to handle
time-varying delays - More sophisticated mechanical system
- Pendubot