4
$\begingroup$

I collected this data from a robot that drives with its wheels up. The blue curve is the voltage and that is my input. The orange curve is the wheel velocity and that is my output.

enter image description here

I want to create a transfer function for when the voltage changes from 1 volt to 2 volt, and I don't want to include the part where the robot slows down. So I cut off the data so I only look the interval [1.05 , 2] sec. I also offset these values so they both start at 0.

enter image description here

Now I try to estimate a transfer function for this response, with tfest(data, 1, 0) and I get $H(s) = \frac{0.3916}{s+1.202}$, which is fine I guess. However, when I plot the step response the system with this transfer function I get this.

enter image description here

As you can see it takes much longer time for the output to reach 0.3 m/s than in the experiment. It takes about 4 seconds for the step response to reach 0.3m/s, but in the experiment it only took 0.2 seconds.

Why is my transfer function so slow to reach the actual output value? Does it have something to do with the way I cropped the data?

Edit

Here is my MATLAB code:

close all
clear
data = load('Emilie_day4_1.txt');

% Emilie (25)
%  1    time 0.004 sec
%  2  3 Motor voltage [V] left, right: 0.00 0.00
%  4  5 Wheel velocity [m/s] left, right: -0.0000 -0.0000
figure(100)
plot(data(:,1), data(:,2))
hold on
plot(data(:,1), data(:,4))
grid on
legend('Left voltage' , 'Left Velocity')
xlabel('time (sec)')
hold off

figure(100)
plot(data(350:end-50,1), data(350:end-50,2)-1)
hold on
plot(data(350:end-50,1), data(350:end-50,4)-0.25)
grid on
legend('Left voltage' , 'Left Velocity')
xlabel('time (sec)')
hold off

ddin = (data(350:end-50,2)-1);
ddout = (data(350:end-50,4)-0.25);
idd1 = iddata(ddout, ddin, 0.05);



sys1 = tfest(idd1, 1, 0)

step(sys1)

The data is just collected in a simple text-file, but I couldn't post the text file in here so I just copied and pasted the numbers:

%% logfile from robot Emilie (25)
% Emilie (25)

%  1    time 0.001 sec

%  2  3 Motor voltage [V] left, right: 0.00 0.00

%  4  5 Wheel velocity [m/s] left, right: 0.0000 0.0000

0.001 0.00 0.00 0.0000 0.0000 

0.004 0.00 0.00 0.0000 0.0000 

0.007 0.00 0.00 0.0000 0.0000 

0.010 0.00 0.00 0.0000 0.0000 

0.013 0.00 0.00 0.0000 0.0000 

0.016 0.00 0.00 0.0000 0.0000 

0.019 0.00 0.00 0.0000 0.0000 

0.022 0.00 0.00 0.0000 0.0000 

0.025 0.00 0.00 0.0000 0.0000 

0.028 0.00 0.00 0.0000 0.0000 

0.031 0.00 0.00 0.0000 0.0000 

0.034 0.00 0.00 0.0000 0.0000 

0.037 0.00 0.00 0.0000 0.0000 

0.040 0.00 0.00 0.0000 0.0000 

0.043 0.00 0.00 0.0000 0.0000 

0.046 0.00 0.00 0.0000 0.0000 

0.049 0.00 0.00 0.0000 0.0000 

0.052 1.00 1.00 0.0000 0.0000 

0.055 1.00 1.00 0.0000 0.0000 

0.058 1.00 1.00 0.0000 0.0000 

0.061 1.00 1.00 0.0000 0.0000 

0.064 1.00 1.00 0.0000 0.0000 

0.067 1.00 1.00 0.0000 0.0908 

0.070 1.00 1.00 0.0000 0.1229 

0.073 1.00 1.00 0.0397 0.1249 

0.076 1.00 1.00 0.0397 0.1504 

0.079 1.00 1.00 0.0574 0.1414 

0.082 1.00 1.00 0.0574 0.1498 

0.085 1.00 1.00 0.0689 0.1454 

0.088 1.00 1.00 0.0689 0.1747 

0.091 1.00 1.00 0.0817 0.1895 

0.094 1.00 1.00 0.1061 0.1748 

0.097 1.00 1.00 0.1262 0.1963 

0.100 1.00 1.00 0.1375 0.1963 

0.103 1.00 1.00 0.1442 0.2174 

0.106 1.00 1.00 0.1438 0.2187 

0.109 1.00 1.00 0.1573 0.2107 

0.112 1.00 1.00 0.1663 0.2128 

0.115 1.00 1.00 0.1513 0.2157 

0.118 1.00 1.00 0.1735 0.2439 

0.121 1.00 1.00 0.1840 0.2413 

0.124 1.00 1.00 0.1753 0.2621 

0.127 1.00 1.00 0.1847 0.2442 

0.130 1.00 1.00 0.1775 0.2279 

0.133 1.00 1.00 0.1710 0.2491 

0.136 1.00 1.00 0.1911 0.2390 

0.139 1.00 1.00 0.1961 0.2496 

0.142 1.00 1.00 0.1888 0.2448 

0.145 1.00 1.00 0.2004 0.2216 

0.148 1.00 1.00 0.1871 0.2796 

0.151 1.00 1.00 0.1874 0.2379 

0.154 1.00 1.00 0.2008 0.2463 

0.157 1.00 1.00 0.1973 0.2600 

0.160 1.00 1.00 0.1940 0.2540 

0.164 1.00 1.00 0.1951 0.2668 

0.167 1.00 1.00 0.2033 0.2471 

