Fundamental design limitation resulting from plant structure and characteristics has been an issue of interest in control engineering, see, for example, [ 2]. In the text [1], the authors also explained how control performance could be improved when more inputs were available for feedback. In the case of motion control, cascaded velocity/position loop structure shown in Figure 1 is widely-used because the additional output (velocity) is easily measured by a tachometer, or computed from the shaft encoder pulses. A commercial servomotor drive often has a PID control for velocity loop, or a cascade PID velocity/position control already implemented. At the end of this article we include tracking response of cascade PID in our performance comparision.

Figure 1: a cascade control structure

**Remarks: ** we choose to focus on the concept and results and omit setup details for readability. The generalized plant formulation and weight selection is the same as explained in previous parts.

The H_{∞} scheme for cascade control can be performed in 2 steps as follows

- synthesize a controller for inner (velocity) loop for disturbance attenuation performance
- with the controller from step 1, close the inner loop and use it as the plant for outer (position) loop synthesis focused on tracking performance

Now the two steps are discussed in more detail

From the plant model in Part II, it can be easily verified that the disturbance transfer function P_{w} in Figure 1 equals P_{qx}; i.e.,

If this were a simpler transfer function we might want to put it in the generalized plant. For this P_{w} such attempt unnecessarily complicates the problem setup and synthesis. So we just use the output disturbance attenuation setup in Figure 4 of Part I. For a deep sensitivity suppression in low-frequency, W_{s} is chosen as a second-order weighting function

with A=2 × 10^{-7}, M = 2, ω_{B} = 300. Meanwhile, the weighting function for KS is selected as

Forming a generalized plant

and synthesize a velocity-loop H_{∞} controller. Perform the same procedure as in Part II to achieve a stable closed-loop system. Simulate time-domain performance.

After we get a controller from step 1 that gives satisfactory performance, close the velocity loop with that controller and use the resulting closed-loop transfer function as the plant for next synthesis. Note that an H_{∞} algorithm often synthesizes a controller with higher order than necessary, so some model reduction technique such as balance truncration might be handy.

An S/T mixed-sensitivity H_{∞} tracking problem similar to the single-loop case in Part I is used in this second step, with weighting functions chosen as

Synthesize a controller and use it in the outer (position) loop.

Construct an Xcos diagram for time-domain simulation like shown in Figure 2, using the same command and disturbance input as in the single-loop design. .

Figure 2: Xcos model for a cascade control scheme

The step and sine wave disturbance comparison in Figure 3 shows vast improvement on disturbance attenuation.

Figure 3: step and disturbance response comparison

Indeed, the advantage can be shown more clearly in Figure 4 by comparing the frequency response of the open-loop disturbance transfer function and the attenuation achieved from the closed-loop system. For a 1 Hz disturbance signal, say, the reduction achieved by single-loop controller is only about 15 dB, compared to 50 dB reduction in the cascade control case. This confirms the time-domain responses in Figure 3.

Figure 4: disturbance attenuation in the frequency domain

To observe tracking response under disturbance, we leave the disturbance input signal as is, but change the command input to a multi-segment trajectory (generated using RTSX). 3 control schemes are compared: single-loop H_{∞}, cascade PID, and cascade H_{∞}. Figure 5 shows tracking responses, with errors plotted in Figure 6. The RMS values for errors in the three cases are 0.8403, 0.3405, and 0.0714, respectively.

Figure 5: command tracking performance comparison

Figure 6: errors in command tracking

