Benutzer-Werkzeuge

Webseiten-Werkzeuge


realtime_control_environment_setup

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
realtime_control_environment_setup [24.07.2019 17:58] – [Host-target ethernet link setup] Guoping Zhaorealtime_control_environment_setup [27.11.2022 22:58] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 ====== Realtime control environment setup ====== ====== Realtime control environment setup ======
 +
 +**Author**: Guoping Zhao, Lauflabor (www.lauflabor.de), TU Darmstadt, Germany
 +
 +**Date**: July, 2019
 +
 +----
  
 There are lots of different ways to set up a realtime control environment for a robotic system. Here, we choose **Matlab simulink realtime toolbox** (xPC) as the software framework because:  There are lots of different ways to set up a realtime control environment for a robotic system. Here, we choose **Matlab simulink realtime toolbox** (xPC) as the software framework because: 
Zeile 151: Zeile 157:
  
  
-Inserted the bootable usb flash drive to the target. Boot the target from the usb stick. Then the target should run with Matlab xPC realtime kernel. If your target has a monitor, you should see something like this:  +1. Inserted the bootable usb flash drive to the target. Boot the target from the usb stick. Then the target should run with Matlab xPC realtime kernel. If your target has a monitor, you should see something like this:  
-!{width480px}xpc-startupscreen.jpg!+ 
 +{{:xpc-startupscreen.jpg?600|}} 
 Check your host-target communication settings in the right-bottom corner:  Check your host-target communication settings in the right-bottom corner: 
-!{width480px}xpc-startupscreen-info.jpg! + 
-Make sure they are correct.  +{{:xpc-startupscreen-info.jpg?600|}} 
-For testing the configuration, run  + 
-<pre> + 
-slrttest +Make sure they are the same as what you configured.  
-</pre> + 
-in the Matlab command window of the host. If all your setup is correct, you should get something like this:  +2. For testing the configuration, run  
-<pre> + 
-### Simulink Real-Time Test Suite  +  slrttest 
-### Host-Target interface is: TCP/IP (Ethernet) + 
-### Test 1, Ping target computer 'TargetPC1' using system ping: ... OK +in the Matlab command window (host PC). If all your setup is correct, you should get something like this:  
-### Test 2, Ping target computer 'TargetPC1' using SLRTPINGTARGET: ... OK + 
-### Test 3, Software reboot the target computer 'TargetPC1': ................. OK +  ### Simulink Real-Time Test Suite  
-### Test 4, Build and download a Simulink Real-Time application using model xpcosc to target computer 'TargetPC1': ... OK +  ### Host-Target interface is: TCP/IP (Ethernet) 
-### Test 5, Check host-target command communications with 'TargetPC1': ... OK +  ### Test 1, Ping target computer 'TargetPC1' using system ping: ... OK 
-### Test 6, Download a pre-built Simulink Real-Time application to target computer 'TargetPC1': ... OK +  ### Test 2, Ping target computer 'TargetPC1' using SLRTPINGTARGET: ... OK 
-### Test 7, Execute the Simulink Real-Time application for 0.2s: ... OK +  ### Test 3, Software reboot the target computer 'TargetPC1': ................. OK 
-### Test 8, Upload logged data and compare with simulation results: ... OK +  ### Test 4, Build and download a Simulink Real-Time application using model xpcosc to target computer 'TargetPC1': ... OK 
-### Test Suite successfully finished +  ### Test 5, Check host-target command communications with 'TargetPC1': ... OK 
-</pre>+  ### Test 6, Download a pre-built Simulink Real-Time application to target computer 'TargetPC1': ... OK 
 +  ### Test 7, Execute the Simulink Real-Time application for 0.2s: ... OK 
 +  ### Test 8, Upload logged data and compare with simulation results: ... OK 
 +  ### Test Suite successfully finished 
  
 ==== EtherCAT slave configuration ==== ==== EtherCAT slave configuration ====
  
 +This part is well documented by Mathworks. Please find the detailed info [[https://www.mathworks.com/help/xpc/ug/generate-eni-files-for-ethercat-devices.html|here]]. 
 +
 +
 +===== Run Simulink in Realtime =====
 +
 +In order to run the simulink in realtime (on the target machine) with EtherCAT, the EtherCAT Init block is needed. The configure file, PCI bus number, and the PCI slot number has to be configured correctly according to the setup. 
 +
 +{{:ethercatinitblock.png?500|}}
 +
 +In addition, the solver of the simulink model has to be configured as "Fixed-step" and "discrete". The "fixed-step size" has to be configured the same as the EtherCAT communication frequency. E.g. 0.001 denote 1kHz control frequency. 
  
-* Connect EtherCAT slave to your host computer with ethernet cable.  +{{:simulinkmodelconfig2.png?800|}}
-* Open ET9000 software.+
  
-h2Test xPC with EtherCAT+And the "System target file" in the "Code Generation" has to be configured as "slrt.tlc"
  
-h3. Demo1Digital IO+{{:simulinkmodelconfig1.png?800|}}
  
-!simulinkmodelconfig1.png! 
  
-!simulinkmodelconfig2.png! 
  
-!ethercatinitblock.png! 
  
-h3. Demo2: Analog IO 
  
-h3. Demo3: Motor Current Control 
  
realtime_control_environment_setup.1563983914.txt.gz · Zuletzt geändert: 27.11.2022 22:56 (Externe Bearbeitung)


Warning: Undefined variable $orig_id in /is/htdocs/wp1019470_OPI92FFHXV/www/wikiLehre/lib/plugins/openas/action.php on line 232