0.170 1.00 1.00 0.2143 0.2635 

0.173 1.00 1.00 0.2105 0.2455 

0.176 1.00 1.00 0.2183 0.2758 

0.179 1.00 1.00 0.2037 0.2520 

0.182 1.00 1.00 0.2057 0.2772 

0.185 1.00 1.00 0.2245 0.2991 

0.188 1.00 1.00 0.2177 0.2787 

0.191 1.00 1.00 0.2128 0.2950 

0.194 1.00 1.00 0.2048 0.2840 

0.197 1.00 1.00 0.1997 0.3047 

0.200 1.00 1.00 0.2197 0.2818 

0.203 1.00 1.00 0.2167 0.3006 

0.206 1.00 1.00 0.2127 0.2839 

0.209 1.00 1.00 0.2376 0.3096 

0.212 1.00 1.00 0.1997 0.2849 

0.215 1.00 1.00 0.2321 0.2769 

0.218 1.00 1.00 0.2245 0.3037 

0.221 1.00 1.00 0.2352 0.2593 

0.224 1.00 1.00 0.2252 0.2652 

0.227 1.00 1.00 0.2292 0.2788 

0.230 1.00 1.00 0.2391 0.2696 

0.233 1.00 1.00 0.2198 0.2829 

0.236 1.00 1.00 0.2407 0.2636 

0.239 1.00 1.00 0.2154 0.2830 

0.242 1.00 1.00 0.2359 0.3138 

0.245 1.00 1.00 0.2197 0.2894 

0.248 1.00 1.00 0.2224 0.3059 

0.251 1.00 1.00 0.2226 0.2915 

0.254 1.00 1.00 0.2169 0.3127 

0.257 1.00 1.00 0.2383 0.2907 

0.260 1.00 1.00 0.2305 0.2910 

0.263 1.00 1.00 0.2417 0.2826 

0.266 1.00 1.00 0.2213 0.2645 

0.269 1.00 1.00 0.2285 0.2668 

0.272 1.00 1.00 0.2370 0.2852 

0.275 1.00 1.00 0.2330 0.2695 

0.278 1.00 1.00 0.2401 0.2794 

0.281 1.00 1.00 0.2153 0.2733 

0.284 1.00 1.00 0.2344 0.2465 

0.287 1.00 1.00 0.2308 0.3151 

0.290 1.00 1.00 0.2237 0.2876 

0.293 1.00 1.00 0.2501 0.3079 

0.296 1.00 1.00 0.2223 0.2894 

0.299 1.00 1.00 0.2415 0.3145 

0.302 1.00 1.00 0.2321 0.2893 

0.305 1.00 1.00 0.2425 0.2862 

0.308 1.00 1.00 0.2321 0.2627 

0.311 1.00 1.00 0.2352 0.2956 

0.314 1.00 1.00 0.2441 0.2679 

0.317 1.00 1.00 0.2240 0.2975 

0.320 1.00 1.00 0.2431 0.2758 

0.323 1.00 1.00 0.2172 0.2927 

0.326 1.00 1.00 0.2376 0.3086 

0.329 1.00 1.00 0.2205 0.2960 

0.332 1.00 1.00 0.2236 0.3158 

0.335 1.00 1.00 0.2228 0.2928 

0.338 1.00 1.00 0.2284 0.3109 

0.341 1.00 1.00 0.2383 0.2925 

0.344 1.00 1.00 0.2301 0.2837 

0.347 1.00 1.00 0.2328 0.2774 

0.350 1.00 1.00 0.2134 0.2498 

0.353 1.00 1.00 0.2213 0.3078 

0.356 1.00 1.00 0.2308 0.2575 

0.359 1.00 1.00 0.2269 0.2652 

0.362 1.00 1.00 0.2377 0.2778 

0.365 1.00 1.00 0.2206 0.3117 

0.368 1.00 1.00 0.2407 0.2857 

0.371 1.00 1.00 0.2368 0.3054 

0.374 1.00 1.00 0.2294 0.2908 

0.377 1.00 1.00 0.2562 0.3133 

0.380 1.00 1.00 0.2131 0.2895 

0.383 1.00 1.00 0.2511 0.3067 

0.386 1.00 1.00 0.2299 0.2738 

0.389 1.00 1.00 0.2409 0.2777 

0.392 1.00 1.00 0.2199 0.2647 

0.395 1.00 1.00 0.2337 0.2802 

0.398 1.00 1.00 0.2432 0.2883 

0.401 1.00 1.00 0.2234 0.2711 

0.404 1.00 1.00 0.2271 0.3129 

0.407 1.00 1.00 0.2175 0.2945 

0.410 1.00 1.00 0.2372 0.3200 

0.413 1.00 1.00 0.2273 0.2948 

0.416 1.00 1.00 0.2241 0.3121 

0.419 1.00 1.00 0.2240 0.2987 

0.422 1.00 1.00 0.2301 0.2653 

0.425 1.00 1.00 0.2347 0.2726 

0.428 1.00 1.00 0.2328 0.2853 

0.431 1.00 1.00 0.2451 0.2755 

0.434 1.00 1.00 0.2271 0.2881 

0.437 1.00 1.00 0.2462 0.2692 

0.440 1.00 1.00 0.2405 0.2865 

0.443 1.00 1.00 0.2376 0.3098 

0.446 1.00 1.00 0.2295 0.2859 

0.449 1.00 1.00 0.2363 0.3028 

0.452 1.00 1.00 0.2424 0.2884 

0.455 1.00 1.00 0.2300 0.3099 

0.458 1.00 1.00 0.2410 0.2893 