- cofb_servojoint.zcos Xcos model for time-domain simulation
- sk.dat Example of controller data for simulation (Type load(‘sk.dat’) to load data into Scilab workspace.

- Skogestad S. and I. Postlethwaite,
*Multivariable Feedback Control: Analysis and Design, 2nd ed.*, John Wiley & Sons, 2005 - Freudenberg J.S., C.V. Hollot, R.H. Middleton and V. Toochinda,
*“Fundamental Design Limitations of the General Control Configuration,”*IEEE Transactions on Automatic Control, pp. 1355-1370, August 2003. - Toochinda V., Robot Analysis and Control with Scilab and RTSX, e-book, Mushin Dynamics, 2014.

Figure 1: a revolute joint driven by servomotor

The goal is to synthesize a stabilizing controller that yields good tracking performance. Let’s make some solid specifications as follows

- normalized trackin error must be less than 0.01 degree at all frequencies below 0.1 Hz
- closed-loop bandwidth within 100 Hz
- sufficient stability margins

One could quantify specs no 3 if he/she wishes. Here we emphasize on 1,2 so can leave 3 as is. The steps forH_{∞} synthesis are described below.

First of all, we need to construct plant models for analysis and for control synthesis. With straightforward (but rather tedious) block diagram reduction, the open-loop transfer function from input v to output q can be computed as

where

.

Details are left as an exercise to the reader. Assign values to all parameters and construct this plant in Scilab

ka1 = 0.5; ka2 = 1000; km1 = 0.1471; km2 = 0.26; ke = 0.1996; jm = 0.000156; bm = 0.001; kr = 1; tau = 0.0044; wn=2*%pi*30; z = 0.7; r2d = 180/%pi; s=poly(0,'s'); pxv = syslin('c',ka1*ka2*km1*km2/(tau*s+1+ka2*km1)); pqxnum = (tau*s+1+ka2*km1)^2*((1-jm*wn^2)*s^2+2*z*wn*s+wn^2); pqxden = (s+0.0001)*((jm*s+bm)*(tau*s+1+ka2*km1)^2+(tau*s+1)*km1*km2*ke)*(s^2+2*z*wn*s+wn^2); pqx = syslin('c',r2d*pqxnum/pqxden); Pqv = pqx*pxv;

Notice that we have replaced the integrator with very low frequency pole. This helps fix some numerical problem when forming closed-loop transfer functions and plotting frequency responses.

In reality we can never acquire a plant model that match the real plant perfectly. So to be practical, we assume that all plant parameters in the model are accurate within +/- 5 % of their actual values. So the plant model used in the synthesis is constructed as follows

// add random variations of +/- 5% to parameters ka1_a = ka1 + 0.1*ka1*(rand()-0.5); ka2_a = ka2 + 0.1*ka2*(rand()-0.5); km1_a = km1 + 0.1*km1*(rand()-0.5); km2_a = km2 + 0.1*km2*(rand()-0.5); ke_a = ke + 0.1*ke*(rand()-0.5); jm_a = jm + 0.1*jm*(rand()-0.5); bm_a = bm + 0.1*bm*(rand()-0.5); tau_a = tau + 0.1*tau*(rand()-0.5); wn_a = wn + 0.2*wn*(rand()-0.5); pxv_a = syslin('c',ka1_a*ka2_a*km1_a*km2_a/(tau_a*s+1+ka2_a*km1_a)); pqxnum_a = (tau_a*s+1+ka2_a*km1_a)^2*((1-jm_a*wn_a^2)*s^2+2*z*wn_a*s+wn_a^2); pqxden_a =(s+0.001)* ((jm_a*s+bm_a)*(tau_a*s+1+ka2_a*km1_a)^2+(tau_a*s+1)*km1_a*km2_a*ke_a)*(s^2+2*z*wn_a*s+wn_a^2); pqx_a = syslin('c',r2d*pqxnum_a/pqxden_a); Pqv_a = pqx_a*pxv_a;

From the 3 specifications above, weighting functions w_{1} and w_{2} can be chosen as follows

with their inverses shown in Figure 2, where the constraints from the 3 specifications are also imposed.

Figure 2: Inverses of weights w_{1} and w_{2} compared to specifications

These weighting functions can be constructed in Scilab using the following commands

// performance weighting function on S a=0.0002; m=2; wb=100; w1_n=((1/m)*s+wb); w1_d=(s+wb*a); w1 = syslin('c',w1_n,w1_d); // weighting on T w2_d=2*(s/1000 + 1); w2_n=s/300+1; w2 = syslin('c',w2_n,w2_d); // plot weighting functions gainplot(1/w1); gainplot(1/w2);

With the above plant model and weighting function data, we can use the diagram shown in Part I (Figure 5) to construct a generalized plant for this problem. Notice that while the transfer function from at left is less complicated, theH_{∞} routines in Scilab work with data in state-space form. Unfortunately, Scilab version at the time of this writing (5.4.0) does not have tf2ss command that works well with MIMO systems. So we need to construct the generalized plant directly in state space form. It can be shown that the state and output equations of generalized pland can be described as

where e = r – y. In Scilab, use the following commands

[Ap0,Bp0,Cp0,Dp0]=abcd(Pqv_a); [Aw1,Bw1,Cw1,Dw1]=abcd(w1); [Aw2,Bw2,Cw2,Dw2]=abcd(w2); Ap= [Ap0 zeros(size(Ap0,1),size(Aw1,2)) zeros(size(Ap0,1),size(Aw2,2)); -Bw1*Cp0 Aw1 zeros(size(Aw1,1),size(Aw2,2)); Bw2*Cp0 zeros(size(Aw2,1),size(Aw1,2)) Aw2]; Bp = [zeros(size(Bp0,1),size(Bw1,2)) Bp0; Bw1 zeros(size(Bw1,1),size(Bp0,2)); zeros(size(Bw2,1),size(Bw1,2)) zeros(size(Bw2,1),size(Bp0,2))]; Cp = [-Dw1*Cp0 Cw1 zeros(size(Cw1,1),size(Cw2,2)); Dw2*Cp0 zeros(size(Cw2,1),size(Cw1,2)) Cw2; -Cp0 zeros(size(Cp0,1),size(Cw1,2)) zeros(size(Cp0,1),size(Cw2,2))]; Dp = [Dw1 0.001; 0 0;1 0]; // makes D12 full rank Pgen=syslin('c',Agp,Bgp,Cgp,Dgp);

Notice that the commands appear messy, because we want to adjust the matrix sizes of generalized plant automatically instead of hard-codin, in case a higher order weight is used, say. Another point worth mentioning isH_{∞} routines require that matrix D_{12} has full rank. So we need to trick them by contaminating the D_{12} part of D_{p} with a small value such as 0.001. Failing to do this and the routine will abort with error message saying D12 is not full rank.

**Design tips: ** Never forget to Replace integrator with low-frequency pole (or more generally, shift any pole on jω axis slightly towards the left half plane) and put small values to D_{12} and/or D_{21} to avoid headache withH_{∞} synthesis.

After a generalized plant is constructed, here comes the moment of truth. Scilab has a couple of commands to synthesize anH_{∞} controller. A simple one is the hinf command. It does not require any iteration for an optimal γ value. The syntax on Scilab Help Browser reads like this

- [AK,BK,CK,DK,(RCOND)] = hinf(A,B,C,D,ncon,nmeas,gamma)

where A,B,C,D are state-space matrices of the generalized plant, ncon = number of control inputs (1 for SISO), nmeas = number of measurements (1 for SISO), and gamma is theH_{∞} norm for the design. Ideally we want to have gamma = 1, but if that is not admissable we need to relax it to greater value.

Alternatively, we can use commands that iterate for an optimal gamma

- [Sk,ro]=h_inf(P,r,romin,romax,nmax) // ro = 1/gamma^2
- [K]=ccontrg(P,r,gamma)

Note that these two commands work with data packed by syslin command. I summarize below how to put the right syntax for this problem. The choice is yours

// using hinf [Ak,Bk,Ck,Dk]=hinf(Agp,Bgp,Cgp,Dgp,1,1,5); // use gamma = 5. Try other values Sk=syslin('c',Ak,Bk,Ck,Dk); //using h_inf [Sk,ro]=h_inf(Pgen, [1,1],0, 200000, 100); // try vary romax, nmax //using ccontrg Sk = ccontrg(Pgen,[1,1],5); // gamma = 5. Try other values

These commands are good at complaining, especially for a difficult plant such as in our example. It’s common to see Scilab flooded with warning messages even at the end we get a working controller. The simple hinf command is less verbose. It prefers to die with unintelligible messge (like error code = 2. What the heck that means is beyond me).

First just make sure the synthesis finishes without error, then follow this checklist

- the closed-loop system is stable
- its frequency response meets performance specs
- time-domain simulation is satisfactory

Let’s continue by choosing the hinf command. Form the closed-loop transfer function S and T

[Ak,Bk,Ck,Dk]=hinf(Agp,Bgp,Cgp,Dgp,1,1,5); Sk=syslin('c',Ak,Bk,Ck,Dk); L=Sk*Pqv; S=1/(1+L); T = 1 -S; [Acl,Bcl,Ccl,Dcl]=abcd(T);

from the resulting controller Sk and the real plant Pqv (not the model Pqv_a used for synthesis!) . The closed-loop eigenvlues can be checked by spec command

-->spec(Acl) ans = - 33659.098 + 105.11254i - 33659.098 - 105.11254i - 32203.247 + 100.82362i - 32203.247 - 100.82362i - 1172.202 - 101.6205 + 452.53341i - 101.6205 - 452.53341i - 139.4265 + 118.307i - 139.4265 - 118.307i - 84.572481 + 51.942468i - 84.572481 - 51.942468i - 62.769261 - 0.0009995 - 6.5807423

A stable closed-loop system must have all eigenvalues with negative real part. If it is not stable, it might be because too much performance is asked. Try relaxing gamma to higher value, or adjusting the weighting function(s) and rerun the synthesis.

Only when you get a stable closed-loop should you plot the frequency responses of S and T. Otherwise you may find yourself looking through a meaningless plot and trying to interpret it. Use the gainplot command since we don’t need the phase of S and T.

gainplot(S); gainplot(T);

This results in the frequency response plot in Figure 3, together with the criteria from 3 specifications. We can see that tracking performance region is slightly violated at the corner, but the oveall seems okay.

Figure 3: Magnitude of S and T plotted against criteria

The last checklist is to simulate a time response. Construct an Xcos model like in Figure 4 and set up suitable simulation parameters.

Figure 4: Xcos model for a single-loop, output feedback controller

First we test only angle response to step command by turning off the torque disturbance signal. The result in Figure 5 looks quite nice. The rise time is less than 0.05 sec with no overshoot and unnoticable steady-state error. The undershoot at start time is common for a non-minimum phase plant.

Figure 5: Step response with no disturbance

However, when the disturbance d(t) = 0.001sin(2πt) is turned on at t = 1 sec, the response in Figure 6 indicates poor disturbance attenuation. The magnitude swing due to disturbance at output is 1.2, or more than 1000 times of d!

Figure 6: Step response with torque input disturbance

To summarize, in this part of ourH_{∞} trilogy we give a concrete example on how to synthesize a controller for tracking problem using Scilab. The resultingH_{∞} stabilizes the closed-loop system and yields satisfactory tracking performance. While all specifications are met, the feedback system is susceptble to disturbance at torque input, with significant disturbance amplification at plant output.

Since the track command and disturbance has spectrum in low-frequency region, you may believe that by pushing the magnitude of S lower in low-frequency, that should improve disturbance attenuation performance. That is a valid statement indeed. This sensitivity minimization is not trivial, unfortunately. The so-called “waterbed effect” dictates that the more you push low-frequency region of S, the more area it consumes above 0 dB line in high-frequency. When bandwidth is limited this results in high peak of S that affects stability. This effect is even worse for non-minimum phase plant, of course.

To see this by yourself, try using higher order weighing function for w_{1} to push magnitude of S down as much as you could in low-frequency. Email me if you can get a controller that could significantly improve disturbance attenuation performance.

Torque disturbance attenuation at point x in Figure 1 is a major issue in independent joint control of robot arms, since the disturbance signal d represents the force/torque exerted from adjacent joints. In the last episode of thisH_{∞} synthesis series, we will analyze this problem further and suggest a control structure that could better handle this demanding task.

- hinf_design_st.sceH
_{∞}synthesis for this example. Type exec(‘hinf_design_st.sce’,-1); to run - ofb_servojoint.zcos Xcos model for time-domain simulation
- sk.dat Example of controller data for simulation (in case you fail to synthesize one and want to run the above Xcos model. Type load(‘sk.dat’) to load data into Scilab workspace.

- Skogestad S. and I. Postlethwaite,
*Multivariable Feedback Control: Analysis and Design, 2nd ed.*, John Wiley & Sons, 2005

To narrow down the scope, we focus on a particular H_{∞} scheme called “mixed-sensitivity approach” in [1]. Controller synthesis is formulated as closed-loop transfer function shaping problems, mostly the sensitivity S, complementary sensitivity T, or some combination like KS, where K is the resulting stabilizing controller, hence the name “mixed-sensitivity.” The discussion is restricted to SISO (single-input/single-output) systems. Moreover, we only show the how-to’s and omit the underlying math/theory to save space. Please consult robust control texts xuch as [1], my all-time favorite on the subject.

H_{∞} is a model-based, output-feedback control. First a plant model must be available, either from physics or experiments. The latter, often referred to as system identification (Sys-ID) process, is prefered for control design, since it generally gives a good model that represents the real plant. For best result, the acquired model must be validated using different datasets from the ones you use in the Sys-ID.

Control synthesis is no different from any other computer algorithm: garbage-in, garbage-out applies. So the first and important step in the process is to put valid problem data to a form that the algorithm can interpret. This setup is sometimes called a “modern” paradigm, even though it’s quite dated already. Whatever the name, the framework is shown in Figure 1, consisting of the generalized plant P connected with the stabilizing controller K. Data in P contains the plant together with all weighting functions, while K is the controller we want to synthesize. Port w and u are exogenous input and control variable, and z and v are exogenous output to be minimized, and measured output to the controller, respectively. In a feedback diagram the signal v and u normally corresponds to the input and output of the controller. On the other hand, the signal w and z are defined according to the problem at hand.

Figure 1: general control configuration

As an example, consider the feedback system in Figure 2 with signals at certain points labeled as r =command, d = disturbance, n = measurement noise, e = tracking error, y_{p} = plant output, u and v are controller input and output. It is straightforward to arrange the diagram to the framework shown in Figure 3. Typically it’s not necessary to include all the signals shown here. For a regulation problem, say, the command signal r should be neglected.

Figure 2: a standard feedback system with defined signals

Figure 3: feedback system put into synthesis framework

Now we provide more details to the two common problems: disturbance attenuation (or regulation) and tracking

For disturbance attenuation setup, the exogenous input is a disturbance signal d entering at the plant output. Normally the disturbance signal has low frequency spectrum, so it can be attenuated if the gain of S is made small in that low frequency range. A performance weighting function w_{1} is used to cast S to a desired shape; i.e., a stabilizing controller is synthesized to minimize ||w_{1}||. This requirement alone is impractical because there is no bandwidth limitation for the closed-loop system. So another weighting function w_{2} is imposed on a suitable transfer function, a good choice is KS. So the goal of this S/KS mixed-sensitivity problem is to find a stabilizing controller that minimizes

With this setup, a generalized plant can be formed as shown in Figure 4, in transfer function (left) and state space (right) structures.

Figure 4: generalzied plant for disturbance attenuation problem

Tracking performance is evaluated as the ability of feedback system to minimize error between command signal r and plant output y. Since a typical command signal changes gradually, It can be easily verified that this amounts to the gain of S be made small in the low-frequency range as well. So, for SISO feedback system, the performance requirement for disturbance attenuation and tracking is similar; that is, to minimize ||w_{1}S|| where w_{1} is a performance weighting function. We also need to constrain closed-loop bandwidth as before. It is customary for a tracking problem to cast another weight w_{2} on T. Hence, the resulting stabilizing controller must minimize

This setup is also called S/T mixed-sensitivity problem. Figure 5 shows how to form a generalized plant.

Figure 5: generalzied plant for tracking problem

For performance requirement, the minimization of ||w_{1}|| _{∞} < 1 is equivalent to S(jω)| < 1/|w_1(j\omega)|, ∀ω. In words, we want the sensitivity gain |S| to lie below the inverse of weighting function w_{1} for all frequency. Roughly speaking, we simply plot gain of 1/w_{1} and see if it looks like the desired sensitivity gain. The three quantities of interest, shown in Figure 6, are A=minimum steady-state tracking error, ω_{B}=minimum bandwidth (where 1/|w_{1}| crosses 0.707), and M= maximum peak magnitude of S.

Figure 6: criteria for inverse of performance weight

With these criteria, a weighting function can then be selected as

In case a steeper slope in low-frequency region is required, an n^{th} order weight

may be used.

A weighting function w_{2} to constrain bandwidth can be chosen such that the gain of 1/w_{2} forces a rolloff at desired frequency.

The next article in this series will provide an example of servo robot joint control using Scilab/Xcos. Stay tuned.

- Skogestad S. and I. Postlethwaite,
*Multivariable Feedback Control: Analysis and Design, 2nd ed.*, John Wiley & Sons, 2005

Warning : This is an outdated material. It is provided here for reference only. Some links may no longer work.

*Coming soon to a computer near you*

As an instructor who has been teaching industrial robotic courses for more than 10 years, I know too well the difficulty in explaining, without computer aids, topics such as kinematics in 3-D to students. A simple example about rotating coordinate frames could be hard to visualize and comprehend on a flat whiteboard or paper. As computer technology matures, I continue to look for good software tools to supplement my course. Robotic Toolbox by P.I.Corke stays as my favorite choice for some time in terms of well-written documents, up to date, adaptability, and ease of use. The main obstacle for a developing country like Thailand is that it requires MATLAB/Simulink from The MathWorks, Inc , which is available only on computer networks of major universities. Most Thai students, unfortunately, could not afford even the student version of this proprietary software.

Due to such inconvenience, I have switched to the open-source alternatives, Scilab/Xcos or Scicos, to solve engineering problems and strongly endorse them in my courses. The current version of Scilab (5.3.3 at the time of this writing) is quite stable and professional enough for both academic and industrial uses. I searched for robotic tools for Scilab on the internet and,to my dismay, found only some outdated work that could not be used with newer versions of Scilab. So my first attempt was to port Prof.Corke’s Robotic Toolbox for MATLAB (which from now on I will mention it as “rvctools” for short) to Scilab. I thought it should be painless, a thought that is now proved so wrong! While some basic functions might require only minimal efforts like changing the beginning of comment lines from % to //, that convenience could not apply to the rest. The most challenging ones are perhaps those graphic functions (plotting and animation) that I have to write them virtually from scratch. Another difficulty arises naturally when I realize the current Scilab doesn’t support OOP, while the robot models in rvctools are constructed as MATLAB objects. So doing such cool things like robot.plot( ) is not possible in Scilab.

Nevertheless, I still have to teach robotics. Hence, I am determined to make this Robotic Tools for Scilab/Xcos (RTSX) happen. The latest version version is made available on our download page

.

I am developing this RTSX software along my robotic course this semester. I turn the challenges into a good opportunity to explore Scilab/Xcos features. Above all, whatever the crap I am programming, it is always fun.

**A note to rvctools users: ** while I have tried to retain names and structures of certain basic functions, there are those that differ significantly. The differences are due either to the command syntax and nature of MATLAB v.s. Scilab, or just an intention to tailor the functions to my way of teaching. Hence some original rvctools functions are not implemented in RTSX, while some new functions are added. I put every effort to properly honor and cite rvctools at the heading comments of a few functions that could be ported from MATLAB to Scilab almost as is. Please think of RTSX as yet another open-source robotic software inspired by rvctools. It is by no means a competitor or substitute to that great work.

RTSX contains core functions for robotic study, starting from underlying mathematics such as homogeneous transformation, to application specific tools like modeling of various kinds of robots. For initial release, RTSX can be categorized into 5 basic groups, namely

- Kinematics
- Dynamics
- Path generation
- Control
- Robot vision

In this introduction, we give an example of kinematic study of a robot arm.

**Example 1: ** An RPR robot arm has its structure shown in Figure 1, where coordinate frames are attached conforming to the Denavit-Hartenberg (DH) convention. DH parameters can be found as in Table 1. To simplify the problem, let d_{1} = 1 and a_{3}. We want to show how to model , compute forward kinematics , plot, and animate this robot with RTSX.

Figure 1: An RPR robot arm with coordinate frames attached conforming to DH convention

Table 1: DH parameter table

For this 3-joint robot arm, its forward kinematics is simple enough to be solved by hand using conventional methods suggested in most textbooks. Roughly speaking, we use the DH parameters to derive homogeneous transformation matrices, frame by frame starting from base. For this problem, let us name it A_{1}, A_{2}, A_{3}. Then the forward kinematics from tool to base is the product A_{1}A_{2}A_{3} . One can verify that it equals

To construct a robot using RTSX, we start by creating each link from the DH parameters in Table 1

-->L(1) = Link([0 1 0 –pi/2]); -->L(2) = Link([-pi/2 1 0 –pi/2],'p'); // add 'p' to indicate a prismatic link -->L(3) = Link([0 0 1 0]);

Notice that we put in some default values for joint variables. The Link( ) function knows which parameter is a joint variable and which are constants by the joint type (default to revolute joint. Put ‘p’ as second argument to create a prismatic joint.) Now a robot model can be formed using SerialLink( )

-->ex1_robot = SerialLink(L);

which creates a robot model in Scilab workspace named ex1_robot. Check whether the DH parameters are entered correctly

-->Robotinfo(ex1_robot) Robot name: N/A Manufacturer: N/A Number of joints: 3 Configuration: RPR Method: Standard DH +---+-----------+-----------+-----------+-----------+ | j | theta | d | a | alpha | +---+-----------+-----------+-----------+-----------+ | 1 | q1 | 1.00 | 0.00 | -1.57 | | 2 | -1.57 | q2 | 0.00 | -1.57 | | 3 | q3 | 0.00 | 1.00 | 0.00 | +---+-----------+-----------+-----------+-----------+ Gravity = 0. 0. 9.81 Base = 1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 1. Tool = 1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 1. 0. 0. 0. 0. 1.

Optional tool and base coordinate frames can be added to the robot arm. For the moment we leave it as is. Now we can find forward kinematics by the function FKine( )

-->T=FKine(ex1_robot,[0 1 0]) T = 0. 0. 1. 0. 0. - 1. 0. 1. 1. 0. 0. 2. 0. 0. 0. 1.

with the robot model and joint variable values θ_{1} = 0, d_{2} = 1, &theta_{3} = 0 given as input arguments. Verify by plugging in the same set of joint variable into the forward kinematic equation above to see that they give the same answer.

-->q=[0 1 0]; // theta1 d2 theta3 -->s1 = sin(q(1)); c1 = cos(q(1)); s3 = sin(q(3)); c3 = cos(q(3)); d2=q(2); -->Ta = [s1*s3, s1*c3, c1, s1*s3-s1*d2; .. --> -c1*s3, -c1*c3, s1, -c1*s3+c1*d2; .. --> c3, -s3 0, c3+1; .. --> 0, 0, 0, 1 ] Ta = 0. 0. 1. 0. 0. - 1. 0. 1. 1. 0. 0. 2. 0. 0. 0. 1.

Let’s see how our RPR robot looks like. PlotRobot( ) just does what the function name says

-->PlotRobot(ex1_robot,[0 1 0]);

The resulting graphic window appears as in Figure 2. Note the prismatic link is shown in yellow with label d_{2}

Figure 2: RPR robot model from PlotRobot( )

If instead we want to see how coordinate frames are attached

-->PlotRobotFrame(ex1_robot,[0 1 0]);

yields the plot in Figure 3. Comparing this to the drawing in Figure 1 confirms our robot model in RTSX represents the original problem correctly.

Figure 3: RPR robot model from PlotRobotFrame( )

PlotRobotFrame( ) is very helpful for students to verify the DH frames they draw by hand in an homework assignment. A common mistake is finding incorrect positive sense for θ_{i} or α_{i}. In that case, the X_{i} or Z_{i} axis from PlotRobotFrame() will show up in opposite direction from the original.

Now we want to see how hour RPR robot moves using AnimateRobot( ). A sequence of joint variable values representing the movement must be generated. An ad-hoc way is to write a script file for simple joint moves. For example, we command all joints to first move simultaneously with value ranges: θ_{1} from 0 to 45 degree, d_{2} from 0.5 to 1.5 unit, θ_{3} from – 180 to 0 degree, then followed by joint 3 moves alone with θ_{3} from 0 to -180 degree, joint 2 moves alone with d_{2}from 1.5 to 0.5 unit, and joint 1 moves alone with θ_{1} from 45 to 0 degree, respectively. The video clip below shows the resulting animation.

RPR robot arm animation with AnimateRobot( )

**Disclaimer: ** RTSX is developed on Scilab 5.3.3 from www.scilab.org . I do not have time to test with any version of Scicoslab package from www.scicos.org so cannot warrant it could work with Scicoslab. Also, RTSX is mainly for academic use and is still under development. I cannot be responsible for any bug that might occur.

In case you wonder why these two sites are moved (and controlsystemslab.com and mushindynamics.com are gone). Here is my explanation.

I created these sites a couple of years ago as a public resource for control engineering and embedded systems. I used share host services from webhostinghub and later Bluehost and were willing to pay some affordable fees. Once in a while they informed me of excessive bandwidth and shut down my sites momentarily, all of them were WordPress-based. I installed WPSuperCache plugin and it seemed to help judging from no further complaint from them.

Here comes a new issue, malware attack. This time my account is deactivated indefinitely until I remove all the infected files, as many as 98. The latest email ends with a threat.

You may be asked to find a new hosting provider if your account is deactivated three times within a 60-day period.

Thank you,

Bluehost Support

Great! It sounds like I have intentionally violated their terms by planting malware to 98 files on my sites. Am I that malicious?

So I think I have enough with this. Apparently it must be user’s fault anytime a problem happening with my account. Am I blamed for not considering their sitelock package for some additional fee? Now my sites are held as hostages.

My choices are to delete and restore the files with my outdated backup and praying no evil would attack it again, or to move to a new site.

After some serious consideration, I settle on the latter. Even though I bought a 5-year plan from Bluehost that covers until 2022. I am completely dissatisfied with their poor service and do not want to waste my precious time with them anymore.

In fact, from a user’s viewpoint, I do not think they have done enough to protect a customer from such malware attack. I have used free services from Blogger and WordPress for some years and never have these annoying problems.

So here we are. While the moving is in process, you may find broken links here and there. Sorry for such inconvenience. They will be fixed.

If you’re like me, an engineer or scientist with limited free time who wants to share information on internet by your own, I suggest you avoid low-cost web hosting services out there. I never have good experience with any. And the worst is this Bluehost. You’ll do better nowadays with available free blog sites, with no deactivation, hassle or threat, provided that your site is legitimate. Above all, I cannot sense any performance difference between paid shared hosts and free services.

Best Regards,

Varodom Toochinda, Ph.D

Web Author

]]>