International Conference on Control, Automation and Systems 2008 Oct. 14-17, 2008 in COEX, Seoul, Korea
An Injecting Method of Physical Damping to Haptic Interfaces Based on FPGA Beibei Han1 and Jee-Hwan Ryu2 1
School of Mechanical Engineering, Korea University of Technology and Education , Cheonan , Korea (Tel : +82-10-8332-0825 ; E-mail:
[email protected]) 2 School of Mechanical Engineering, Korea University of Technology and Education , Cheonan, Korea (Tel : +82-41-560-1250 ; E-mail:
[email protected] )
Abstract: In this paper, an injecting method of physical damping to haptic interfaces is proposed. For injecting adjustable physical damping, time-domain passivity controller is implemented in hardware level with FPGA. Noise free velocity signal can be estimated with T-method. Instead of force command from the virtual environment, directly measured current signal with Hall sensor is used for calculating more accurate energy flow. The entire time-domain passivity control scheme is implemented with several different control routines inside FPGA, and through this hardware implementation, noisy behavior of the conventional software based time-domain passivity controller can be significantly removed. Keywords: Physical damping, damping injection, Passivity Observer (PO), Passivity Controller (PC), FPGA, haptic interfaces, T-method velocity estimation.
1. INTRODUCTION It has been a critical issue how to increase stability range of haptic interfaces. A haptic interface is a closed loop sampled-data system that consists of human operator, haptic device, and virtual environment. The existence of sampling and latency phenomena in the system can induce energy generation and ultimately lead to unstable behavior if the energy can not be dissipated. The sustained or growing oscillations induced by unstable behavior can damage hardware, distort the perception of the virtual environment, or even worse, inflict physical harm to the operator. Lots of researches have been done to increase the stability range of haptic interface. Colgate and his colleagues [1] proposed virtual coupling idea between a virtual environment and a haptic device to guarantee system stability. Adams and Hannaford [2] generalized and extended the concept of a virtual coupling network. They derived optimal virtual coupling parameters using a dynamic model of a haptic device. One of the interesting theories was passivity for guaranteeing the system stability without knowing the dynamic model information of the system. Passivity theory states that a system is passive if the energy flowing in always exceeds the energy flowing out of the system. Colgate [3] applied passivity criteria to the analysis of stability in rendering virtual walls and founded that physical dissipation is essential for achieving stability and that the maximum achievable stiffness is proportional to the force update rate [4]. Anderson and Spong [5] used passivity to analyze teleoperation systems with time delay and similarly Niemeyer and Slotine [6] applied passivity analysis and wave variables to achieve teleoperation stability. Recently, Hannaford and Ryu [7] proposed a time domain passivity based approach which composed of Passivity Observer (PO) and Passivity Controller (PC) to stabilize the haptic system. They designed a PO to monitor the system passivity state by integrating the
978-89-93215-01-4-98560/08/$15 ⓒICROS
produced energy in time domain and used a PC to dissipate the amount of generated energy. The PO/PC approach was realized on real-time software environment to inject variable virtual damping. This approach has been getting many attentions due to its simple and relatively non-conservative algorithm. However, most of the passivity based approach include the time-domain passivity approach has limitation on the virtual damping. Many researchers claimed that physical damping is essential to increase the stability range [4]. Colgate and Brown [4] developed fluid-filled viscous damper which significantly increased the dynamic range of impedance by attaching it to motor shaft. Mehling and Colgate [8] developed passive electrical damping which was implemented by an electrical circuit and the damping parameter can be dynamically changed. Recently, an active electrical damping method was presented by Weir and Colgate [9]. They added physical damping to a haptic display through the use of analog electronics in the motor amplifier. In this research, we implemented time-domain passivity controller based on FPGA for solving several issues on software based damping injection. By taking the advantage of the FPGA technology, such as high sampling frequency, true parallel execution and hardware based low-level control; we could estimate noise free velocity signal during low velocity range without increasing the encoder resolution, while in conventional computer-based implementation the noisy behavior in low velocity was a main reason of the ineffective behavior of the PO/PC. Instead of using force command to the motor driver, we used directly measured current from Hall-current sensor for calculating energy flow, which make the energy calculation more accurate. Finally, we could implement the PO/PC through FPGA and increase the stability range without adding any system mechanical complexity.
1835
[13].
2. REVIEW OF THE TIME DOMAIN PASSIVITY APPROACH
computer
In this section, the time-domain passivity control approach is reviewed. The sign conversation for all forces and velocities is defined so that their product is positive if power enters the system. The following is a widely known definition of passivity. Definition: A one-port network with initial energy storage E (0) is passive if and only if
∫
t
f (τ )v(τ )dτ + E (0) ≥ 0, ∀t ≥ 0
xh
v1
Series PC
v2
+ Human Operator
fh −
α
Haptic Device
f1
f pc + +
Virtual Environment
f2
Fig. 1 Conventional PO/PC for One-port network
(1)
0
Where f is force, v is velocity. Equation (1) states that the energy supplied to a passive network must be greater than negative E (0) for all time [10], [11]. In haptic interfaces, the force and velocity can be measured as discrete values by the computer and (1) can be calculated in real time by appropriate software. This software is very simple in principle because at each time step, (1) can be evaluated with few mathematical operations. The conjugate variables that define power flowing in such a system are discrete-time values, and the analysis is confined to systems having a sampling rate substantially faster than the dynamics of the system. We assumed that there is no change in force and velocity during one sample time. Thus, we can easily “instrument” one or more blocks in the system with the following “Passivity Observer” (PO) to check the passivity:
3. NOISY BEHAVIOR OF THE SOFTWARE BASED PO/PC Even though the PO/PC has been successfully applied to many different haptic interfaces, one of the problems was the noisy behavior during low velocity contact. Fig. 2 shows the noisy behavior of the PC [16]. PHANToM was used to make a contact with a virtual environment (K=1000 N/m) at Position > 0 by applying software implemented PO/PC in [13].
n
E obsv (n) = ΔT ∑ f (k )v(k )
(2)
k =0
where ΔT is the sampling period. If E obsv (n) ≥ 0 for every n, this means the system dissipates energy. If there is an instance that Eobsv (n) < 0 , this means the system generates energy and the amount of generated energy is − E obsv (n) . Consider a one-port system which may be active. Depending on operating conditions and the specifics of the one-port element’s dynamics, the PO may or may not be negative at a particular time. However, if it is negative at anytime, we know that the one-port may then be contributing to instability. Moreover, since we know the exact amount of the generated energy, we can design a time-varying damping element to dissipate only the required amount of energy. We call this element a “Passivity Controller” (PC). The PC takes the form of a dissipative element in a series or parallel configuration depending on the input causality [7]. Fig. 1 shows the series configuration of the PC for a one-port network system. α is an adjustable damping elements at the port which was realized inside computer by some real-time software. Recently, Ryu and etc. proposed more accurate PO in [12] which remove the constant-velocity assumption during one sample time. They also proposed a modified PO/PC scheme that use reference energy behavior to make PC work smooth without sudden impulsive force
Fig. 2 Contact response with the software implemented PO/PC [13] for the high stiffness VE (k = 1000 N/m). PC was noisy during the period of low velocity. Where, the virtual environment consists of a first order, penalty based spring model executed at 1000Hz with
1836
4. HARDWARE IMPLEMENTATION OF THE TIME-DOMAIN PASSIVITY CONTROLLER BASED ON FPGA
Haptic device
Motor driver with FPGA for the PO/PC
50 25 0 -25 -50 0
2.5
5
7.5
10
12.5
(a)
15 time (s)
100
velocity (RPM)
To solve the limitation of the software based implementation of the PO/PC, the PO/PC is implemented in hardware level with Field Programmable Gate Array (FPGA). FPGA provides lots of advantages, such as the reliability of dedicated hardware circuitry, true parallel execution, and fast closed loop control performance. The control system based on FPGA can operate at a speed that is many orders of magnitude faster than other microprocessor based control systems; multiple operations can be performed in parallel and simultaneously at high rates in real time. As shown in Fig. 3, FPGA can be embedded into the motor drivers of a haptic device and communicate with the host computer where virtual environment is rendered.
counts the number of pulses Pn from the encoder during a fixed sampling period Ts and calculates velocity by finite difference derivative. Following equation (3) shows the formulation of M-method [17]: 2πPn v= (3) PTs where P denotes the encoder pulse number per rotation, measurement time is equal to the sampling period Ts , and v stands for the estimated angular velocity. The velocity resolution of M-method is: 2π Qv = (4) PTs As shown in (4), the velocity resolution of M-method is poor as the velocity become lower and as the sampling period become smaller. However a haptic interface needs both a small enough sampling period and accurate velocity estimation for high performance force feedback. Fig. 4 shows the results of the velocity estimation with M-method at 1 msec [Fig. 4(a)] and 0.1 msec [Fig. 4(b)] sampling period. Experiments were conducted with a DC motor equipped with a magnetic encoder which produces 1024 pulses per revolution. As the sampling period is decreased, the minimum velocity resolution is dramatically increased from 14.65 RPM to 146.5 RPM.
velocity (RPM)
impedance causality. The contact seems stable [Fig.2(a)] on the Position response, but the PC input was chattering [Fig.2(d)] and the PO value kept falling down to more negative value [Fig.2(c)] during the period of low velocity [Fig.2(b)]. Physically, the operator feels unwanted small and continuous vibration. Even though there has been an effort to solve the noise problem by setting force threshold and resetting the PO value [15], it was a tuning method of heuristic control parameters depending on specific system. In [16], we found there were two main reasons of noisy behavior of the PO/PC (sudden sign change of the velocity and zero values of the velocity), and proposed a method to remove this noisy behavior. However, there was still some limitation since the method was anyhow software based damping injecting method.
Host computer Virtual environment
0 -100 -200 -300 0
2.5
5
7.5
(b)
10
12.5
15 time (s)
FPGA
Fig. 4 Results of velocity estimation with M-method at 1msec (a) and 0.1msec (b) Fig. 3 FPGA is embedded into the motor driver of a haptic device 4.1 Noise free velocity estimation One of the solutions to solve the noise problem of PO/PC is to obtain noise free low velocity signal. In this subsection we discuss the velocity measurement methods along with comparing their performance over sampling frequency. Finally, T-method velocity estimation was chosen to remove noisy behavior. The most widely used method to estimate velocity is M-method which is also called fixed-time method. It
Another commonly used velocity estimation method is T-method which also called fixed position method. It estimates the velocity by measuring the elapsed time between successive pulse edges in a fixed position interval. It is calculated by the following formulation [17]: 2π (5) v= ms PTs Where, ms is the number of sampling periods during two pulses, Ts is the sampling period, and ms Ts denotes the interval time. This method can improve the velocity resolution especially during low velocity. One possible problem of this method is that the
1837
pulse interval would be immeasurable if it is smaller than the sampling period ( Ts ). However by implementing this method with fast sampling device such as FPGA, the velocity range can be extended. We implemented the T-method velocity estimation scheme through FPGA, and the main focus was to remove the velocity noise and get smooth velocity signal without increasing the encoder resolution. The same DC motor and encoder were used as previous. Fig. 5 shows the M-method (a) and T-method (b) velocity estimation results at 1 kHz. The estimated result of Tmethod at low velocity is much smoother which is essential for removing the noisy behavior of the PO/PC.
velocity (RPM)
50 25 0
-50 0
2.5
5
7.5
10
12.5
(a)
15 time (s)
where im is the measured current, Kt is the torque constant, T is the sampling time. 4. PO with one step prediction to prevent the energy fall down below zero: W (k ) = PO(k ) + K t im (k )v2 (k ) * T if W (k ) < 0 if W (k ) ≥ 0
6. Fpc = α (k )v(k )
40
velocity (RPM)
3. PO(k ) = PO(k − 1) + K t im (k )v2 (k ) * T
⎧ − W (k ) ⎪ 5. α (k ) = ⎨ v 2 (k )T ⎪⎩0
-25
60
With the T-method velocity estimation and direct current measurement, the PO/PC algorithm for one port network with impedance causality is implemented through FPGA. Fig. 6 shows the hardware implementation diagram, where α is a dissipative element in serial configuration. Following is the PO/PC algorithm: 1. v1(k) = v2(k) is the input velocity to the VE 2. f 2 (k ) is the output force from the VE.
7. K t iref (k ) = f 2 (k ) + Fpc
20
where iref is the current command.
0 -20 -40 -60 0
2.5
5
7.5
10
(b)
12.5
15 time (s)
Fig. 5 Results of velocity estimation with M-method (a) and T-method (b) at 1 kHz 4.2 Current control Instead of using force command to the motor driver, we have used measured current value for calculating the more accurate value of the PO (2). The current was directly measured through a Hall-current sensor which is mounted in-between motor driver and DC motor. The current acquisition and control are realized in parallel loop inside FPGA with additional motor driver and sensor interface circuitry. The FPGA-based close loop current controller consists of three parallel loops for acquisition, PD control, and PWM generation. The PD loop is synchronized with the acquisition loop and the PD controller sets the PWM duty cycle to regulate the motor torque. Detailed information was shown in Fig. 7. 4.3 Modified PO/PC algorithm for FPGA implementation
Fig. 6 Hardware implementation of the PO/PC for a one-port haptic interface
Notice that instead of using force, calculated from virtual environment, measured current was used for energy calculation. For the hardware implementation of the PO/PC, there are three different routines with different loop rates are implemented as shown in Fig. 7.
Fig. 7 Three routines with different execution rates z
The haptic environment rendering routine. It is executed on the Personal Computer (P.C.) processor with an update rate of 1 kHz. z Current control routine. The current controller is synchronized with acquisition and PWM generation. The update rate of this routine can be set by the controller designer. In our case, the value was set as 200 kHz. z PO/PC calculation and velocity estimation routine. The PO and PC values update only when encoder pulse happen while the conventional software based PO/PC was updated at every sampling time. One advantage of the FPGA-based application is that multiple operations can be performed simultaneously and in parallel at very high rates. The different loops do not need to share hardware resources with other tasks
1838
and can be precisely timed.
position (m)
5. EXPERIMENTAL RESULTS
0.1 0.05 0 -0.05 -0.1 -0.15 -0.2 -0.25
velocity (RPM)
method, the noisy behavior during the low velocity contact was dramatically reduced as shown in Fig. 11. Stable contact is achieved within several bounces and operator felt smooth interaction force.
250 200 150 100 50 0 -50 -100 -150 -200
Fig. 8 Block diagram of the experimental setup
0
2.5
5
7.5
0
2.5
5
7.5
0
2.5
5
7.5
(a)
(b)
10
12.5
15 time (s)
10
12.5
15 time (s)
10
12.5
15 time (s)
PO (Nm)
50
0
-50
(c) 40 PC (N)
20 0 -20 -40 0
2.5
5
7.5
10
12.5
15 time (s)
(d) 2
motor current
1.5 current (A)
To show the performance of the proposed hardware based damping injection method, experiments are performed using a FPGA/RT platform. Fig. 8 shows the block diagram of the experimental setup. The experiment is performed on National Instruments Real-Time control system with PXI-8186 embedded controller and PXI-7833R FPGA module. Brushed DC motor (Maxon RE25) with a handle is used as a one-DOF haptic device. MR encoder (1024 pulses/revolution), and a Hall-current sensor with 185 mV/A output sensitivity is used to measure the displacement and the motor current, respectively. The motor is driven by a bidirectional motor driver circuit. The entire proposed PO/PC scheme is implemented inside FPGA, and virtual environment is rendered inside computer on Windows XP. The virtual spring is located at Xwall = 0.1 m. Fig. 9 shows the case when the PO/PC is off. Position and force response was highly unstable after the operator makes contact with the virtual environment.
position Xwall
current ref.
1 0.5 0 -0.5 -1 -1.5 0
2.5
5
7.5
10
12.5
15 time (s)
(e)
Fig. 10 Noisy behavior of the conventional software bas ed PO/PC (Ke=3N/m) position Xwall
0
position (m)
0
position (m)
-0.05
-0.1
-0.1 -0.15 -0.2 -0.25
-0.2
0
2
(a)
4
velocity (RPM)
-0.3 6 time (s)
force (N)
2 1.5
250 200 150 100 50 0 -50 -100 -150 -200
1
0
0
2
4
(b)
PO (Nm)
0.5
6 time (s)
Fig. 9 Unstable contact without PO/PC (Ke=3N/m)
2.5
5
7.5
10
12.5
15 time (s)
0
2.5
5
7.5
10
12.5
15 time (s)
0
2.5
5
7.5
10
12.5
15 time (s)
(a)
(b)
(c)
0.01
PC (N)
0 -0.01 -0.02 -0.03 -0.04 -0.05
0
2.5
5
7.5
10
12.5
(d)
current (A)
Fig. 10 shows the contact response with the conventional software based PO/PC. Human operator pushed the one-DOF haptic device to contact with the virtual wall (Ke=3N/m) updated every 1msec. At first, the contact seems stable on the Position response [Fig.10 (a)]. When the device was going to move out of the virtual wall with low velocity, the PC input started vibrating [Fig.10 (d)] and the PO value kept falling down to a huge negative value [Fig.10 (c)]. Physically, the human operator felt continuous vibration. Therefore, the perception of the virtual environment was destroyed and the system diverges. By applying the proposed FPGA based PO/PC
60 50 40 30 20 10 0 -10
0
2 1.5 1 0.5 0 -0.5 -1 -1.5 -2
15 time (s)
motor current current ref.
0
2.5
5
7.5
(e)
10
12.5
15 time (s)
Fig. 11 Experiment results with the FPGA-based PO/PC
1839
[8]
(Ke=3N/m)
6. CONCLUSION AND FUTURE WORK In this paper, the PO/PC was implemented in hardware level through FPGA to solve the limitation of software based PO/PC. One essential method to solve
this problem was to obtain noise free low velocity signal. Two commonly used velocity estimation methods, M-method and T-method, was discussed along with comparing their performance over sampling frequency. In this paper, T-method was chosen to remove the noisy behavior for its good performance at low velocity. For calculating the more accurate energy flow, instead of the force command from the virtual environment directly measured current value was used. The entire PO/PC scheme was implemented with several different routines with different loop rates inside FPGA. One significant difference of the hardware based PO/PC method is that the PO/PC values update only when encoder pulse happen while the conventional software based PO/PC was updated every sampling time. It makes the energy calculation and dissipation more accuracy. Experimental results showed the benefits of this method. In the near future, we plan to develop one board motor driver with the PO/PC embedded FPGA, which allow us to simply replace the conventional motor driver.
[9]
[10]
[11] [12]
[13]
[14] [15]
REFERENCES [1]
[2]
[3]
[4]
[5] [6] [7]
J. Edward Colgate, Michael C. Stanley and J. Michael Brown, “Issues in the Haptic Display of Tool Use”, In Proceedings of the 1995 IEEE/RSJ International Conference on Intelligent Robots and Systems R. J. Adams and B. Hannaford, “Stable Haptic Interaction with Virtual Environments,” IEEE Trans. on Robotics and Automation, vol. 15, no. 3, pp. 465-474, 1999. J. E. Colgate, and G. Schenkel, “Passivity of a Class of Sampled Data Systems: Application to Haptic Interfaces,” American Control Conference, Baltimore, MD, 1994, pp. 3236-3240. J. E. Colgate, and J. M. Brown, “Factors Affecting the Z-Width of a Haptic Display,” Proc. IEEE Int. Conf. Robot. Automat, San Diego, CA, May 1994, pp. 3205-3210. Anderson R J, Spong M W. “Bilateral Control of Teleoperators with Time Delay” IEEE Trans. on Automatic Control. 1989, 34(5):494-503. G. Niemeyer and J. J. Slotine, “Stable Adaptive Teleoperation,” IEEE Journal of Oceanic Engineering, vol. 16, pp. 152-162, 1991. B. Hannaford, and J. H. Ryu, “Time Domain Passivity Control of Haptic Interfaces,” IEEE Trans. on Robotics and Automation, vol. 18, no. 1, pp. 1-10, 2002.
[16]
[17]
1840
J. Mehling, J. Colgate, and M. Peshkin, “Increasing the impedance range of a haptic display by adding electrical damping,” in Proc. of the IEEE World Haptics Conference (WHC), Pisa, Italy, March 2005, pp. 257–262. D.W. Weir, J.E. Colgate, M.A. Peshkin, “Measuring and Increasing Z-Width with Active Electrical Damping,” Proceedings of the IEEE 16th SymposiumonHaptic Interfaces for Virtual Environment and Teleoperator Systems 2008, Reno, Nevada, March 13-14, 2008. A. J. van derSchaft, L2-Gain and Passivity ser. Techniques in Nonlinear Control, Communications and Control Engineering Series. Berlin, Germany: Springer-Verlag, 2000. J. C.Willems, “Dissipative dynamical systems—Part I: General theory,” Arch. Rat. Mech. An., vol. 45, pp. 321–351, 1972. J.H.Ryu, Y.S.Kim, and B. Hannaford, "Sampled and continuous time passivity and stability of virtual environments," IEEE Trans. Robot. Autom., vol.20.no.2.pp. 365-373, Apr. 2004. Jee-Hwan Ryu, Carsten Preusche, Blake Hannaford, and Gerd Hirzinger,“Time Domain Passivity Control with Reference Energy Behavior,” IEEE Trans. on Control Systems Technology, Vol. 13, No. 5, pp. 737-742. Blake Hannaford and Jee-Hwan Ryu, “Time Domain Passivity Control of Haptic Interfaces,” U.S. Patent No. 7,027,965 B2, Apr. 11, 2006. Y. S. Kim and B. Hannaford, “Some Practical Issues in Time Domain Passivity Control of Haptic Interfaces,” Proc. IEEE/RSJ Int. Conf. on Intelligent Robotics and Systems, Maui, Hawaii, 2001, pp. 1744-1750. Jee-Hwan Ryu, Blake Hannaford, Dong-Soo Kwon, and Jong-Hwan Kim, “A Simulation/Experimental Study of the Noisy Behavior of the Time Domain Passivity Controller,” IEEE Trans. on Robotics, Vol. 21, No. 4, pp. 733-741. SCI Impact Factor: 2.103 Tsuji, T.; Mizuochi, M.; Nishi, H.; Ohnishi, K., "A velocity measurement method for acceleration control," Industrial Electronics Society, 2005. IECON 2005. 32nd Annual Conference of IEEE, vol., no.pp. 6 pp.-, 6-10 Nov. 2005