0.461 1.00 1.00 0.2229 0.2883 

0.464 1.00 1.00 0.2096 0.2850 

0.467 1.00 1.00 0.2487 0.2675 

0.470 1.00 1.00 0.2200 0.2688 

0.473 1.00 1.00 0.2336 0.2883 

0.476 1.00 1.00 0.2228 0.2722 

0.479 1.00 1.00 0.2464 0.2839 

0.482 1.00 1.00 0.2343 0.3106 

0.485 1.00 1.00 0.2457 0.2991 

0.488 1.00 1.00 0.2293 0.3208 

0.491 1.00 1.00 0.2273 0.2938 

0.494 1.00 1.00 0.2241 0.3126 

0.497 1.00 1.00 0.2304 0.2937 

0.500 1.00 1.00 0.2408 0.2892 

0.503 1.00 1.00 0.2216 0.2700 

0.506 1.00 1.00 0.2423 0.2886 

0.509 1.00 1.00 0.2374 0.2661 

0.512 1.00 1.00 0.2416 0.2985 

0.515 1.00 1.00 0.2256 0.3036 

0.518 1.00 1.00 0.2325 0.2890 

0.521 1.00 1.00 0.2451 0.3103 

0.524 1.00 1.00 0.2373 0.2896 

0.527 1.00 1.00 0.2440 0.3060 

0.530 1.00 1.00 0.2240 0.2934 

0.533 1.00 1.00 0.2430 0.3114 

0.536 1.00 1.00 0.2386 0.2866 

0.539 1.00 1.00 0.2269 0.2885 

0.542 1.00 1.00 0.2510 0.2719 

0.545 1.00 1.00 0.2165 0.2828 

0.548 1.00 1.00 0.2430 0.2751 

0.551 1.00 1.00 0.2331 0.2492 

0.554 1.00 1.00 0.2446 0.3092 

0.557 1.00 1.00 0.2251 0.2908 

0.560 1.00 1.00 0.2380 0.3106 

0.563 1.00 1.00 0.2467 0.2918 

0.566 1.00 1.00 0.2268 0.3170 

0.569 1.00 1.00 0.2309 0.2913 

0.572 1.00 1.00 0.2204 0.3098 

0.575 1.00 1.00 0.2401 0.2785 

0.578 1.00 1.00 0.2295 0.2969 

0.581 1.00 1.00 0.2260 0.2701 

0.584 1.00 1.00 0.2264 0.2996 

0.587 1.00 1.00 0.2317 0.2778 

0.591 1.00 1.00 0.2360 0.2950 

0.594 1.00 1.00 0.2409 0.3108 

0.597 1.00 1.00 0.2251 0.2924 

0.600 1.00 1.00 0.2273 0.2713 

0.603 1.00 1.00 0.2466 0.2740 

0.606 1.00 1.00 0.2370 0.2915 

0.609 1.00 1.00 0.2446 0.2747 

0.612 1.00 1.00 0.2240 0.2852 

0.615 1.00 1.00 0.2372 0.3111 

0.618 1.00 1.00 0.2383 0.2986 

0.621 1.00 1.00 0.2308 0.3203 

0.624 1.00 1.00 0.2584 0.2930 

0.627 1.00 1.00 0.2296 0.3127 

0.630 1.00 1.00 0.2488 0.2937 

0.633 1.00 1.00 0.2382 0.2833 

0.636 1.00 1.00 0.2491 0.2640 

0.639 1.00 1.00 0.2277 0.2829 

0.642 1.00 1.00 0.2420 0.2611 

0.645 1.00 1.00 0.2503 0.2932 

0.648 1.00 1.00 0.2294 0.2664 

0.651 1.00 1.00 0.2274 0.2963 

0.654 1.00 1.00 0.2167 0.3135 

0.657 1.00 1.00 0.2369 0.2915 

0.660 1.00 1.00 0.2268 0.3078 

0.663 1.00 1.00 0.2234 0.2952 

0.666 1.00 1.00 0.2234 0.3151 

0.669 1.00 1.00 0.2297 0.2917 

0.672 1.00 1.00 0.2346 0.2886 

0.675 1.00 1.00 0.2321 0.2732 

0.678 1.00 1.00 0.2446 0.2832 

0.681 1.00 1.00 0.2278 0.2770 

0.684 1.00 1.00 0.2487 0.2498 

0.687 1.00 1.00 0.2435 0.3118 

0.690 1.00 1.00 0.2420 0.2928 

0.693 1.00 1.00 0.2324 0.3118 

0.696 1.00 1.00 0.2395 0.2926 

0.699 1.00 1.00 0.2407 0.3187 

0.702 1.00 1.00 0.2381 0.2935 

0.705 1.00 1.00 0.2510 0.3116 

0.708 1.00 1.00 0.2313 0.2741 

0.711 1.00 1.00 0.2513 0.2977 

0.714 1.00 1.00 0.2397 0.2708 

0.717 1.00 1.00 0.2264 0.3010 

0.720 1.00 1.00 0.2346 0.2780 

0.723 1.00 1.00 0.2384 0.2959 

0.726 1.00 1.00 0.2478 0.3117 

0.729 1.00 1.00 0.2355 0.2984 

0.732 1.00 1.00 0.2477 0.3182 

0.735 1.00 1.00 0.2202 0.2948 

0.738 1.00 1.00 0.2398 0.3135 

0.741 1.00 1.00 0.2235 0.2750 

0.744 1.00 1.00 0.2263 0.2857 

0.747 1.00 1.00 0.2259 0.2783 

0.750 1.00 1.00 0.2204 0.2503 

0.753 1.00 1.00 0.2414 0.3113 

0.756 1.00 1.00 0.2340 0.2612 

0.759 1.00 1.00 0.2455 0.3073 

0.762 1.00 1.00 0.2277 0.2887 

0.765 1.00 1.00 0.2329 0.3137 

0.768 1.00 1.00 0.2424 0.2886 

0.771 1.00 1.00 0.2398 0.3066 

0.774 1.00 1.00 0.2304 0.2923 

0.777 1.00 1.00 0.2240 0.3145 

0.780 1.00 1.00 0.2433 0.2762 

0.783 1.00 1.00 0.2361 0.2977 

0.786 1.00 1.00 0.2497 0.2755 

0.789 1.00 1.00 0.2304 0.2787 

0.792 1.00 1.00 0.2163 0.2650 

0.795 1.00 1.00 0.2562 0.2809 

0.798 1.00 1.00 0.2257 0.3175 

0.801 1.00 1.00 0.2399 0.2948 

0.804 1.00 1.00 0.2293 0.3149 

0.807 1.00 1.00 0.2529 0.2965 

0.810 1.00 1.00 0.2400 0.3218 

0.813 1.00 1.00 0.2521 0.2918 

0.816 1.00 1.00 0.2248 0.2529 

0.819 1.00 1.00 0.2324 0.3147 

0.822 1.00 1.00 0.2271 0.2673 

0.825 1.00 1.00 0.2295 0.2746 

0.828 1.00 1.00 0.2301 0.2876 

0.831 1.00 1.00 0.2240 0.3205 

0.834 1.00 1.00 0.2449 0.2934 

0.837 1.00 1.00 0.2366 0.3129 

0.840 1.00 1.00 0.2486 0.2973 

0.843 1.00 1.00 0.2283 0.3174 

0.846 1.00 1.00 0.2349 0.2853 

0.849 1.00 1.00 0.2441 0.2925 

0.852 1.00 1.00 0.2419 0.2717 

0.855 1.00 1.00 0.2315 0.2743 

0.858 1.00 1.00 0.2257 0.2620 

0.861 1.00 1.00 0.2445 0.2770 

0.864 1.00 1.00 0.2369 0.2857 

0.867 1.00 1.00 0.2501 0.2682 

0.871 1.00 1.00 0.2307 0.3120 

0.874 1.00 1.00 0.2502 0.2949 

0.877 1.00 1.00 0.2397 0.2878 

0.880 1.00 1.00 0.2481 0.2798 

0.883 1.00 1.00 0.2370 0.2530 

0.886 1.00 1.00 0.2416 0.3145 

0.889 1.00 1.00 0.2502 0.2677 

0.892 1.00 1.00 0.2299 0.3145 

0.895 1.00 1.00 0.2345 0.2952 

0.898 1.00 1.00 0.2236 0.3205 

0.901 1.00 1.00 0.2431 0.2943 

0.904 1.00 1.00 0.2320 0.3036 

0.907 1.00 1.00 0.2293 0.2895 

0.910 1.00 1.00 0.2291 0.2917 

0.913 1.00 1.00 0.2349 0.2645 

0.916 1.00 1.00 0.2393 0.2947 

0.919 1.00 1.00 0.2366 0.2741 

0.922 1.00 1.00 0.2489 0.2761 

0.925 1.00 1.00 0.2306 0.2636 

0.928 1.00 1.00 0.2495 0.2788 

0.931 1.00 1.00 0.2401 0.3141 

0.934 1.00 1.00 0.2423 0.2910 

0.937 1.00 1.00 0.2328 0.3103 

0.940 1.00 1.00 0.2391 0.2930 

0.943 1.00 1.00 0.2405 0.3189 

0.946 1.00 1.00 0.2332 0.2939 

0.949 1.00 1.00 0.2511 0.2702 

0.952 1.00 1.00 0.2324 0.3121 

0.955 1.00 1.00 0.2526 0.2657 

0.958 1.00 1.00 0.2419 0.2725 

0.961 1.00 1.00 0.2534 0.2874 

0.964 1.00 1.00 0.2415 0.2767 

0.967 1.00 1.00 0.2452 0.2940 

0.970 1.00 1.00 0.2536 0.3127 

0.973 1.00 1.00 0.2332 0.2978 

0.976 1.00 1.00 0.2363 0.3199 

0.979 1.00 1.00 0.2236 0.2952 

0.982 1.00 1.00 0.2424 0.3018 

0.985 1.00 1.00 0.2319 0.2792 

0.988 1.00 1.00 0.2422 0.2816 

0.991 1.00 1.00 0.2284 0.2642 

0.994 1.00 1.00 0.2346 0.2791 

0.997 1.00 1.00 0.2393 0.2871 

1.000 1.00 1.00 0.2452 0.2874 

1.003 1.00 1.00 0.2413 0.3057 

1.006 1.00 1.00 0.2319 0.2880 

1.009 1.00 1.00 0.2510 0.3136 

1.012 1.00 1.00 0.2424 0.2885 

1.015 1.00 1.00 0.2510 0.3051 

1.018 1.00 1.00 0.2354 0.2941 

1.021 1.00 1.00 0.2422 0.2751 

1.024 1.00 1.00 0.2426 0.2691 

1.027 1.00 1.00 0.2350 0.2822 

1.030 1.00 1.00 0.2632 0.2731 

1.033 1.00 1.00 0.2297 0.2878 

1.036 1.00 1.00 0.2535 0.2684 

1.039 1.00 1.00 0.2353 0.2884 

1.042 1.00 1.00 0.2448 0.3196 

1.045 1.00 1.00 0.2245 0.2955 

1.048 1.00 1.00 0.2386 0.3121 

1.051 1.00 1.00 0.2478 0.2965 

1.054 2.00 2.00 0.2293 0.3143 

1.057 2.00 2.00 0.2516 0.2898 

1.060 2.00 2.00 0.2757 0.3272 

1.063 2.00 2.00 0.2849 0.3839 

1.066 2.00 2.00 0.3042 0.3549 

1.069 2.00 2.00 0.3231 0.4066 

1.072 2.00 2.00 0.3523 0.4087 

1.075 2.00 2.00 0.3621 0.4636 

1.078 2.00 2.00 0.3630 0.4676 

1.081 2.00 2.00 0.3909 0.4542 

1.084 2.00 2.00 0.4140 0.4737 

1.087 2.00 2.00 0.4162 0.4757 

1.090 2.00 2.00 0.4087 0.4932 

1.093 2.00 2.00 0.4577 0.5175 

1.096 2.00 2.00 0.4504 0.5372 

1.099 2.00 2.00 0.4106 0.5051 

1.102 2.00 2.00 0.4644 0.5224 

1.105 2.00 2.00 0.4487 0.5082 

1.109 2.00 2.00 0.4709 0.5515 

1.112 2.00 2.00 0.4636 0.5599 

1.115 2.00 2.00 0.4666 0.5718 

1.118 2.00 2.00 0.4799 0.5362 

1.121 2.00 2.00 0.4752 0.5390 

1.124 2.00 2.00 0.5014 0.5386 

1.127 2.00 2.00 0.5001 0.6373 

1.131 2.00 2.00 0.4996 0.6026 

1.134 2.00 2.00 0.5035 0.6069 

1.137 2.00 2.00 0.5089 0.5909 

1.140 2.00 2.00 0.4959 0.5704 

1.143 2.00 2.00 0.5338 0.6637 

1.146 2.00 2.00 0.5158 0.6623 

1.149 2.00 2.00 0.4965 0.5639 

1.152 2.00 2.00 0.5194 0.6177 

1.155 2.00 2.00 0.5280 0.6263 

1.158 2.00 2.00 0.5082 0.5601 

1.161 2.00 2.00 0.5355 0.5763 

1.164 2.00 2.00 0.5304 0.6717 

1.167 2.00 2.00 0.5357 0.6070 

1.170 2.00 2.00 0.5880 0.5838 

1.173 2.00 2.00 0.5691 0.6339 

1.176 2.00 2.00 0.5479 0.6030 

1.179 2.00 2.00 0.5642 0.6874 

1.182 2.00 2.00 0.5465 0.6917 

1.185 2.00 2.00 0.5378 0.6354 

1.188 2.00 2.00 0.5355 0.6504 

1.191 2.00 2.00 0.5445 0.6041 

1.194 2.00 2.00 0.5423 0.6959 

1.197 2.00 2.00 0.5481 0.6968 

1.200 2.00 2.00 0.5444 0.6076 

1.203 2.00 2.00 0.5413 0.6570 

1.206 2.00 2.00 0.5139 0.6219 

1.209 2.00 2.00 0.5253 0.7094 

1.212 2.00 2.00 0.5792 0.6432 

1.215 2.00 2.00 0.5288 0.6444 

1.218 2.00 2.00 0.5595 0.6562 

1.221 2.00 2.00 0.5804 0.5991 

1.224 2.00 2.00 0.5846 0.6884 

1.227 2.00 2.00 0.5808 0.6301 

1.230 2.00 2.00 0.5813 0.6558 

1.233 2.00 2.00 0.5826 0.6540 

1.236 2.00 2.00 0.5548 0.6209 

1.239 2.00 2.00 0.6101 0.7041 

1.242 2.00 2.00 0.5892 0.6479 

1.245 2.00 2.00 0.5673 0.6582 

1.248 2.00 2.00 0.5821 0.5861 

1.251 2.00 2.00 0.5500 0.7047 

1.254 2.00 2.00 0.5530 0.6325 

1.257 2.00 2.00 0.5504 0.6421 

1.260 2.00 2.00 0.5564 0.6674 

1.263 2.00 2.00 0.5681 0.6137 

1.266 2.00 2.00 0.5749 0.7109 

1.269 2.00 2.00 0.5885 0.6008 

1.272 2.00 2.00 0.5492 0.6658 

1.275 2.00 2.00 0.5944 0.6148 

1.278 2.00 2.00 0.5966 0.7146 

1.281 2.00 2.00 0.6011 0.6755 

1.284 2.00 2.00 0.5871 0.6505 

1.288 2.00 2.00 0.5568 0.6991 

1.291 2.00 2.00 0.5541 0.6584 

1.294 2.00 2.00 0.5749 0.6584 

1.297 2.00 2.00 0.5651 0.6876 

1.300 2.00 2.00 0.5667 0.7106 

1.303 2.00 2.00 0.5861 0.6928 

1.306 2.00 2.00 0.5916 0.6581 

1.309 2.00 2.00 0.5913 0.6701 

1.312 2.00 2.00 0.5959 0.6240 

1.315 2.00 2.00 0.5986 0.7142 

1.318 2.00 2.00 0.5665 0.6175 

1.321 2.00 2.00 0.5437 0.6711 

1.324 2.00 2.00 0.5640 0.6328 

1.327 2.00 2.00 0.5715 0.7126 

1.330 2.00 2.00 0.5614 0.6501 

1.333 2.00 2.00 0.5665 0.6568 

1.336 2.00 2.00 0.5616 0.5812 

1.339 2.00 2.00 0.5541 0.7039 

1.342 2.00 2.00 0.5274 0.6828 

1.345 2.00 2.00 0.5266 0.6405 

1.348 2.00 2.00 0.5720 0.6657 

1.351 2.00 2.00 0.5301 0.6129 

1.354 2.00 2.00 0.5938 0.7110 

1.357 2.00 2.00 0.5940 0.6009 

1.360 2.00 2.00 0.5928 0.6671 

1.364 2.00 2.00 0.5596 0.7059 

1.367 2.00 2.00 0.5613 0.6778 

1.370 2.00 2.00 0.5577 0.6711 

1.373 2.00 2.00 0.5513 0.6084 

1.376 2.00 2.00 0.5234 0.7187 

1.379 2.00 2.00 0.5350 0.6761 

1.382 2.00 2.00 0.6017 0.6708 

1.385 2.00 2.00 0.5971 0.6970 

1.388 2.00 2.00 0.5887 0.7228 

1.391 2.00 2.00 0.5840 0.6568 

1.394 2.00 2.00 0.5851 0.6669 

1.397 2.00 2.00 0.5405 0.6160 

1.400 2.00 2.00 0.5664 0.7002 

1.403 2.00 2.00 0.5624 0.6373 

1.406 2.00 2.00 0.5741 0.6635 

1.409 2.00 2.00 0.5610 0.6610 

1.412 2.00 2.00 0.5630 0.6260 

1.415 2.00 2.00 0.5584 0.7143 

1.418 2.00 2.00 0.5468 0.6544 

1.421 2.00 2.00 0.5847 0.6662 

1.424 2.00 2.00 0.5579 0.5906 

1.427 2.00 2.00 0.5795 0.7140 

1.430 2.00 2.00 0.5922 0.6411 

1.434 2.00 2.00 0.5694 0.7168 

1.437 2.00 2.00 0.5571 0.6998 

1.440 2.00 2.00 0.5583 0.6515 

1.443 2.00 2.00 0.5574 0.6808 

1.446 2.00 2.00 0.5598 0.6153 

1.449 2.00 2.00 0.5909 0.7078 

1.452 2.00 2.00 0.5470 0.6501 

1.455 2.00 2.00 0.5778 0.6619 

1.458 2.00 2.00 0.5970 0.6164 

1.461 2.00 2.00 0.5961 0.7057 

1.464 2.00 2.00 0.5960 0.6123 

1.467 2.00 2.00 0.5974 0.6660 

1.470 2.00 2.00 0.5673 0.6679 

1.473 2.00 2.00 0.5742 0.6982 

1.476 2.00 2.00 0.6237 0.7223 

1.479 2.00 2.00 0.5647 0.6604 

1.482 2.00 2.00 0.5544 0.6732 

1.485 2.00 2.00 0.5557 0.6238 

1.488 2.00 2.00 0.5510 0.7142 

1.491 2.00 2.00 0.5540 0.6522 

1.494 2.00 2.00 0.5818 0.6760 

1.497 2.00 2.00 0.5820 0.6182 

1.500 2.00 2.00 0.5710 0.7168 

1.503 2.00 2.00 0.5960 0.6000 

1.506 2.00 2.00 0.5965 0.6682 

1.509 2.00 2.00 0.6013 0.6106 

1.512 2.00 2.00 0.6040 0.7150 

1.515 2.00 2.00 0.5792 0.6926 

1.518 2.00 2.00 0.5953 0.6714 

1.521 2.00 2.00 0.5609 0.6479 

1.524 2.00 2.00 0.5640 0.7129 

1.527 2.00 2.00 0.5614 0.6487 

1.530 2.00 2.00 0.5895 0.6795 

1.533 2.00 2.00 0.5751 0.6628 

1.536 2.00 2.00 0.5828 0.6205 

1.539 2.00 2.00 0.5943 0.7020 

1.542 2.00 2.00 0.5976 0.6825 

1.545 2.00 2.00 0.5968 0.6732 

1.548 2.00 2.00 0.6012 0.6104 

1.551 2.00 2.00 0.5904 0.7189 

1.554 2.00 2.00 0.5704 0.6761 

1.557 2.00 2.00 0.5461 0.6743 

1.560 2.00 2.00 0.5583 0.7013 

1.563 2.00 2.00 0.5605 0.7250 

1.566 2.00 2.00 0.5612 0.6600 

1.569 2.00 2.00 0.5667 0.6726 

1.572 2.00 2.00 0.5947 0.6217 

1.575 2.00 2.00 0.5557 0.7156 

1.578 2.00 2.00 0.5287 0.6514 

1.581 2.00 2.00 0.6010 0.6753 

1.584 2.00 2.00 0.6067 0.6203 

1.587 2.00 2.00 0.6085 0.7090 

1.590 2.00 2.00 0.5487 0.6034 

1.593 2.00 2.00 0.5704 0.6674 

1.596 2.00 2.00 0.5740 0.6147 

1.599 2.00 2.00 0.5636 0.7141 

1.602 2.00 2.00 0.5686 0.6891 

1.605 2.00 2.00 0.5642 0.6689 

1.608 2.00 2.00 0.5572 0.6457 

1.611 2.00 2.00 0.5303 0.7191 

1.614 2.00 2.00 0.5408 0.6689 

1.617 2.00 2.00 0.6085 0.5744 

1.620 2.00 2.00 0.6088 0.6686 

1.623 2.00 2.00 0.6046 0.6010 

1.626 2.00 2.00 0.5738 0.6960 

1.629 2.00 2.00 0.5775 0.6636 

1.632 2.00 2.00 0.5554 0.6585 

1.635 2.00 2.00 0.5713 0.6003 

1.638 2.00 2.00 0.5695 0.6391 

1.641 2.00 2.00 0.5688 0.7159 

1.644 2.00 2.00 0.5346 0.6484 

1.647 2.00 2.00 0.5470 0.6732 

1.650 2.00 2.00 0.5998 0.6213 

1.653 2.00 2.00 0.6094 0.7195 

1.656 2.00 2.00 0.6059 0.6596 

1.659 2.00 2.00 0.6055 0.6560 

1.662 2.00 2.00 0.5733 0.6121 

1.665 2.00 2.00 0.5559 0.7014 

1.668 2.00 2.00 0.5814 0.6353 

1.671 2.00 2.00 0.5676 0.6637 

1.674 2.00 2.00 0.5694 0.6635 

1.677 2.00 2.00 0.5672 0.6924 

1.680 2.00 2.00 0.5429 0.7144 

1.683 2.00 2.00 0.6010 0.6521 

1.687 2.00 2.00 0.5761 0.5899 

1.690 2.00 2.00 0.5529 0.6909 

1.693 2.00 2.00 0.5620 0.6376 

1.696 2.00 2.00 0.5688 0.6730 

1.699 2.00 2.00 0.5673 0.6231 

1.702 2.00 2.00 0.5785 0.7220 

1.705 2.00 2.00 0.5956 0.5753 

1.708 2.00 2.00 0.5556 0.6613 

1.711 2.00 2.00 0.5990 0.6157 

1.714 2.00 2.00 0.6022 0.7167 

1.717 2.00 2.00 0.6049 0.6775 

1.720 2.00 2.00 0.5927 0.6669 

1.723 2.00 2.00 0.5506 0.6042 

1.726 2.00 2.00 0.5737 0.7110 

1.729 2.00 2.00 0.5794 0.6635 

1.732 2.00 2.00 0.5702 0.6689 

1.735 2.00 2.00 0.5742 0.6960 

1.738 2.00 2.00 0.6039 0.6219 

1.741 2.00 2.00 0.5636 0.7241 

1.744 2.00 2.00 0.5358 0.6628 

1.747 2.00 2.00 0.6091 0.6723 

1.750 2.00 2.00 0.6152 0.6247 

1.753 2.00 2.00 0.6116 0.7149 

1.756 2.00 2.00 0.5485 0.6219 

1.759 2.00 2.00 0.5713 0.6723 

1.762 2.00 2.00 0.5753 0.6353 

1.765 2.00 2.00 0.5645 0.7194 

1.768 2.00 2.00 0.5703 0.6566 

1.771 2.00 2.00 0.5664 0.6671 

1.774 2.00 2.00 0.5584 0.5943 

1.777 2.00 2.00 0.5317 0.7157 

1.780 2.00 2.00 0.5424 0.6404 

1.783 2.00 2.00 0.6111 0.6750 

1.786 2.00 2.00 0.6086 0.6248 

1.789 2.00 2.00 0.6061 0.7233 

1.792 2.00 2.00 0.5731 0.5782 

1.795 2.00 2.00 0.5775 0.6727 

1.798 2.00 2.00 0.5566 0.6226 

1.801 2.00 2.00 0.5708 0.7199 

1.804 2.00 2.00 0.5676 0.6838 

1.807 2.00 2.00 0.5698 0.6780 

1.810 2.00 2.00 0.5333 0.6132 

1.813 2.00 2.00 0.5421 0.7230 

1.816 2.00 2.00 0.6121 0.6809 

1.819 2.00 2.00 0.6086 0.6781 

1.822 2.00 2.00 0.6088 0.7065 

1.825 2.00 2.00 0.5742 0.7293 

1.828 2.00 2.00 0.5801 0.6638 

1.831 2.00 2.00 0.5569 0.6798 

1.834 2.00 2.00 0.5684 0.6262 

1.837 2.00 2.00 0.5628 0.7221 

1.840 2.00 2.00 0.5645 0.6566 

1.843 2.00 2.00 0.5476 0.6813 

1.846 2.00 2.00 0.5411 0.6232 

1.849 2.00 2.00 0.5978 0.7232 

1.852 2.00 2.00 0.6063 0.6139 

1.855 2.00 2.00 0.6056 0.6765 

1.858 2.00 2.00 0.6042 0.6212 

1.861 2.00 2.00 0.6029 0.7270 

1.864 2.00 2.00 0.5560 0.6997 

1.867 2.00 2.00 0.5806 0.6804 

1.870 2.00 2.00 0.5791 0.6442 

1.873 2.00 2.00 0.5736 0.7152 

1.876 2.00 2.00 0.5717 0.6463 

1.879 2.00 2.00 0.5473 0.6708 

1.882 2.00 2.00 0.6091 0.6385 

1.885 2.00 2.00 0.5585 0.7302 

1.889 2.00 2.00 0.5572 0.6821 

1.892 2.00 2.00 0.5690 0.6292 

1.895 2.00 2.00 0.5740 0.7076 

1.898 2.00 2.00 0.5669 0.6580 

1.901 2.00 2.00 0.5835 0.6742 

1.904 2.00 2.00 0.6000 0.6144 

1.907 2.00 2.00 0.5599 0.7120 

1.910 2.00 2.00 0.6051 0.6060 

1.913 2.00 2.00 0.6064 0.6695 

1.916 2.00 2.00 0.6118 0.6161 

1.920 2.00 2.00 0.5642 0.6738 

1.923 2.00 2.00 0.5669 0.6268 

1.926 2.00 2.00 0.5930 0.7168 

1.929 2.00 2.00 0.5934 0.6222 

1.932 2.00 2.00 0.6079 0.6747 

1.935 2.00 2.00 0.6083 0.6395 

1.938 2.00 2.00 0.6080 0.7273 

1.941 2.00 2.00 0.6365 0.6669 

1.944 2.00 2.00 0.6122 0.6757 

1.947 2.00 2.00 0.5706 0.6008 

1.950 2.00 2.00 0.5711 0.7236 

1.953 2.00 2.00 0.5679 0.6458 

1.956 2.00 2.00 0.5713 0.6822 

1.959 2.00 2.00 0.6018 0.6313 

1.963 2.00 2.00 0.5602 0.6792 

1.966 2.00 2.00 0.5852 0.6839 

1.969 2.00 2.00 0.5728 0.7309 

1.972 2.00 2.00 0.5722 0.6685 

1.975 2.00 2.00 0.5717 0.6825 

1.978 2.00 2.00 0.5458 0.6258 

1.981 2.00 2.00 0.6008 0.7233 

1.984 2.00 2.00 0.6077 0.6581 

1.987 2.00 2.00 0.6058 0.6804 

1.990 2.00 2.00 0.6054 0.6226 

1.993 2.00 2.00 0.5923 0.7212 

1.996 2.00 2.00 0.5560 0.6096 

1.999 2.00 2.00 0.5834 0.6757 

2.002 2.00 2.00 0.5731 0.6192 

2.005 2.00 2.00 0.5793 0.7237 

2.008 2.00 2.00 0.5742 0.6983 

2.011 2.00 2.00 0.5486 0.6779 

2.014 2.00 2.00 0.6115 0.6543 

2.017 2.00 2.00 0.6143 0.7290 

2.020 2.00 2.00 0.6115 0.6500 

2.023 2.00 2.00 0.6122 0.6829 

2.026 2.00 2.00 0.5843 0.6303 

2.029 2.00 2.00 0.5632 0.7281 

2.032 2.00 2.00 0.5786 0.6691 

2.035 2.00 2.00 0.5708 0.6807 

2.038 2.00 2.00 0.5686 0.6316 

2.041 2.00 2.00 0.5540 0.7232 

2.044 2.00 2.00 0.5433 0.6280 

2.047 2.00 2.00 0.6024 0.6786 

2.050 2.00 2.00 0.6177 0.6428 

2.053 2.00 2.00 0.6196 0.7314 

2.056 0.00 0.00 0.6113 0.6595 

2.059 0.00 0.00 0.5379 0.6287 

2.062 0.00 0.00 0.5355 0.5808 

2.065 0.00 0.00 0.4798 0.5422 

2.068 0.00 0.00 0.4367 0.5014 

2.071 0.00 0.00 0.3905 0.4519 

2.074 0.00 0.00 0.3753 0.4089 

2.077 0.00 0.00 0.3650 0.4216 

2.080 0.00 0.00 0.3180 0.3699 

2.083 0.00 0.00 0.3158 0.3248 

2.086 0.00 0.00 0.2689 0.2849 

2.089 0.00 0.00 0.2724 0.2777 

2.092 0.00 0.00 0.2246 0.2455 

2.095 0.00 0.00 0.2184 0.1980 

2.098 0.00 0.00 0.2048 0.2246 

2.101 0.00 0.00 0.1747 0.2179 

2.104 0.00 0.00 0.1755 0.1671 


After changing the sample time to 0.03 I get this step response.

enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ How did you create data? I'm asking because it looks like tfest doesn't get the correct information concerning the sampling instants. $\endgroup$
    – Matt L.
    Feb 26 at 12:05
  • $\begingroup$ @MattL. I edited the question adding my code and my data, which was contained in a text file. Unfortunately I can't post the file here, so I just copied and pasted the numbers. $\endgroup$
    – Carl
    Feb 26 at 12:19
  • 2
    $\begingroup$ It looks like your sampling interval is $0.003$, but you specify Ts=0.05 in your call to iddata. That would explain the time stretch in the step response. $\endgroup$
    – Matt L.
    Feb 26 at 12:32
  • $\begingroup$ @MattL. Thank you! Yeah that really did reduce the time for it to reach the actual value. However, it still takes the step response 1s to reach 0.3m/s, is there anything I can do to make the fit better, or is that the best I can do, do you think? $\endgroup$
    – Carl
    Feb 26 at 15:00
  • $\begingroup$ @MattL. By the way, if you want to make an answer with your comment I would be more than happy to accept it. $\endgroup$
    – Carl
    Feb 27 at 16:02
6
$\begingroup$

In your original code you defined the sampling interval to be $T_s=0.05$ (idd1 = iddata(ddout, ddin, 0.05);). Yet, according to the data file, the time step between sample points appears to be $T_s=0.003$. Changing $T_s$ from $0.5$ to $0.003$ should compress the step response by a factor of $0.05/0.003=16.67$, which compares favorably to the relation between the actual rise time and the one predicted by the model (with the wrong $T_s$).

In your updated model you seem to have changed the sampling interval to $T_s=0.03$, which is still a factor $10$ too large (unless there's a typo in the sentence above the last figure). Note that you need to specify $T_s=0.003$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.