Home
User`s Manual for µLab 3
Contents
1. Figure 5 5 Click Create new Debug Instruction to add a new De bug Instruction O Trace RAM variable state monitor lt gt sS a 1 Trace RAM variable ADCIBUFO z 2 2 Trace RAM variable ADC1BUF2 z a 3 3 Trace RAM variable ADCIBUF3 El 4 Trace RAM variable PDC1 5 Trace RAM variable ParkParm qAngle a 6 Trace RAM variable ParkParm gld 2 e 7 Trace RAM variable ParkParm qIq T E 8 Trace RAM variable MotorParm EndSpeed_LOW E El 9 Trace RAM variable MotorParm EndSpeed HIGH Lt 3 10 Trace RAM variable MotorParm Startup Ramp HIGH 11 Trace RAM variable MotorParm Startup_Ramp LOW 12 Trace RAM variable smci Qmega 13 Trace RAM variable smcl QmegaFltred 14 Trace RAM variable CtrlParm qVelRef saunpazoid Bngeq il 15 Trace RAM variable SVGenParm iPWMPeriod 16 when 1 0 Do nothing timeout 999 9 secs Stop the simulation E 4 T a Figure 5 6 Click the arrow buttons to move a Debug Instruction up or down the list Chapter 6 Test Sequences Design Use the navigation bar from the main pLab dashboard to access the Test Sequences View sec 2 5 4 it allows the user to create and delete Test Sequences and edit their contents Its structure is shown in Figure 6 1 6 1 Creating a new Test Sequence From the Test Sequences page click the Create new test sequence button input the name of the new test sequence and press OK
2. n 3 E E S python PWM startup ramp simulation 0 python PWM simulation 2 Figure 7 18 Docs simulation view the Test Reports tab 7 6 1 Reports Manager The layout of the Reports Manager is composed of two parts e on the left the list of the Test Reports stored in the active test bench e on the right the Test Report editor Reports can be opened in the editor by double clicking their name on the list 114 Co Simulations run groups instead can be expanded or collapsed by double clicking them Right clicking the tab of a Report in the editor shows a pop up menu you can use to close that report close all of the other reports or close all of the open reports Select a Report on the list and click the Delete button to delete the selected Report Click the Search Reports button to open the advanced search tools window 7 6 2 Text search tools The pLab Reports Manager provides you with two text search tools You may search for a string in the currently active Report by using the Search text field at the bottom of the Report panel Any text matching the specified string will be then highlighted in the ac tive Report and the editor will scroll to show the first match instance If you need to search for a string in all of the Reports stored in the active testbench without opening every single one of them in the edi tor open the advanced search tools window by clicking the Search Re port
3. 37 ZOO Daa kia tee aa Ge eed ses go settles a a 37 2 4 The Tool bar for the Simulation View 38 Simulation buttons 38 29 Theman pan sisira tb tee ek OS AA 39 Zyl Mac MEW nara ra Steen ees 39 Graphi pane ada 40 MODANG sued ee a EL 41 2 5 2 Project Dictionaries view 45 2 5 3 Debug Procedures view 004 46 2 574 TesCSequences VIEW isso oa 47 223 0 Simulations VIEW re eaea naaa e 47 2O ThE StS Dak aueia ote a e ete Ss aad CA Ae E ee ae 49 201 LoCo o A A 49 20 2 Status MO e rr e ja o a te ele R 49 26 3 Memory Usage icon 2 244 be amp hee 50 2 7 NOtes and Reports rn o Be Ree Se 51 Zi Test REDONS kada da Mion AA 51 2 2 Working NOS rar Ee e 52 Machine Process Modelling 53 Sal o o S o re ded ane amp eh ee Ahem oe eS 53 3 1 1 Creatinganewtestbench 53 3 1 2 Loading an existing test bench 54 Sse COMPONEN S o See he ae Eee See ee 55 3 2 1 Component creation cera ed ae 55 322 MOE 2 AR ea Se 55 3 2 3 Numerical model anaa ee we OS SRS 56 Contents 5 4 7 3 2 3 1 Default Python model template 57 3 2 3 2 Constant Gain model template 57 3 2 3 3 LaTeX modeltemplate 58 3 2 3 4 Thermometer model template 59 3 2 3 5 Voltage Divider model template 59 3 2 3 6 Wave Generator model template 60 3 2 4 Parameters and variables 60 3 225 PinsandPUgS 224 2 amp 4
4. 2006004 y nor 4 00E00 H r 2 s 2 50E01 1 00E00 YA P GRECOP_PM 3 00E00 PRs ODEO 0 00 00 4 yA ae 2 25 01 S 1 PJ mM o e S 1 00 00 j 000500 amp 2 i P np z gt 1 00800 200801 2908007 P Md a T3 2 P M_dq amp fay 2 El 3 00 00 ia Pid 3 2 5 3 pasais 2 1 7561 4 00E00 P Mg 8 E 2 4 g 4 00E0 E P Temp_nom S 5 00E00 5 00E00 4 H Inverter 5 6 00E00 1 50601 V A dh MechanicalLoad 7 00 00 SB BDO Q dh Userinterface i 7 00E00 dh PowerSupply 8 00E00 1 25E01 y dk ntaa 9 00E00 8 00E00 External data 1 00E01 je 4 1 00E01 g 0E01 ie Va oC Mm g 14 20E01 1 00E01 NA J C vi 2 30E0 50E0 H H C vi 5 1 10E01 j a 40E0 z 1 50E01 5 00E00 1 20 01 1 60801 1 30 01 y 1 70E01 1 80E01 ps ES Shee 0 00 00 1 S0ED1 y y y v Time series share the same y axis E 1 60E01 A 1050 L 9 Each time series has its own y axis 0 00E00 1 00E 02 2 00E 02 3 00E 02 4 00E 02 5 00E 02 6 00E 02 7 00E 02 8 00E 02 9 00E 02 1 00E 01 Time s Resolution ms 0 000050 Y python PWM startup ramp simulation 0 python PWM simulation 2 Figure 7 11 The Chart view and goes all the way to the current instant you can zoom on a specific region by indicating it with the mouse pointer and scrolling with the wheel scroll up to zoom in scroll down to zoom out Note that the minimum zoom level is the original one click on the graph to automatically reset the zoom You can select the v
5. s Machine model Enabled 1 Test sequence 2 Test 3 Machine initial g Torque Default y configuration 57 MotorSupply Default v 4 Links activation status we ADC Default 54 5 Debug components PWM Default X 57 buttons Default y i OK Default x g estimates Default E currents Default y lt Back Next gt Start Cancel Figure 7 6 Configure the starting values of variables and parameters 104 7 1 4 Debug components Select which components you want to debug during the execution of the simulation select multiple components by pressing CTRL while click ing them Note that only the components that support debugging will be available for selection Co Simulations run l J Test debug wizard Debug components Select the components to debug UserInterface PowerSupply 1 Test sequen 2 Test O A 4 Links activation status als ds 5 Debug components MechanicalLoad 0 parameter s 1 variables s 4 parameter s 2 variables s 0 parameter s 3 variables s w_estimator 13 parameter s 16 variables s lt Bac k Start Cancel Figure 7 7 Select the components you want to debug by clicking them while pressing CTRL J Simulation breakpoints dialog Set the breakpoints Set the breakpoints in the code of each debugged component controller A Inverter Li Code 2 coding utf 8 2 Av SimNumerica 3 4 Th
6. Are you sure you want to continue connecting yes no yes Warning Permanently added mulab simnumerica com 91 121 241 253 RSA to the list of known hosts Diego mulab simnumerica com s password Permission denied please try again Diego mulab simnumerica com s password debian debian Figure 1 20 Folder transfer operation using scp command you if you are sure to connect with the host just reply yes and the server credentials will be saved for the future connections MOMO UNDER CONSTRUCTION Final touches 21 1 6 Final touches Now that you are able to setup a secure connection to the cloud server copy files and folders into it and start uLab there are some final touches you are likely interested to perform as well 1 6 1 Change password For example you may want to change your login password and your VNC password to something different than the ones you received from the administrator email This process is really fast and easy to perform so we highly encourage you to do so To change your user login password open a new terminal and type the passwd command as shown in Figure 1 21 E testlogin localhost File Edit View Search Terminal Help testlogin localhost passwd Changing password for user testlogin Changing password for testlogin current UNIX password New password Retype new password passwd all authentication tokens updated successfully testlogin localhost _ Fi
7. Lab User s Manual for Lab 3 the innovation will play forever SIVNUVIRRICA Contents 1 Getting Started 1 1 1 1 2 1 3 1 4 1 5 1 6 1 7 Register on the web site and activate your muLab account 3 Installing an ssh client putty and setting the remote con MECO 2 4 Fes a is oe od Bee a 4 L T Linux MaCusers nea aleta aa 8 Install VNC viewer and connect to your remote desktop SESSION wi is A we Oe Moe eee 9 US TL Lo MaCusers 2 2220 2 eGo Bees eS 13 RU EDS Labs aaa cade sio Hed OE es 15 Copying your files into your Lab remote account space 17 LST cEnmux Macusels nero dd 20 EMaltouches aora ata da ts a le 21 1 6 1 Change password 000000 21 1 6 2 Change desktop resolution 23 MPLAB X issues ra ta ee 24 1 7 1 MPLAB XIDE project setup 24 1 7 2 Error Cannot start communication server 29 1 7 3 Warning muLab MPLABX plugin detected that 26 2 Interface Overview 27 21 THE Men D i s 22 2k es a ta Bee SA 29 2 1 1 Filemenu aaa a he ee ed 29 2 12 Machine menu 31 Contents 2 1 3 Debug procedures menu 33 2 1 4 TESUSEQUENCES MEN sos a My wl ee e A 34 2 1 5 Simulagon Men is Se Be RAS a Sia SOR 35 2167 CINES xo Sade E A 36 222 OS TOOLDAE 4 Suda a ci a Dd eS ke 37 2 3 The Tool bar for the Machine View 37 Test bench buttons 37 Machine buttons
8. etm Figure 6 10 Click Create new Test to add a new Test in the Test Se quence TL prova cambio Ts 4 Y 2 test s Duration 5 0 sec s Sampling period 0 0050 sec s Main debug procedure dummy 4 z POT costante 5 9 test s Duration 5 0 sec s Sampling period 0 0010 sec s Main debug procedure dummy 3 EL JA gradino LE 1 test s Duration 0 4 sec s Sampling period 0 0020 sec s Main debug procedure dummy a ae e pora L 7 1 test s Duration 2 5 sec s Sampling period 0 0010 sec s Main debug procedure dummy E sinusoide 3 Duration 1 0 sec s Sampling period 0 0010 sec s Main debug procedure dummy T a python El Duration 10 0 sec s Sampling period 5 0E 5 sec s Main debug procedure void 7 python PWM startup ramp am Duration 1 5 sec s Sampling period 5 0E 5 sec s Main debug procedure void o 5 python PWM estimator startup ramp 5 Duration 10 0 sec s Sampling period 5 0E 5 sec s Main debug procedure void g a S g g Pi i Figure 6 11 Click the arrow buttons to move a Test up or down the list 98 Test Sequences Design Chapter 7 Co Simulations run Use the navigation bar from the main uLab dashboard to access the Simulation View sec 2 5 5 it allows the user to monitor the running Tests interactively and to do some post processing Its structure is pop ulate
9. igebra_FILLED pdf Y example_MicrochipM ebra_FILLED synctex gz example_MicrochipM r ebra_FILLED tex El example_MicrochipM ocul Y example_MicrochipM example_Lorentz log example_MicrochipM A F example_Lorentz pdf Y example_MicrochipM Computer gt A Nome file example_Lorentz tex amnis Network Tipofie abla Annutia Figure 3 13 LaTeX component solver file chooser 3 2 3 6 Wave Generator model template TODO DESCRIPTION 3 2 4 Parameters and variables The third step of the wizard lets you set up parameters and variables of your new component Within each component parameters and variables are uniquely iden tified by their name Components 61 uLab lets you use the same name for a parameter and a variable in the same component or for more than one parameter or variable as long as each of them belongs to a different component however preserving name uniqueness when possible always remains a good practice You may also add a mnemonic symbol and a brief description To complete the setup of a parameter you have to provide its value defaults to zero and its unit of measurement defaults to adimensional Likewise to complete the setup of a variable you have to provide its type Input Output or State its initial value defaults to zero its unit of measurement defaults to adimensional and its resolution as shown in Figure 3 14 If the component model has been created from a L
10. Log Out root Shut Down 7 Desktop Effects El Change screen resolution ean Keyboard Sup Keyboard Shortcuts gt Mouse Z Network Connections C Mirror screens Detect Monitors GF Network Proxy Monitor Unknown Ea Personal File Sharing Power Management Resolution 1024x768 lt amp Preferred Applications Refresh rate 60 Hz c Rotation Normal lt Remote Desktop on E Screensaver Panel icon Software Updates 6 Sound Apply Ml raton Annlientian O Show displays in panel Figure 1 23 Change desktop resolution 24 Getting Started 1 7 MPLAB X issues There are a few issues that an MPLAB X user must keep in mind when doing co simulations with pLab 1 7 1 MPLAB X IDE project setup In order to perform a successful co simulation session you need to prop erly set up your MPLAB X IDE project as we will immediately show First your project must be compiled with the new toolchains pro vided by Microchip along with MPLAB X IDE that is XC8 16 32 compilers if you import an older project that has been devel oped with MPLAB IDE V8 or previous versions re member to change the compiler from mpasm or C18 30 one of its new counterpart otherwise the plugin will misbehave and the co simulation will not take place In addition to the compiler you also need to choose the right Hard ware Tool for the project you want to test In fact u
11. theta omega PWM1H PWM2H PWM3H V_ia V_ib SpeedDem A control_algo py main control_algo PWM1H PWM1L PWM2H PWM2L PWM3H PWM3L omega fe A control_algo_co main control_algo V_ia V_ib theta omega PWM1H PWM2H PWM3H run stop b control_algo_co main control_algo V_ia V_ib PWM1H PWM2H PWM3H run stop button Speed control_algo_co main C com SimNume Figure 4 4 An example of a dictionary of runtime firmware subroutines substitutions In order to e create a new substitution press the leftmost button a new item appears as a blue table row then click on the cells from the left to choose the alias of the firmware function to be substituted see Fig 4 5 the arguments that could be passed to this firmware sub routine Fig 4 6 possible arguments are items of the Dic tionary of firmware variables sec 4 1 items of the Dictio nary of the processors I O signals and model parameters sec 3 2 4 the python module containing the function that substitutes the firmware subroutine 4 7 and the python function itself by writing its name in the text field Dictionary of runtime firmware subroutines substitutions 75 e create a substitution from a LaTeX file press the second button from left and then submit the file selected through a standard file chooser e edit the python module select a substitution table row and press the third button from the left e delete a substit
12. 6 component KEY COMPONENT PARAMETERS parameters Parameters and Variables pa 1 ontext 5 Pins and Plugs j context KEY_SIMULATION_ID simulationId 11 context KEY GLOBAL TIME globalTime cont od Run success X 21 cont exte ax ee lt No output gt 25 So 126 solv To test this model outside e mulab simply modify the test f 0 launch this script as any other python executable script if _ name _ 32 test y ul _main_ Check syntax J m Run module CHECKOUT_DIRS mulab core 3 0 sampleTestBench Test_Adapters_da_svn yo py 4 Save l lt Back jl Next gt Ji Finish i Cancel Figure 3 11 Python component solver test routine run success which will produce a success pop up as in Figure 3 9 3 2 3 4 Thermometer model template DESCRIPTION 3 2 3 5 Voltage Divider model template DESCRIPTION 60 Machine Process Modelling Python model generator x nx Latex model A model for a component described by Latex Generate Cancel Figure 3 12 LaTeX component solver setup L Python model generator ES unx Latex model A model for a compo SJ Apri eS CfL current y B example_input_output tex Y example_Lorentz synd xample_linear_al Igebra pdf example_Lorentz tex example_Lorentz_FILU ebra_FILLED aux example_lorenz ipynk ebra_FILLED log example_MicrochipM
13. Apri s e gt E mx A Tipo file Tutti ifile D labo m r Figure 4 7 Select the python file with the standard chooser of the OS 4 5 Dictionary of firmware implementations In order to create modify or delete a firmware implementation use the panel and the buttons indicated in Figure 4 8 The editor of a firmware implementation is shown in Figure 4 9 and the editor of a firmware vari able subroutine binding is shown in Figure 4 10 Dictionary of external data files 77 Firmware implementations AN1078 control_algo_prototype python_algo_PWM python_algo_con_PWM_e_startup_ramp python_algo_con_PWM_e_startup_ramp_e_stimatore Figure 4 8 Here it is the list of firmware implementations existing in the project at the left bottom there are three buttons to create modify or delete the selected implementation 4 6 Dictionary of external data files In order to create modify or delete a reference to an external datafile use the panel and the buttons indicated in Figure 4 11 The editor is shown in Figure 4 14 4 7 Dictionary of post process scripts In order to create modify or delete a postprocessing script use the panel and the buttons indicated in Figure 4 13 The editor is shown in Figure 4 14 78 Project Dictionaries Design l Firmware implementation configuration editor X Name AN1078 Project dir 3_dsPIC33EP256MC506_INTOPAMP_MCLV2_HURST PMSM X m Load firmware symbols Compiler in use Def
14. Stop the simulation v a del D E a gt o J a T mn o ta ue Q A D a E oO wo sanuanbas 358 1 a J Debug procedure editor Name void uoenu s Figure 5 3 Select a Debug Procedure and click Edit Procedure to re name it to configure debug instructions Rearranging the Debug Instruction list 87 A TN 1 Trace RAM variable sum iq void 4 instruction s 2 Trace RAM variable sum w 3 when 1 0 Do nothing timeout 999 9 secs Stop the simulation JAPOW aulypew d secuanbas 358 sainpasoid nqaq A salJeuoy1p yafo d B Confirm deletion eS O Are you sure you want to delete the debug procedure s selected L a Jl we u0ye nuls Figure 5 4 Select a Debug Procedure and click Remove Procedure to remove it from the list 5 5 Rearranging the Debug Instruction list You can use the up and down buttons to move up or down by one step a debug instruction Debug instruction fulfilling their activation and execution conditions will be performed in this order 88 Debug Procedures Design L Instruction editor x Comment Activation condition press Ctrl Space for hints Execution condition press Ctrl Space for hints Timeout When the Execution condition is verified Otherwise at timeout Trace RAM variable v and report Variable 7 smc1 Omega Y
15. about cre ating embedded platforms New link setup a connection between two existing items See also 3 4 for detailed instructions about links Edit edit the properties of the selected item Remove remove the selected item from your machine Group create a group containing the selected items See also 3 5 for more instructions about groups 32 Interface Overview Ungroup remove the selected group relation between items without removing the items from the machine See also 3 5 for more in structions about groups The menu bar 33 2 1 3 Debug procedures menu SimNumerica pLab 2010 File Machine MA Test sequences Simulation Working notes Reports Help Sch M gt o0O E L H MB New debug procedure 7 ri Machine mask e lt No machine mask gt 5 a embedde lt No formula ava Figure 2 4 The Debug Procedures menu The debug procedures menu figure 2 4 lets you create edit and re move debug procedures For more info about debug procedures see Chapter 5 New debug procedure start the creation of anew debug procedure See also 5 1 Edit debug procedure modify the properties of an existing debug pro cedure See also 5 4 for editing individual debug instructions Remove debug procedure delete the selected debug procedure See also 5 3 Interface Overview 34 2 1 4 Test sequences menu SimNumerica pLab 2010 File Machine Debug procedure MESA TAI Simulation Working n
16. doe ve tee a 61 3 207 Post creation editing aia Bee Sea Rw 62 3 3 Embedded Platforms cca ae ee a s a Goes 62 3 3 1 Embedded Platform creation 62 Joc PINO brasa Le eee eR ae es 63 3 3 21 Glock HequenCy 4 0 x ads 824 4 aes 64 3 322 Mp t volage sida Boots eee 64 3 3 2 3 Input Output frequency modulated pulse THAN RA o 64 3 3 2 4 Input Output width modulated pulse train 64 3 3 2 5 Input Output bitstream 65 O DEVICE DIM EA 65 3 30 PIES aro a il 65 3 3 4 Post creation editing 65 SUL KS AA A AA oe ee 65 eo GROUNDS A a a o A 68 4 Project Dictionaries Design 71 4 1 Dictionary of firmware variables subroutines 72 4 2 Dictionary of processor I O signals de 4 3 Dictionary of processor implementations 73 4 4 Dictionary of runtime firmware subroutines substitutions 74 4 5 Dictionary of firmware implementations 76 4 6 Dictionary of external datafiles 77 Dictionary of post process scripts 77 Debug Procedures Design Creating a Debug Procedure Renaming a Debug Procedure Deleting a Debug Procedure Creating Editing Deleting a Debug Instruction Rearranging the Debug Instruction list Test Sequences Design Creating a new Test Sequence Renaming a Test Sequence Deleting a test sequence Copy Paste a test sequence Creating Editing Deleting a new Test Rearranging the Test list Co Simulations run 7 1 S
17. g 1073 1074 fault enabled 1075 FCLCON1 0x005C Fault enabled Fault SRC Comparator 4 0 P 1076 gt I E 1077 FCLCON3 0x005C Fault enabled Fault SRC Comparator 4 O 1078 2 1079 Li Initial Current offsets E 3 00000000 0742336000000000 ACCAH 0000000000000000 ACCAL 0000000000000000 ACCAU 0000000000000000 B 00000000 ACCBH 0000000000000000 ACCBL 0000000000000000 ACCBU 0000000000000000 CompVdq 0742336000000000 00001072 CtriParm 0000000000000000 DATA_BITS FFFFFFFFFFFFFFFF FdWeakParm FFFFFFBB00000000 MeasCurrParm 0000400000004000 00001050 MotorParm FFFFFFFFFF890064 N FFFFFFO742336000 PIParmD FFA4066600000000 PlParmQ FFA4066600000000 000010F4 PIParmW FFFFFFCD00000000 ParkParm 0000000000000000 RTDMFlags 0000000000000000 RTDMNumBytes FFFFFFFFFFFFO742 00000010 RTDMPacketBuf 0000000000000000 IRTDMProcessMsgsTemp1 0000000000010000 RTDMProcessMsgsTemp2 0000000000000001 RTDMRxBuffer 0000000000000000 0000112E RTDMRxBufferendMsgPointer 0000000000000000 RTDMRxBufferStartMsgPointer 0000000000000000 IRTDM_UART_MODE_VALUE 0000000000000000 RTDM_UART_STA_VALUE 0000000000000000 00001130 _ RTDMcrcTemp 0000000000000000 RTDMcrcTempH 0000000000000000 RTDMcrcTempL 0000000000000000 IRTDMpu32AddressTemp 0000000000000000 a Watch all memory Watch cells emos A searc routne stay Gente or si canine 9 python PWM startup ramp simulation 0 gt rampa simulation 1 Figure 7 16 Cli
18. platform square in the graph Foreground color the foreground color for the embed ded platform square in the graph Bounds the bounds of the embedded platform square in the graph 44 Interface Overview Border visible if toggled on shows the border of the embedded platform square in the graph e One link selected Model view shows link details connections wires Link details ID name description enabled if this op tion is toggled off the status of the link will not change during simulations MONOS CHE sIGNIFICA Connections two plug type name pairs describing source and target plugs connected by this link Wire a list of pin type initial value pair couples de scribing the pins and the initial values of the variables they carry connected by the wires of this link Graph view shows edge properties ID the link ID Font the font used for the link name in the graph Line style the line style for this link bezier orthogonal spline Line begin the style for the beginning of this link line none circle simple technical classic diamond line double line Line end the style for the ending of this link line none circle simple technical classic diamond line double line Line color the color of this link line in the graph Line width the width of this link line in the graph e More than one item selected Model view no properties to show Graph view no prope
19. this dialog again For this host v Remember password KWallet ok Cancel O Cancel Y y vnc localhost 5909 KRDC le File Session Bookmarks Settings Help n New Connection s 2 Full Screen Screenshot Q View Only t Local Cursor Por Grab Keys Remote Desktops 9 X a voles Places System amp E gt 7 4 Filter ws Accessories vnc localhost 5909 DS Graphics gt internet Sara men H Sound amp Video I System Tools gt RN Co Simulation software for physical systems governed by embedded controller devices Figure 1 14 KRDC with remote desktop active on user Diego Run pLab 15 1 4 Run pLab From the Applications menu located in the upper left side of the screen select the Programming submenu and launch pLab by clicking the uLab menu entry After a short time it will appear the pLab login interface as shown in Figure 1 15 enter your username and password and start using the Lab environment r Connect to your muLab accou oS Username Password Ok Cancel Figure 1 15 Lab login interface If you want to place a shortcut in the desktop instead just right click over Lab menu entry and select Add this launcher to desktop as shown in Figure 1 16 After the program has finished loading the main uLab dashboard will be shown see Cap 2 You can use it to access all of the pLab functions and tools upon be
20. will show up asking to trust our server You just need to answer Yes once in subsequent connection attempts that popup will not show again PuTTY Security Alert The server s host key is not cached in the registry You have no guarantee that the server is the computer you think it is The server s rsa2 key fingerprint is ssh rsa 2048 3c 2d 40 82 39 35 3019 04 61 ed c08 0b 4c fb f8 If you trust this host hit Yes to add the key to PuTTY s cache and carry on connecting If you want to carry on connecting just once without adding the key to the cache hit No If you do not trust this host hit Cancel to abandon the connection ee ete a Figure 1 4 Server trust request Once you trusted our server RSA key the command prompt will show up Enter your password the one you choose when you registered in the pLab registration page and you will see a command line prompt pointing at your home directory located inside the cloud server See Figure 1 5 as reference The command line is not the direct interface you will use in your work ing session But it activates the secure tunnelled connection that VNC will use to display the remote desktop which is the interface you will use to interact with uLab see sec 1 3 8 Getting Started Tleannr weername tA A i Figure 1 5 Successful connection to the remote server 1 2 1 Linux Mac users TO DO UNDER CONSTRUCTION Install VNC viewer and
21. 02750 s Working dir moTestBench demoAN1078_di_Paolo Data ki Chart Mi Animation a Debug 7 Post process Docs E Paramet ters Variables Memory Simulation mask E lo e 8 eE lt No mask selected gt v _ E 3 1 ull 5 s 2 015 ve 4 467902462809311 sum_id ull null GRECOP_PM 0 01129 T_load 0 0 N m lt No formula available gt la mm 7 EH controller T dh PMSM a V 2 V Va v V vb v El V vc Y E V la A V Ib a V V GRECOO_m Vid z Via ES V theta 3 V omega_m rpm 8 V theta_norm a P La E PET 1 PK PJ B P E P mad P M_dq al Pid g P Mq q P Temp_nom S 3 db Inverter 5 dh MechanicalLoad di Userinterfi di PowerSupply Ed w_estimator la al date e ell virtual sum_id 00000000 C virtual sum_ig 00000001 C virtual sum_w 00000002 Show values at time s Y python PWM startup ramp simulation 0 Y python PWM simulation 2 Figure 7 10 The data view is composed of two main sections on the left the data tables on the right the selection panes Select from the menu on the right the data you want to watch by clicking them hold CTRL while clicking to select multiple items The Data view shows the last value taken by the selected items spec ifying an instant in the text field on the right lets you see the values taken by the variables at that time This feature is only available in the data view and can only be used to show values at one given instant not during an interval The Data vie
22. 06 45 New note E 2011 01 25 16 06 45 New note B I u o Font a 35 This is a new note Bold text ftalicized text Underlined text Close Figure 2 19 The Notes manager The list on the left shows the available notes for the active test bench Click the New button to create a new note adding it to the list and open ing it in the editor or double click an existing list entry alternatively select it and press the Load button to open the corresponding note for editing See sec 7 7 for more details about Test Reports Chapter 3 Machine Process Modelling 3 1 Test bench A test bench is composed of the machine model the debug procedures and test sequences the firmware projects and the python substitutions the external data files the post processing scripts the working notes and the test reports This set of objects is stored in the files inside the test bench directory creating or loading a test bench basically means creating or loading such a set 3 1 1 Creating a new test bench To create a test bench select New test bench from the File menu A pop up window appears Figure 3 1 where you will be asked to indicate the name the author the image icon and the location on your hard drive of the new test bench you want to create Once the above information is provided you can click the Create tab and generate the test bench 94 Machine Process Modelling New t
23. 0E 02 1 50E 02 2 00E 02 2 50E 02 3 00E 02 3 50E 02 4 00E 02 4 50E 02 5 00E 02 5 50E 02 6 00E 02 6 50E 02 7 006 02 8 Time s Resolution ms 0 000050 Figure 7 1 The Test Simulation View 100 Co Simulations run 7 1 Starting Simulation In order to launch a Simulation you have to perform a few basic steps described in the following subsections 7 1 1 Test selection There are two ways to select a Test or a Test Sequence e From any view in pLab click the Launch Test or the Launch Test Sequence buttons Figure 7 2 to show the Test Sequence se lection screen Figure 7 3 Note that pressing the Launch Test Se quence button causes all of the contained Tests to be run one after another sequentially Moreover every test is unrelated from the others i e machine states don t carry over between two consecu tive tests nine LEDUg e 22 lt T nrova Figure 7 2 The Launch Test left and the Launch Test Sequence right buttons e From the Test Sequences View if a Test Sequence and eventually also a Test are selected in this view click the Launch Test or the Launch Test Sequence buttons the selection made will bypass the Test Sequence selection screen Figure 7 3 and bypass also the Test selection screen Figure 7 4 if also a Test is selected in this view or the Launch Test Sequence button has been pressed Starting Simulation Test sequence 1 Test sequence 2 Test 3 Machine initial configura
24. 14 10 40 27 10 12 2013 15 51 14 Default transfer settings 10 04 2012 01 29 04 07 03 2013 15 46 11 New and updated file s only Do not show this dialog box again Transfer on background add to transfer queue Transfer each file individually Tios E Ga a a m 0 Bof 12 430 KB in Oof 3 3 F6 Move ai F7 Create Directory X F8 Delete fF F9 Properties JL FLO Quit Figure 1 19 WinSCP folder upload to remote server 20 Getting Started 1 5 1 Linux Mac users If you are running any GNU Linux distribution you can copy any file and folder with the handy scp command It takes the following parame ters e the file or folder you need to transfer when transferring folders remember to add the r parameter to send the folder and its con tent recursively e the username in the cloud server hostname and destination folder absolute path where the file folder will be placed An example of transfer operation of folder firmware empty in that case executed by user Diego into his own remote Desktop folder is show in the figure below The first time you perform this operation scp will ask File Edit View Search Terminal Help debian debian scp r firmware Diego mulab simnumerica com home Diego Desktop The authenticity of host mulab simnumerica com 91 121 241 253 can t be established RSA key fingerprint is 3c 2d 40 e2 39 35 3c 19 04 e1 ed c8 9b 4c fb f8
25. ER LA SEZIONE The right section of the machine view consists of the Info pane Itis a panel whose contents depend on the current graph selection MONO DA METTERE IN FORMA DI TABELLA e No items selected Model view shows machine masks machine details parameters all variables all Machine masks lets you choose and setup machine masks Machine details ID name description of the machine Parameters a name value pair list of all of the parame ters in the machine components 42 Interface Overview Variables a name type initial value pair list of all of the variables in the machine components Graph view shows graph properties Grid visible toggle this to show a grid underneath the graph disabled by default Grid aspect the way the underlying graph grid is drawn crosses dots lines Grid color the color of the grid Grid size the size of the grid elements Background color the background color of the graph e One component selected Model view shows component details parameters variables plugs and pins Component details ID name description model file enabled if this option is toggled off the status of the component will not change during simulations MODO CHE SIGNIFICA Parameters a name value pair list of the component parameters Variables aname type initial value pair list of the com ponent variables Plugs and pins a list containing the component plugs eac
26. Lab needs to query MPLAB X IDE internal simulator about the register and pinout states therefore you have to choose the Simulator option as current Hardware Tool You can find both compiler and hardware tool options by right clicking the corresponding project listed in the Project panel An exam ple dialog is shown in figure 1 24 The last detail you need to take care of is setting the right frequency for the simulator ISee http www microchip com pagehandler en us family mplabx Com pilers section MPLAB X issues 25 x Project Properties PIN_updown msl Categories Configuration gt General a aes O Conf default Feu f Device gt Simulator EIl Families dsPIC33FI64GP706 x 2 Loading gt Libraries Supported Debug Header Supported Plugin Board gt Building 4 2 XC16 Global Options 2 xcl6 as p i Hardware Tool Compiler Toolchain 2 xcl gcc i xcl6 ld O Hardware Tools a 3 Compiler Toolchains 909 ICD 3 A5M30 None found 00 PICkit2 C30 None found 00 PICkit3 dsPIC Mone found O PM3 HI TECH DSPICC None found 90 Real ICE E 4 XC16 oo E 16 v1 11 C Program Filg 4 Microchip Starter Kits gt MCHY MICROSTICK 9 SKDE 33 AUDIO O SKDE Memory O SKDE PIC18FI O SKDE PIC24F 1 O SKDE PIC24H SENSOR 4 111 gt A m gt Tip double click on serial number SN to use a Friendly name FN instead Manage Configurations Figure 1 24 Project options NM Warning setting th
27. ND gt When you have done click the Generate button At this point see Figure 3 8 the Python code is ready to be checked by pressing the Check syntax button to eventually run its test routine by pressing the Run module button if you decided to code it and to save it ina file named lt component name gt py If the code verification process after pressing the Check syntax button succeeds you will see the pop up of Figure 3 9 otherwise you will see the pop up of Figure 3 10 Analogously if the run of the test routine after pressing the Run module button succeeds you will see the pop up of Figure 3 11 3 2 3 2 Constant Gain model template DOW DESCRIPTION o 58 Machine Process Modelling New component model os Numerical model Edit the numerical model Python model code New python model 1 Nam d Descripti ee 2 Model type 5 component KEY COMPONENT_VARIABLES variables 3 Numerical model 11 component KEY COMPONENI_PARAMETERS parameters 4 Parameters and Variabl context 5 Pi d Plug context KEY SIMULATION ID simulationId context KEY_GLOBAL_TIME lobalTime context KEY SAMPLING_PERIOD samplingPeriod context KEY_WORKING DIR workingDir ernal_data Solve solve component context external data To test m mulab simply modify f launch th p y pyth xecutable scrip f name E est r Check syntax m gt Run module CHECKOUT_DIRS mulab core 3 0 sa
28. NZA No validator registered for it simnumerica mulab model machine ComponentPin 10 29 45 pLab INFO Synchronizing with server 10 29 45 pLab INFO Synchronization completed l Figure 2 17 The Log console Clicking the Show Log Console icon opens up a display area for er rors warnings and informative messages regarding the operations be ing performed in uLab It is possible to copy part of the log con sole contents into the system clipboard by selecting the text you want to copy and then pressing ctrl c or right clicking on the text display area and selecting copy from the context menu If no text is selected the entire contents of the log console are copied 2 6 2 Status Info Any relevant status messages are shown here 50 Interface Overview 2 6 3 Memory Usage icon This bar shows how much memory is being used by the Java Virtual Ma chine Double clicking the Virtual Machine memory usage icon explicitly calls the Java Garbage Collector Notes and Reports 51 2 7 Notes and Reports You can open the Simulation Docs dialog through the Simulation menu This dialog lets you access the Notes and Reports panels 2 7 1 Test Reports You can specify annotations to be recorded during the execution of any debug instruction through the Debug Instruction Editor As soon as the simulation is over uLab saves these lines in a test report such files can be accessed and managed through the Report Manager See s
29. VNC configuration Connected to localhost 5906 Password eo D Ca Figure 1 9 VNC authentication 12 Getting Started a ed S as Amaia paa a amp Applications Places System amp e la Computer initialuser s Home 4 m Figure 1 10 VNC remote desktop For a better view you can expand the window to fit your screen the Lab GUI is designed for a full screen usage If you wish you can also set your VNC client to run in fullscreen mode In case of TightVNC the shortcut to toggle fullscreen mode on and off is CTRL SHIFT ALT F If you think you may forget that shortcut combina tion especially after a long session development you are encouraged to write it down This is be cause you wont be able to switch to another appli cation e g to read the PDF of this manual until you exit the fullscreen mode Install VNC viewer and connect to your remote desktop session 13 1 3 1 Linux Mac users To setup a successful connection to the remote desktop under Linux Mac you have to open your favourite terminal application and type in one single line ssh L lt port_number gt localhost lt port_number gt lt username gt mulab simnumerica com where lt port_number gt must be substituted with your actual port num ber the one you received by email and lt username gt of course by your username in the remote server In the example below we performed tunnelling o
30. V_ib theta omega PWM1H PWM2H PWM3H run stop b a control_algo_co main control_algo V_ia V_ib PWM1H PWM2H PWM3H run stop button SpeedD control_algo_co main J Choose the arguments Ctrl Space for hints L eS CtriParm qVelRef par_Inverter__Vdc V_overcurrent wx A Cos Cc Figure 4 6 Choose the arguments by typing them Ctr1 Space does the auto completion and press the circle buttons to add or delete an argument from the list press OK to confirm the selection list or cancel to discard it Firmware subroutine runtime substitutions with Python functions Firmware subroutine alias Arguments Fw variables and pins alias model params Python module Python function bypass_ADC ADC1BUFO ADC1BUF2 ADC1BUF3 SpeedDemand pot V_ia V A ADC py updateADCBUF control_algo theta omega PWM1H PWM2H PWM3H V_ia V_ib SpeedDem a control_algo py main control_algo PWM1H PWM1L PWM2H PWM2L PWM3H PWM3L omega the control_algo_co main control_algo V_ia V_ib theta omega PWM1H PWM2H PWM3H run stop b a control_algo_co main control_algo V_ia V_ib PWM1H PWM2H PWM3H run stop button SpeedD control_algo_co main C com SimNumet f H Apri Cerca in demoAN1078_di_Paolo X La powersupply pyc A wref py A userinterface py wref pyc La userinterface pyc A XXX py e w_estimator py XXX pyc B w_estimator pyc 4 Nome file w_estimator py
31. aTeX Parameters and Variables Specify component parameters and variables Parameters l lt Back Next gt Finish Cancel Figure 3 14 Model parameters and variables file see sec 3 2 3 3 also its parameters and variables are automatically created and you will find them in the tables of Figure 3 14 3 2 5 Pins and plugs The fourth step of the wizard lets you add plugs to your component Click on the New icon to create a new plug then specify its name and pins each pin can be associated to an I O variable the type of the pin 62 Machine Process Modelling FA oO 2 a o 3 ao o S a El 3 o a a eS 5 el type 3 Numerical model Ok Cancel lt Back J e Finish Cancel Figure 3 15 Click the New plug button to create a plug is the same of the variable you can add multiple pins to a plug and multiple plugs to a component 3 2 6 Post creation editing You may also modify the newly added component after the wizard has been completed to open the editor either double click the component icon on the graph or select it and click the Edit item in the Machine menu 3 3 Embedded Platforms 3 3 1 Embedded Platform creation To add a new Embedded Platform select New embedded platform from the Machine menu This opens up the wizard of Figure 3 16 input the name required and a brief description optional of the new embed ded platform then press Ne
32. ariables you want to be shown in a graph by click ing on their names in the selection panel press ctrl while clicking for multiple selection Two display modes for data series are supported one with a com mon y axis when viewing comparable data and one with separate y axes when the data you re viewing cannot be compared i e because of different units of measurement or different orders of magnitude If you want to save or print a graph right click the graph area and select Save 108 Co Simulations run rr model_type 4 mI p Time series share the same y axis Each time series has its own y axis Resolution ms 0 000050 Figure 7 12 Common and separate y axis modes buttons or Print from the context menu 7 3 3 Animation view This functionality is forthcoming This view lets you use the simulation data as input variables for a graphical animation Custom animations can be added to the built in set write the Java FX script that implements your animation oppor tunely binding its variables to the simulation parameters and place the script file in the test bench folder Data visualization 109 7 3 4 Debug view The debug view lets you modify breakpoints and watch variables pa rameters and memories while the simulation is running Click on a line Status details Running simulation loop Global time 0 102750s Working dir moTestBench demoAN1078_di_Paolo Data ki Chart Mi A
33. ations run 7 7 Working Notes Working Notes are automatically created during the execution of Simu lations Open the Simulation Docs window and click the Working Notes tab Status details Running simulation loop Global time 0 001000 s Working dir moTestBench demoAN1078_di_Paolo Data k Chart Animation 3 Debug Post process 8 Docs El Working notes amp Test reports Refresh New ij Save Rename sal Jeuonsip paload a Japow supe saunpazo d Bngaq A D LA a E 5 2 Ea 5 y python PWM startup ramp simulation 0 gt rampa simulation 1 Figure 7 19 Docs simulation view the Working Notes tab
34. ault v proce Firmware bindings for variables and subroutines ISPIC z state_monitor gt uGF UNSIGNED_SHORT PORTG gt PORTG UNSIGNED_CHAR PORTB gt PORTB UNSIGNED_SHORT ParkParm gt ParkParm UNSIGNED_SHORT ADC1BUFO gt ADC1BUFO UNSIGNED_SHORT AD1CON4 gt AD1CON4 UNSIGNED_SHORT TIMER3 gt TMR3 UNSIGNED_SHORT AD1CHSO gt AD1CHSO UNSIGNED_SHORT AD1CON2 gt AD1CON2 UNSIGNED_SHORT ADC1BUF2 gt ADC1BUF2 UNSIGNED_SHORT ReadADCParm qADValue gt ReadADCParm UNSIGNED_SHORT Y 4 TM LABEL6 dsPIC dsPIC33EP256MC506 Ok f Cancel Figure 4 9 The editor of a firmware implementation the user should specify a name the project dir he must press the Load firmware sym bols button choose the compiler and the processor implementation and the bindings with the variables and the subroutines implemented in the firmware project and corresponding to the dictionary items Dictionary of post process scripts 79 L Firmware implementation configuration editor Xi Name AN1078 Project dir 33EP256MC506_INTOPAMP_MCLV2_HURST PMSM X Load firmware symbols lJ Variable subroutine binding eS Compiler in use Alias Firmware bindings for variables and subrouti state_monitor gt uGF UNSIGNED_SHORT PORTG gt PORTG UNSIGNED_CHAR ParkParm PORTB gt PORTB UNSIGNED_SHORT ParkParm gt ParkParm UNSIGNED_SHORT ADC1BUFO gt ADC1BUFO UNSIGNED_SHORT ADICON4 gt AD1CON4 UNSIGNED_SHORT Na
35. ck the Memories button to watch variables Co simulation logs 7 4 Co simulation logs 111 112 Co Simulations run 7 5 Post Processing Status details Running simulation loop Global time 0 102750 s Working dir moTestBench demoAN1078_di_Paolo Data ki Chart El Animation a amp Debug 7 Post process Docs Active postprocessor e Python post processor z Jew p Fi Python editor for post processing scripts El Postprocess script E import numpy as np a from postprocess_util import 3 setPostprocessPath testBenchPostprocessPath 5 def process input output y El T Get input series a if False 3 x input vei OP_x E y input veicolo OP_y y print x 12 print x 1 len x print y ee plotFigure x 1 y 1 traiettoria 15 else o x np array 1 2 3 5 7 y np array 3 2 4 EME plotFigure x y traiettoria a 9 endif a ES amp a g a 8 m Execute script MO Reset code _ Add output dictionary to simulation model _ Add console output to test report S Output console a B a En amp E o python PWM startup ramp simulation 0 python PWM simulation 2 Figure 7 17 The Post Processing simulation view Test Reports 113 7 6 Test Reports Test Reports are automatically created during the execution of Simula tions Open the Simulation Docs window and click the Test Reports tab to access the Reports Manager
36. connect to your remote desktop session 9 1 3 Install VNC viewer and connect to your re mote desktop session Now you need to setup the application that will allow you to show the remote desktop and work on it as if you were sitting in front of the cloud server For this operation you have to install TightVNC freely available here Download and install it as you would do with any other application just remember not to install TightVNC Server because you only need its client application to connet to our server Therefore choose the Cus Choose Setup Type Choose the setup type that best suits your needs Ta e Installs the most common program features Recommended for most users Allows users tof Custom Installation will be installed and where they will be ins advanced users Complete All program features will be installed Requires the most disk space Figure 1 6 TightVNC installation tom installation mode as shown in the figure above and then click on the TightVNC Server entry and choose the option Entire feature will be unavailable At this point with the PuTTY command line still active run the TightVNC Viewer application its interface is really minimal you only have to spec ify the remote host and your specific port number and then hit Connect 10 Getting Started Custom Setup Select the way you want features to be installed Click the icons in the tree below to change the way features wi
37. d interacting with your controller to perform some postprocess actions etc that may have been written within another computer system In principle you could develop everything from within your remote desk top session but what your are most likely going to need is a way to transfer TestBench files and simulation datafiles from and to your re mote account space Thus you need to download and install WinSCP from here free application Its interface is simple and intuitive as well its setup once you started it click on New button located in the upper rigth side of the application and the interface will change to let you enter details about the session you are going to establish as you can see in the image below You only need to fill the following fields e Host name with mulab simnumerica com e User name with your_username e Password with your_password the same used with PuTTY cfr sec 1 2 After doing so you can either press the Login button or and we advise you to do so save this new session and then double click it from the Stored sessions list If you did type everything correctly after the connection phase you will see a new window similar to the one shown in Figure 1 18 on the left you have your local directories and files on the right you can ex plore your remote account directory and subfolders If you want to up load a file or folder from your local computer to the server just drag and 18 Getting Start
38. d only when there is at least one Test running or finished and it is shown in Figure 7 1 Hu gt omo a Status details Running simulation loop Global time 0 068500s Working dir moTestBench demoAN1078_di_Paolo Data E Chart nimatic Debug Post process Docs 3 rr z 1 30E01 2 30 01 f e E a a H np Ep 1 20E01 2 20E01 j Md j Md 3 1 10E01 Bice a 2 10E01 4 T z 1 0001 H P Mq 2 00E01 4 4 P Temp_nom 9 00E00 H Hd Inverter 1 90601 4 Hd MechanicalLoad a 8 00E00 dh Userinterface H Hdb PowerSuy 7 7 00E00 MESE shasta i st V A 6 00E00 1 70E01 4 V omega_e a gt V theta_est v 2 5 00E00 1 60E01 4 V Lalpha El V Lbeta E 4 0000 1 50E01 V V_alpha 3 Vv fv bet epee 44001 4 V za 2000 E j V theta_comp V aa kai S 1 30E01 4 V delta_theta a gt 10080049 V hatE_fa E 5 E 120801 4 V hate_fb E E 0 00E00 G V hatl_alpha Y dl 1 1001 4 V hate_alpha 3 3 E 100800 G 1 V ratio g 1 A e Z 200800 1 00 01 Aai ar o atE_beta ES 3 00 00 9 00E00 Pfc 4 00E00 P f_c_omega Ai 8 00E00 PK ical PL l 5 00E00 7 0000 P Ts a 6 00 00 1 P GRECOo_max 2 6 DDE00 PR 8 7 00E00 PT 5 00E00 P GRECOo_min E 8 00E00 P k_speed 8 4 00E00 P f_pwm E i a P MaxSMCError 1 00E01 cooky P K_slide be i mW 1 10E01 2 00E00 ee 100600 Time series share the same y axis n E 1 30E01 0 00e00 9 Each time series has its own y axis 0 00E00 5 00E 03 1 0
39. d then configure adapters for each pin alias click on the description of the adapter it s empty if no adapters have been configured for that pin alias to edit it Each adapter type is described in the following subsections 3 3 2 1 Clock frequency Here the user can set the external clock frequency input to the micro controller The adapter accepts one parameter Clock frequency Hz and no connections are required to the pin of the embedded platform model eventual data fed up to the pin are not considered 3 3 2 2 Input voltage Here the user can set a constant input voltage with no need to build an external component in the uLab model The adapter accepts one parameter Constant voltage V and no connections are required to the pin of the embedded platform model eventual data fed up to the pin are not considered 3 3 2 3 Input Output frequency modulated pulse train Here the user can generate read a high frequency modulated pulse train at microcontroller pins without the need to sample the uLab model at the Nyquist frequency of the signal or higher The adapter accepts one parameter Duty cycle 7 and reads writes the value at the em bedded platform pin as the frequency of the pulse train 3 3 2 4 Input Output width modulated pulse train Here the user can generate read a high frequency width modulated pulse train at microcontroller pins without the need to sample the pLab model at the Nyquist frequency of the signal
40. e clock frequency in uLab will not have any effect on MPLAB X simulator so please re member to do it from within MPLAB X IDE 1 7 2 Error Cannot start communication server This error arises for the following three reasons e the plugin was not installed or it was removed because you wanted to upgrade it but then you forgot to install the newer version Solution gt contact the administrator e there is an instance of MPLAB X IDE already running and uLab cannot connect to it because it has to start MPLAB X IDE on its own Solution gt save everything you were working in MPLAB X IDE and close it pLab will start it and take 26 Getting Started care of its startup and communication setup 1 7 3 Warning muLab MPLABX plugin detected that When you see a warning message which tells you muLab MPLABX plu gin detected that the frequency in the simulator is different from the one set by the Clock Frequency Adapter it means that you are trying to run a simulation but the frequency you set on OSC1 OSC2 is different from the one used from MPLAB X IDE internal simulation and therefore you will get erroneus results To solve this issue update the correct os cillator frequency value in the MPLAB X project or change the fre quency parameter of the AdapterClockFrequency attached to OSC1 OSC2 see sec 3 3 2 1 Chapter 2 Interface Overview The main pLab dashboard is composed of 4 sections e
41. ec 7 6 for more details about Test Reports x Working notes Simulation reports Delete 2011 01 25 15 06 32 Triangoare 50Hz 1 44 O 2011 01 25 15 06 41 Quadra 1kHz 1 4Y E 2011 01 25 15 07 03 Default Sinusoidale 400Hz 0 41 El 2011 01 25 15 06 41 Quadra 1kHz 1 4Y Display report section Debug Procedure execution Start Running Q Debug Procedure execution Duration 0 00zgprocessor M1 disassembling Machine Configuration Changes for this Test Param shape 2 0 it was 1 0 Param ch 1 0 it was 1 0 Param Vmax 4 0 it was 4 0 Param Ymin 1 0 it was 1 0 Param 1000 0 it was 400 0 Param t 0 0010 it was 0 0025 main at time 0 0 sec gt FIRMWARE DISASSEMBLED AT Ml Ox0000 Oxffff main at time 0 0 sec gt FIRMWARE DISASSEMBLED AT M2 Ox0000 Oxffff Simulation completed succesfully at time 0 002000999999999941 sec Search text Close Figure 2 18 The Reports manager 52 Interface Overview 2 7 2 Working Notes uLab features an integrated rich text editor for taking notes within the application Working notes belong to the test bench they are saved in as such when a test bench folder is moved to another pLab installation its working notes are carried over to the new copy on the other hand you can only access a working note from the testbench it belongs to Simulation docs i x Working notes E Simulation reports New H Save 2011 01 25 16
42. ed Password Advanced options Figure 1 17 WinSCP setup page Local Mark Files Commands Session Options Remote Help ed a Rem esa HUESO Defaut root mulab simnumerica com m l C Disco locale a Aie s A 2 ts J Downloads Size Type Changed Name Size Changed Parent directory 10 01 2014 10 07 4 18 02 2014 10 40 27 Cartella di file 13 11 2013 14 45 3 B distribute 0 6 49 tar gz 707 KiB 10 12 2013 15 51 14 Cartella di file 19 02 2014 09 11 4 Python 2 7 3 tar bz2 11 517 KiB 10 04 2012 01 29 04 _ sundials 2 5 0 2 sdl6 x86_64 rpm 206 KiB 07 03 2013 15 46 11 MEM m 0 B of 12 430 KiB in Oof 3 3 F6 Move if F7 Create Directory gt F8 Delete F F9 Properties Jf FLO Quit Figure 1 18 WinSCP connected to mulab remote account space drop it from the left panel to the right panel In Figure 1 19 for example we copied the local folder mulab inside C mulab modules branches into the remote folder root Downloads Win Copying your files into your uLab remote account space 19 SCP is smart enough to provide some transfer options to better improve the transfer rate and reduce bandwidth usage feel free to try them and then press the Copy button Local Mark Files Commands Session Options Remote Help 9 lom SSe gf SA Wig o O Default root mulab simnumerica com E lt Disco locale C mulab modules branches Changed 18 02 20
43. ed by component and by processor model in case they be long to an embedded platform any values specified here will override both the starting default values only for the execution of the selected 102 Co Simulations run Test or Test Sequence and the values in the specific Test configurations S Test debug wizard EJ Machine initial configuration Configure the initial status of parameters and variables for this simulation Machine model Value 1 Test sequence 2 2 Test A 3 Machine initial controller configuration db PMSM 4 Links activation status V T_load N m default 5 Debug components V Va V default V vb v default V Ve VJ default V la A default iV Tb A default iV Ic default Y GRECOO_m default iV id default V iq default V theta default VV omega_m rpm default V theta_norm default PLa default Rs default Pk default PJ default P np default P md default v lt Back Next gt tart Cancel Figure 7 5 Configure the starting values of variables and parameters Starting Simulation 103 7 1 3 Links configuration Each link between model components can be here enabled or disabled any values specified here will override both the starting default values only for the execution of the selected Test or Test Sequence and the values in the specific Test configurations 4 Test debug wizard x Links activation status Configure the activation status of links for this simulation
44. elete it The debug instructions editor works in a similar way click the New Debug Instruction button to add a new debug instruction at the end of the debug procedures or click an existing one and then use the buttons at the bottom of the pane to edit its contents or delete it More info about designing Debug Procedures can be found in Chapter 5andin the uLab Tutorial Please note that debug instructions are executed in a sequential or der but every new instruction is added at the bottom of the list you can use the arrow buttons on the right to change the position of the selected debug instruction The main pane 47 2 5 4 Test Sequences view ess Figure 2 14 The Test Sequences view The Test Sequences view lets you manage the test sequences for the current test bench The list on the left pane displays the available test sequences you can click the New Test Sequence button at the bottom to create a new one or click an existing one to show the single tests it is composed of and use the buttons at the bottom to rename or delete it The tests editor works in a similar way click the New Test button to add a new test at the end of the sequence or click an existing one and then use the buttons at the bottom of the pane to edit its contents or delete it More info about designing Test Sequences can be found in Chapter 6 and in the pLab Tutorial 2 5 5 Simulations view The S
45. emove test sequence button 6 4 Copy Paste a test sequence To copy paste a test sequence select it and click first the Copy test sequence button then select the position to paste a copy of the Test Sequence and click the Paste test sequence button Figure 6 5 Creating Editing Deleting a new Test 91 sacuanbas 358 1 iy Test sequence editor x Name Ok Cancel UOHE NWIS 14 8 143 Figure 6 2 Input a name for the new Test Sequence and press OK to con tinue 6 5 Creating Editing Deleting a new Test Click the Create new Test button to start the creation of a new Test that will be added at the bottom of the current Test Sequence To edit a test select it from the list and press the Edit test button To remove a test from the test sequence select it from the list and press the Remove test button The Test editor has multiple tabs e Details is shown in Figure 6 6 e Details is shown in Figure 6 7 e Details is shown in Figure 6 8 e Details is shown in Figure 6 9 e Details is shown in Figure 6 10 6 6 Rearranging the Test list You can use the up and down buttons to move up or down by one step a test Figure 6 11 92 Test Sequences Design IB 1 test s sal Jeuoy Ip pafosla B seinpaso id Bngeag Y n ba a 2 5 A H J Test sequence editor eS Name IB w Ok Cancel d w 3 DAA DO Figure 6 3 Select a T
46. escription 2 Plugs and wires Descriptio Next Cancel Figure 3 20 The link creation wizard specify the name of the new link you may add a description text optional When you are done press Next to continue L New link x Plugs and wires S Specify source plug target plug and wires Si Source plug M1 0 parameter s 0 v Bb Plug PowerSupply 4 pin s v 1 Name and description E F 2 Plugs and wires Target plug dh VDD 0 parameter s 4 v BD Plug PowerSupply 4 pin s v Wires Drag source pin and drop it on the target pin to create a wire 8 AVDD V Microp pin VDD V Output 6 AVSS V Microp pin vss v Output 8 vod v Microp pin AVDD V Output L 8 vss v Microp pin AVSS V Output f Autoconnect l Clear lt Back Next Finish J Cancel i Figure 3 21 Select source and target plugs of the new link ment are the same Note that the connection begins at the output pin and ends at the input pin Different numbers of pins or failure to match one or more pins on one plug will cause the two plugs to be incompatible therefore unavail able for being connected with each other 68 Machine Process Modelling amp J New link Plugs and wires x O Specify source plug target plug and wires Source plug 4 M1 0 parameter s 0 v JB Plug PowerSupply 4 pin s Y 1 Name and description 2 Pl
47. est Sequence and click Edit test sequence to rename it When atest sequence is started with the Launch all tests option active tests are performed in the same order they are found in the se quence even though they are independent i e machine states don t carry over between subsequent tests Rearranging the Test list 93 leF 1 ESS i e ES3 1 test s saleuonzip palo a sainpazo id Bngaq A saduanbas sa iy Confirm deletion X Are you sure you want to delete the test sequence s selected uogejnus Figure 6 4 Select a Test Sequence and click Remove test sequence to delete it 94 Test Sequences Design Sal JBUONAIp aloud E sainpezoid bnqag A un 3 cul a p a 57820 Figure 6 5 Select a Test Sequence and click Copy test sequence and Paste test sequence rightmost buttons Rearranging the Test list r Details Firmwares Machine configuration Link configuration External data configuration l Test editor EJ Details Firmwares Machine configuration Link configuration External data configuration Name python PWM startup ramp Simulation duration 1 5 Data sampling period 5 0E 5 Main debug procedure MH void 4 instruction s y Postprocess script Y Comment e e e Figure 6 6 Click Test editor Ea Firmware 0 Firmware 1 Firmware configu
48. est bench Specify test bench details Specify author name icon and location of the test bench to create Author Name Icon 16x16px Location Directory Figure 3 1 Fill in the test bench creation form to continue 3 1 2 Loading an existing test bench To load an existing test bench select Load test bench from the File menu and select the test bench you want to load through the file chooser dialog test bench directories can be distinguished from their red u icon The selected test bench will be loaded onto the working environ L Select the test bench directory rca in sampleTestBench H algo_prototyping H missile H algo_prototyping Copy H modell H BatteryCharger H PIPPO H Chiller H Prova s com microchip mplab mdbcore common debug src H prova_ com microchip mplab mdbcore simulator src pysund H demo_controllo_motore H python H demo_controllo_motore Copy d sundial H demo_controllo_motore_per_debug_DAE_Lang H Test H dsPic_test L test eng H LinkTest H test be r Nome file 2 com SimNumerica muLab CHECKOUT_DIRS mulab core 3 0 sampleTestBench Tipo file Test bench directory z D Test bench Info lt No test bench selected gt X l Annulla Figure 3 2 Select a test bench and press Load to continue ment Components 55 3 2 Components 3 2 1 Component creation In order to add a new component to the machine model select Add componen
49. f port 5909 for user Diego ssh L 5909 localhost 5909 Diego mulab simnumerica com Diego mulab simnumerica com s password Last login Tue Mar 25 12 05 43 2014 from ud titin eluate f Diegoamulab 1 Figure 1 11 Linux Mac tunneling Now the steps to connect to your remote desktop are the same shown in Windows just use your favourite VNC client shipped with your dis tribution insert localhost lt port_number gt as remote local host and click Connect once you provide your remote VNC password you are done If for example you are using KDE s remote desktop application KRDC simply insert localhost lt port_number gt and then click the blue arrow on the right as shown in figure 14 Getting Started a uy KRDC amp O s File Session Bookmarks Settings Help y New Connection z Full Screen 2 Screenshot View Only Disconnect Remote Desktops X KDE Remote Desktop Client x Enter or select the address of the desktop you would like to connect to re Connect to vnc v localhost 5909 gt Remote Desktop Last Connected Visits Created A Figure 1 12 KRDC host speficifation Ya uy Host Configuration KRDC Host Configuration Y amp Password KRDC Connection Connection type Medium Quality DSL Cable Fast Internet cf __ Scale to Size Small 800x600 Access to the system requires a password width O Height Password 00000 1V Show
50. f the new group and press OK to create it A group can be either collapsed only the group icon and name are shown on the graph its contents hidden or expanded no group icon and name all of its contents are shown you can switch between the two display modes by clicking on the expand collapse button on the top left corner It s possible to change the contents of a group without de stroying and recreating it expand it and drag the component you want to add or remove respectively inside or outside the group box If you want to remove a group select it and press the ungroup button Note that this only deletes the group view not the components themselves 70 Machine Process Modelling 404 404 Image not Image not found found Figure 3 26 Collapsed and expanded views of a group Press to switch between the two modes 404 404 Image not Image not found found Figure 3 27 Components being added to left picture and removed from right picture a group through drag and drop 404 Image not found Figure 3 28 Ungrouping removes the old group relationship between objects but the components themselves are not deleted Chapter 4 Project Dictionaries Design 12 Project Dictionaries Design 4 1 Dictionary of firmware variables subroutines In order to create modify or delete an alias of a firmware variable subroutine use the panel and the buttons indicated in Figure 4 1 Firmware variables subroutines Proces
51. gure 1 21 Login password change The prompt will ask for your current password and then it will ask 22 Getting Started you to enter your new password twice If everything went good the prompt will inform you that your authentication tokens were updated successfully An almost identical process applies if you change VNC password as you can see in Figure 1 22 El initialuser mulab mulab modules current mulab core current mulabAj Oo x File Edit View Search Terminal Help initialuser mulab src vncpasswd Password Verify initialuser mulab src _ A Figure 1 22 VNC password change In fact now you have to type the command vncpasswd and as op posed to passwd it will not ask for your current vnc password but it will simply ask for a new one to set Final touches 23 1 6 2 Change desktop resolution Another aspect you most likely want to change is the desktop resolution It is a really straightforward operation if you already used Gnome desk top environment If you never did just follow the screenshot in Figure 1 23 amp Applications Places 3 E MW q 5 13 C Mon Feb 24 14 02 Preferences O about me C TightVNC Viewer ME W o _ e TUNE q mE 13 C MonFeb 24 14 04 roc gt o About Me Administration m Appearance Display Preferences Help S Assistive Technologies a Drag the monitors to set their place Bluetooth About this Computer 0 Default Printer
52. h plug is composed of two name type initial value pairs describing its pins Graph view shows vertex properties ID the component ID Font the font used for the component name in the graph Icon the icon used to represent the component in the graph Background color the background color for the com ponent square in the graph The main pane 43 Foreground color the foreground color for the compo nent square in the graph Bounds the bounds of the component square in the graph Border visible if toggled on shows the border of the component square in the graph e One embedded platform selected Model view shows embedded platform details plugs and pins processors Embedded platform details ID name description en abled if this option is toggled off the status of the em bedded platform will not change during simulations Y IS CHE SIGNIFICA Plugs and pins alist containing the embedded platform plugs each plug is composed of two name type initial value pairs describing its pins Processors a list containing the embedded platform mi croprocessors each processor entry shows a list con taining all of its pins Graph view shows vertex properties ID the embedded platform ID Font the font used for the embedded platform name in the graph Icon the icon used to represent the embedded platform in the graph Background color the background color for the embed ded
53. hich username present to it What it is still missing is to define how to convey the remote desktop session in the SSH secure channel In other words we have to define now a tunnel connection To do so head to the Connection gt Data gt SSH gt Tunnel subcategory and locate the Source port and Destination input boxes Recalling the port_number you got when you received the activation email response cfr sec 1 1 insert the port_number in the Source port and as Des 6 Getting Started tination insert localhost port_number See example in Figure 1 3 with port_number equal to 5906 Click Add to create a tunnelled connection and you are done Now to Options controlling SSH port forwarding Port forwarding Local ports accept connections from other hosts Remote ports do the same SSH 2 only Forwarded ports Add new forwarded port Sarco Si Destination localhost 5906 9 Local D Remote Dynamic 9 Auto 5 IPv4 Figure 1 3 Tunnel configuration save your time for every future connection you can store this session profile and load it when you need it To do so head back to Session category below the Saved Sessions label type a sensible name for that connection in Figure 1 1 we saved it as muLab and then click Save Installing an ssh client putty and setting the remote connection 7 Now you can test your connection double click on your earlier saved session and a popup
54. hine Process Modelling M1 x Details Pinout Plugs Plug Input 7 3 JD Input width sd E Edit plug x D Plug Input F Mme Input Freq 40 Available pins Pins JB Bing Outpt f gt Clock 1M V Microp pin I Output Freg Clock 10M V Microp pil Plug Output Y Output Width I Plug PowerSu AVDD AVSS VA Add gt gt Ok Cancel Ds B Check pinout Ok Cancel Figure 3 18 Plug configuration dialog specify the name of the plug and the pins it s composed of Figure 3 19 Select New link to start the link creation wizard Doing so brings up the link creation wizard Fifure 3 20 Input the name required and a brief description optional of the new link then press Next to continue Connections between two components of any machine are formed by linking one plug on each machine with each other as shown in Figure 3 21 Such a connection can only be made if the two plugs are compatible Compatibility between plugs is verified by checking if all of the pins on the first plug can be correctly connected with all of the pins on the sec ond plug Two pins can be connected with each other if their I O types are com patible i e if the first is an input pin and the second is an output pin or vice versa or if one is a microp pin and if their units of measure Links 67 S New link eS Name and description S Specify name and description e Name 1 Name and d
55. imulations view lets you watch real time data evolution during the execution of a test sequence See Chapter 7 for detailed info about simulation data Interface Overview H SimNumerica plab 2010 File Machine Debug procedure El E senos anoto E extra sauarbas ase TS amin oejaje sequences Simulation Network Help MPLAB X Status details t execution has been completed success ully Global time 0100000 s Working dir moTestBench demoAN1078_di Paolo Data DER E Animation d Dobue 2 Post process 7 50200 4 80E00 1 8600 1 80E00 1 75600 1 70E00 1 85E00 1 80E00 1 55600 1 50600 145500 140800 435600 430600 1 25600 1 20E00 1 15600 410600 4 05600 100800 9502 01 Inverter theta V merer Y e Y EDU 7000 6506 01 60 01 5506 01 502 01 4 501 01 4008 01 3502 01 3 002 01 2 502 01 2007 01 1505 01 1908 01 e E a oomoo o ooE00 aA 50200 5 000 s0e00 500800 4 50E00 4 00203 3 0600 5 0000 2 50800 2 0009 1 50200 1 0800 500 01 00 S00E 01 1 00800 150800 2 0800 2 5080 3 0500 3 50600 4 0080 3 5000 5 00E09 5 50209 8 00600 4 2001 420801 110801 100801 VEO 5000 700800 e 0E00 sueno a o0e00 3 000 2 00E00 1 00800 oa0E00 PMSN ve 30200 4 o0e00 Eoo 6 00E00 7 0000 e p0E00 0 00e0 190801 420801 130501 w 0 00200
56. ing started pLab loads by default the TestBench used in the last session restoring graphical properties such as the icon positions on the graph the size of the main window 16 Getting Started ae STS Places System Y E HE 5e Accessories gt Pe Graphics gt y Internet gt Rots EE TAIT A a se a p Le OS X MPLAB IDE gt z MPLAB IPE Ed Sound amp Video 0 System Tools tall Figure 1 16 Run uLab in the remote desktop Once you have completed your Lab session do not logout from your login in the server If you do so you won t be able to reconnect with your remote desktop until the server administrator re activate your login Instead just close VNC and PuTTY once you re connect again you will access the same working environment left at the end of your previous session this can be very useful for example if you left a simulation running you will access to its current status and interact with it Copying your files into your uLab remote account space 17 1 5 Copying your files into your uLab remote account space You have seen how to setup a secure connection how to display your re mote desktop session and how to launch mulab The natural step that follows is to start composing one or more TestBench i e your virtual prototyping projects within pLab this requires also providing cus tom firmwares and some Python scripts to model the physical worl
57. ions for your PuTTY session Specify the destination you want to connect to Host Name or IP address Port mulab simnumerica com 22 Connection type Raw Telnet Rlogin 0 SSH Serial Load save or delete a stored session Saved Sessions muLab Default Settings Load drupal load muLab Close window on exit D Always Never Only on clean exit oen J _ coma Figure 1 1 Hostname configuration Installing an ssh client putty and setting the remote connection 5 Please ignore for now the Session entries we will come back later Now you need to supply your login credentials to PuTTY so that it can forward them to the cloud server To perform this simple operation just head to the Connection gt Data subcategory and locate the Auto login username label On its right instead of your_username shown in Fig ure 1 2 as example insert the username you registered in the pLab registration page ES PuTTY Configuration l Data to send to the server Login details AutoJogin usemame your_usemame When usemame is not specified 9 Prompt Use system usemame SimNumerica Terminal details Teminaltype string Selection Terminal speeds Colours Environment variables Connection a Variable Proxy Value Telnet Rlogin SSH Abot Figure 1 2 Username configuration At this point we are almost done with PuTTY configuration it knows to which server he has to connect and w
58. irtual i Figure 4 2 Here it is the list of processor implementations existing in the project at the left bottom there are three buttons to create modify or delete the selected implementation amp J Edit processor implementation specification X Name dsPIC Simulator binding python Device binding eo MPLAB X Name dsPIC33EP256MC506 v DO NOT USE bind selected simulator Alias Pin association run stop button gt RG7 RG7 SpeedDemand pot gt AN13 AN13 PWM1H gt PWM1H PWM1H PWM1L gt PWMI1L PWM1L PWM2H gt PWM2H PWM2H PWM2L gt PWM2L PWM2L PWM3H gt PWM3H PWM3H PWM3L gt PWM3L PWM3L V_ia gt AN4 AN4 V_ib gt AN1 AN1 X Ok Cancel Figure 4 3 The editor of a processor implementation the user should specify a name and the bindings with the simulator the specific device inside the simulator and the alias physical pins association 74 Project Dictionaries Design 4 4 Dictionary of runtime firmware subroutines substitutions The dictionary of runtime firmware subroutines substitutions see an example in Figure 4 4 is located in the left bottom of the Project Dictio naries View sec 2 5 2 Firmware subroutine runtime substitutions with Python functions Firmware subroutine alias Arguments Fw variables and pins alias model params Python module Python function bypass_ADC ADC1BUFO ADC1BUF2 ADC1BUF3 SpeedDemand pot V_ia V A ADC py updateADCBUF control_algo
59. is python module a templ pytr 5 start point to de p your py tin 6 7 import logging 8 import logging handl 9 from math imp n sq p 10 im 0 0 11 state 0 0 stato attua le motore 12 _T SAMPLING 5 0e 5 13 _PWM_FREQ_ 20000 0 14 _vDC_BUS_ 24 0 15 _LOCK TIME 0 024 0 25 16 _OPENLOOP TIME 0 2 3 0 17 _END SPEED OPENLOOP_ 500 0 2 18 delta_startup_ramp _END_SPEED_OPENLOOP_ 5 65536 0 _PWM_FREQ_ 2 60 OPENL _ Debug Cancel Figure 7 8 Select the components you want to debug by clicking them while pressing CTRL Simulation flow 105 7 2 Simulation flow The simulation flow can be controlled with the buttons shown in Figure La 4 DEE i A AN y ar OF Figure 7 9 The flow control buttons from left to right Pause Resume and Cancel 7 2 1 Pausing Simulations Use this command to pause the execution of the Test shown in the active tab 7 2 2 Resuming Simulations Use this command to resume the execution of the Test shown in the active tab This action can only be performed if the Test was previously paused an aborted Test cannot be resumed 7 2 3 Aborting Simulations Use this command to stop and abort the execution of the current Test Aborting a Test also cancels the creation of its Test Reports 106 Co Simulations run 7 3 Data visualization 7 3 1 Data view Status details Running simulation loop Global time 0 1
60. is used to work on the machine structure while the right one can be used to set up masks view and edit variables and parameters of the model and modify the look of the graph 40 Interface Overview embedde AR generat Figure 2 10 Machine view the Graph pane Graphpane The machine itselfis represented by a graph the nodes of the graph represent the components of the machine and the arcs ofthe graph represent the links of the machine Component and link properties can be modified through the respec tive edit dialogs accessible by double clicking the object you want to edit or by selecting it and then choosing the Edit action from the Ma chine menu or the toolbar Components and links can be deleted through the Delete action which can be selected from the Machine menu the toolbar or the con text menu open it by right clicking on the component Del on your The main pane 41 keyboard also works as a generic shortcut for deletion Machine mask Ai Bz 24 gt lt No machine mask gt LJ Graph graphics Grid visible O Grid aspect Dot Grid color MA R 06 068 0 000 lt No formula available gt Grid size 10 0 Background color _ R 255 G 255B 255 5 Machine details A Description Parameters shape 1 0 ch 1 0 Ymax 4 0 min 1 0 F 400 0 3 Model o Graph Lal Model o Graph Figure 2 11 Machine view the Info pane Info pane MODO TROVARE NOME DECENTE P
61. ll be installed TightVNC Server makes this 8D gt TightVNC Server computer available for remote _ ES Will be installed on local hard drive 8 Entire feature will be installed on local hard drive Feature will be installed when required Entire feature will be unavailable Browse Figure 1 7 TightVNC installation as shown in Figure 1 8 PuTTY connection must be running during the whole VNC session If you closed it either acciden tally or on purpose you will lose your remote desk top connection If everything was setup correctly now you will be presented a mes sagebox asking for your password to login into your remote desktop en vironment Enter your password and you are done Welcome to your remote desktop environment you can start using pLab Install VNC viewer and connect to your remote desktop session 11 Connection Remote Host ocalhost 5906 Enter a name or an IP address To specify a port number append it after two colons for example mypc 5902 Reverse Connections Listening mode allows people to attach your viewer to their desktops Viewer will wait for incoming connections Listening mode TightVNC Viewer Tight VNC is cross platform remote control software Hebb Its source code is available to everyone either freely C GNU GPL license or commercially with no GPL restrictions Version info Licensing Configure Figure 1 8
62. ll the data transitioning from your 2 Getting Started computer tablet to the server and viceversa The current version of this manual assumes by default that you are using the Windows op erating system on your client computer but the same operations can be mad also with other other systems Linux Mac as explained in the Linux Mac users subsection of each section Register on the web site and activate your muLab account 3 1 1 Register on the web site and activate your muLab account DOW UNDER CONSTRUCTION Getting Started 1 2 Installing an ssh client putty and setting the remote connection As mentioned before data security and safety are of primary concern Therefore all communications between your local machine and the server hosting pLab should take place through an encrypted SSH connec tion To set up the connection you first need to download and configure PuTTY freely available here Place a shortcut to it in a convenient place such as in the desktop or taskbar then launch it The first option to configure inside PuTTY is the hostname to connect From the Category sidebar select Session subcat egory then locate the label Hostname or IP address and in the text field immediately belowit enter the hostname mulab simnumerica com A screenshot of this step is shown in Figure 1 1 Translation Selection Colours Connection Data Proxy Telnet Rlogin SSH Serial Basic opt
63. m the model type you selected For the Python model type cfr Figure 3 6 click the New python model button and choose one of the existing implemen tation templates cfr Figure 3 7 New component model tS Numerical model Edit the numerical model Python model code New python model 1 Name and Description AAA 2 Model type 3 Numerical model 4 Parameters and Variabl 5 Pins and Pl r 9 Check syntax m Run module CHECKOUT_DIRS mulab core 3 0 sampleTestBench Test_Adapters_da_svn xx py lt Back Next gt Finish Cancel Figure 3 6 Python component solver setup Components 57 New component model eS sn Numerical model Edit the numerical model L Python model generator eS e Default lame and Description A free form model entirely customizable by the user component KEY COMPONENT_NAME name Parameters and Variabl component KEY_COMPONENT_VARIABLES variables PA simulationld globalTime workingDir gt cent ca lt Back Next gt Finish Cancel Figure 3 7 Python component solver implementation templates chooser 3 2 3 1 Default Python model template This template is an empty Python model with only the interface with the uLab model Write the implementation of this model between the code lines lt YOUR CODE START gt put here the actual solution of the component model and lt YOUR CODE E
64. me ParkParm x TIMER3 gt TMR3 UNSIGNED_SHORT AD1CHSO gt AD1CHSO UNSIGNED_SHORT AD1CON2 gt AD1CON2 UNSIGNED_SHORT Type UNSIGNED_SHORT T ADC1BUF2 gt ADC1BUF2 UNSIGNED_SHORT ReadADCParm qADValue gt ReadADCParm 4 Wh gt Offset o Reset ok f Cancel Figure 4 10 The editor of a firmware variable subroutine binding the user double click the alias of a variable subroutine and the editor open up He then must choose the Name of the variable corresponding to the selected alias among the symbols defined in the firmware project and presented in a popup list of the editor he must also specify the Type of the variable subroutine return value and if the variable is a C struct vector the offset in bytes at which the desired scalar value is al located External datafiles test_with_ramp_profiles_and_variable_load gt Figure 4 11 Here it is the list of references to external datafiles consid ered in the project at the left bottom there are three buttons to create modify or delete the selected implementation 80 Project Dictionaries Design j Datafile alias Lx Name test_with_ramp_profiles_and_variable_load Datafile list Column binding C com SimNumerica muLab CHECKOUT_DIRS mulab core 3 0 q Va gt Va Vb gt Vb Ve gt Ve la gt la Ib gt Ib GRECOO_m gt Omega_out T_m gt T_m Ok Cancel Figure 4 12 The editor of a reference to an e
65. mpleTestBench Test_Adapters_da_svn xx py H Save lt Back Next gt J Finish I Cancel Figure 3 8 Python component solver code verification L New component model es Numerical model Edit the numerical model i sae oi Python model code _ New python model 2 Model type 5 component KEY COMPONENT_VARIABLES variables gt 3 Numerical model 11 component KEY COMPONENT_PARAMETERS paramete rs 4 Parameters and Variables 117 context 5 Pi dPlugs ane context KEY_SIMULATION_ID simulationId context KEY GLOBAL TIME globalTime samplingPeriod S Syntax correct 53 ingnir 128 To test this model outside the mulab simply modify the test f 29 launch this script as any other python executable script gt 3 Check syntax m gt Run module CHECKOUT_DIRS mulab core 3 0 sampleTestBench Test_Adapters_da_svn xx py H save lt Back Next gt Finish cancel Figure 3 9 Python component solver code verification success 3 2 3 3 LaTeX model template Thanks to the CfL Link uLab can generate Python component mod els from a text written in LaTeX Supposing you have a file latex with the component model equations written according to the CfL stan dard this template lets you upload the file latex from the chooser of Figure 3 12 Press the button and choose your latex file as shown in Figure 3 13 for the file example_L
66. nimation ik Debug 7 Post process Docs z ho controller a El Firmware Python routines a _ _ 3 control_algo_con_PWM py virtual a 2 Line Code 8 import logging handlers 9 from math import cos sin sqrt pi A 10 _PWM_FREQ_ 70000000 0 20000 0 E 11 _VDC_BUS_ 24 0 El 12 pal 13 Logging settings hd 14 LOG NAME E 15 LOG FILE routine log x 16 LOG FILE MAX BYTES 2000000 a 17 LOG FILE BACKUP_COUNT 0 18 LOG LEVEL logging DEBUG 19 LOG_FORMAT asctime s name s levelname s gt message s 20 LOG ENCODING utf 8 2 21 E 22 23 3 24 Call the routine E 25i g 26 param args The python dictionary containing the input output arguments of 27 the routine 28 29 def pi control ref feedback sum Kp Ki Kc outmax outmin Ha ne 5 31 u sum Kp err a 32 if u gt outmax g 33 out outmax 35 ut outmin 36 1 37 t 38 u 39 um sum K ES 40 out sum 41 42 43 Kpw 5 1 0 Variables python PWM startup ramp simulation 0 o python PWM simulation 2 Figure 7 13 The Debug view number instruction address to add a breakpoint on that line click again to remove it When the execution of the platform firmware or compo nent solver stops at a breakpoint Figure 7 14 you can use the control buttons to either skip that breakpoint do one step that is execute the current instruction and stop at the next one or con
67. oad an existing test bench from a test bench file See also 3 1 2 for a detailed walkthrough Save test bench save the current test bench to file This is only active if the test bench has been modified after the last save Rename test bench rename the current test bench Renaming requires the test bench to be saved you will be asked for confirm About current test bench show a brief description of the test bench you are currently working on 30 Interface Overview Quit terminate all of the active simulations and debug procedures and exit pLab The menu bar 31 2 1 2 Machine menu SimNumerica pLab 2010 File AER Debug procedure Test sequences Simulation Working notes Reports Help dh New component a i a Air m gt O E had New embedded platform P New link Machine mask lt No machine mask gt NG lt No formula ava Figure 2 3 The Machine menu D n 5 m A fone The Machine menu figure 2 3 lets the user define the hardware setup of the machine by creating the components themselves and their interconnections that model their interactions The resulting machine can be viewed by selecting the Machine icon from the navigation bar New component create anew component and add it to your machine See also 3 2 1 for detailed instructions about creating components New embedded platform create a new embedded platform and add it to your machine See also 3 3 1 for detailed instructions
68. ocedures left and the list of the Debug Instructions right existing in the selected Debug Procedure 5 3 Deleting a Debug Procedure To delete a debug procedure select it and click the Remove procedure button Creating Editing Deleting a Debug Instruction 85 saunpaso id Bngeq A 2 E Ma C D g L Debug procedure editor LX Name Y 2 Ok Cancel pa ES 14 B Figure 5 2 Input a name for the new Debug Procedure and press OK to continue 5 4 Creating Editing Deleting a Debug Instruc tion Click the Create new Debug Instruction button to start the creation of a new Debug Instruction that will be added at the bottom of the in structions list of the current Debug Procedure To edit a debug instruc tion select it from the list and press the Edit instruction button To remove a debug instruction from the debug procedure select it from the list and press the Remove instruction button To change the position of a Debug Instruction inside a Debug Procedure use the arrow buttons as shown in Figure 5 6 The Debug Instruction editor is shown in Figure Dias Configure the new Debug Instruction through the Debug Instruc tion Editor refer to the uLab tutorial for detailed information on how 86 Debug Procedures Design gt 1 Trace RAM variable sum iq Z void i U Q 4 instruction s 2 Trace RAM variable sum w 3 3 when 1 0 Do nothing R timeout 999 9 secs
69. oject Its structure is shown in Figure E 5 1 Creating a Debug Procedure From the Debug Procedures page click the Create new debug pro cedure button then input the name of the new debug procedure and press OK to continue 5 2 Renaming a Debug Procedure To rename a debug procedure select it from the list and click the Edit procedure button 84 dummy 17 instruction s void 4 instruction s JApow Supe 7 sainpazoid Bnqaq A saleuoaip paloig a sanuanbas 358 1 UOe NUIS Debug Procedures Design 0 1 2 3 4 5 6 a 8 9 Trace RAM variable Trace RAM variable Trace RAM variable Trace RAM variable Trace RAM variable Trace RAM variable Trace RAM variable Trace RAM variable Trace RAM variable Trace RAM variable state_monitor ADC1BUFO ADC1BUF2 ADC1BUF3 PDC1 ParkParm gAngle ParkParm qld ParkParm qlq MotorParm EndSpeed_LOW MotorParm EndSpeed_HIGH 10 Trace RAM variable MotorParm Startup Ramp HIGH 11 12 13 14 15 Trace RAM variable Trace RAM variable Trace RAM variable Trace RAM variable Trace RAM variable MotorParm Startup_Ramp_ LOW smci1 Omega smcl1 OmegaFltred CtrlParm qVelRef SVGenParm iPWMPeriod when 1 0 Do nothing timeout 999 9 secs Stop the simulation Figure 5 1 The Debug Procedures View there are two vertical sections that show the list of the existing Debug Pr
70. or higher The adapter ac cepts one parameter Frequency Hz and reads writes the value at the embedded platform pin as the duty cycle of the pulse train Links 65 3 3 2 5 Input Output bit stream Here the user can generate read a serial bit stream at microcontroller pins without the need to sample the uLab model at the Nyquist fre quency of the signal or higher The adapter accepts two parameters Baud rate and Message length and reads writes the values at the embedded platform pin as the bit stream 3 3 2 6 Device pin 3 3 3 Plugs The final step of the wizard lets you add plugs to your embedded plat form Click on the New icon to create a new plug then specify its name and pins each pin can be associated to an I O variable the type of the pin is the same of the variable you can add multiple pins to a plug and multiple plugs to an embedded platform After all the plugs have been created press Ok to end the embedded platform creation wizard 3 3 4 Post creation editing You may also modify the newly added embedded platform after the wiz ard has been completed to open the editor either double click the em bedded platform icon on the graph or select it and click the Edit item in the Machine menu 3 4 Links In order to create a working machine its components must be linked to each other you can do this by creating links from the Machine menu Machine New link or with the button shown in Figure 3 19 66 Mac
71. orentz tex then press Open Now click the Generate button Wait the end of the code generation process Components S New component model ibd Numerical model b Edit the numerical model Python model code New python model Name and Description Model type 5 component KEY _COMPONENI_VARIABLES variables a Numerical model component KEY COMPONENT PARAMETERS parameters Parameters and Variables context Pins and Plugs a ES o NE LE Run error mal Traceback most recent call last File C com SimNumerica muLab CHECKOUT_DIRS mulab core 3 0 sampleTestBench Test_Adapters_da_svn _78887c56 caa2 4f4e 85cc 7b9a2a2442ec py line 125 in test Co Se ae File C com SimNumerica muLab CHECKOUT_DIRS mulab core 3 0 sampleTestBench Test_Adapters_da_svn _78887c56 caa2 4f4e 85cc 7b9a2a2442ec py line 61 in solve context KEY_USER_LOG Solve n KeyError userLog Details ok HET pycrnon EXECUTES stript test I CO chest mas run modi CHECKOUT_DIRS mulab core 3 0 sampleTestBench Test_Adapters_da_svn xxpy P4save lt Back _ Next gt Finish Cancel Figure 3 10 Python component solver code verification failure New component model eS Numerical model Edit the numerical model Python model code 2 New python model 1 Name and Description A 2 Model type 115 component KEY COMPONENT_VARIABLES variables a a mena mona A
72. otes Reports Help MT New test sequence A j Sth i O E LB 4527 i Mi Machine mask lt No machine mask gt haa ai h a embedde lt No formula ava a Figure 2 5 The Test Sequences menu The test sequences menu figure 2 5 lets you create edit and re move test sequences For more info about test sequences see Chapter 6 New test sequence start the creation of a new test sequence See also 6 1 Edit test sequence modify the properties of an existing test sequence See also 6 5 for editing individual tests Remove test sequence delete the selected test sequence See also 6 3 The menu bar 35 2 1 5 Simulation menu SimNumerica pLab 2010 File Machine Debug procedure Test sequences ecm Working notes Reports Help fa pa Start simulation a ty Ty mb e o s LB 4 409 BE 5 Debug simulation a Machine mask oy if l lt No machine mask gt a ir q lsa O a embedde lt No formula ava Figure 2 6 The Simulation menu The Simulation menu figure 2 6 lets you start numerical simula tions on your machine control the flow of their execution and access the simulation docs For more info about simulations see also Chapter re Start simulation start the Simulation launch wizard See also 7 1 for detailed instructions about launching simulations and test sequences Pause pause the current simulation inactive if no simulations are run ning See also 7 2 1 Resume re
73. python Pitt estimator startup ramp simulation 0 python PWM startup ramp simuleton 1 1008 02 200502 300802 400602 amp 00E02 600602 7 00502 Timne s 3 006 02 9 00E 02 1008 01 V PWMIH V V Pam IVI V PWM2H V V Pra v V pr IV V Poma v V Vovercurrent V V vam VvN V ve VBA V bla V Vaart V vb_snt V Vest V theta mot rad V V omega_mot rad s V omega V Time series share the same y is Each tima serias has its own y axis Resolution ms 0 000050 Figure 2 15 The Simulations view The status bar 49 2 6 The status bar The Status Bar is shown in Figure 2 16 and contatins from left to right the Log Console the Status Info the Memory Usage icon and the name of the current TestBench J DS pyr rywerreDurriawr startup ramp suiuauur y y pytnon rwm Startup ramp simulation 1 53 508 MB demoAN1078_Sensorless_Field_Oriented_Control_of_a_PMSM 4 Figure 2 16 The Status bar 2 6 1 Log Console DIU 1 cate 1 00E 01 1 20801 2 50E 01 5 00E 02 6 D0E00 H 2 0 00E00 0 00E00 1 30E01 4 2 0 00E00 1 00E 02 2 00E 02 a 5 3 python PWM estimator startup ramp simulation 0 python PWM startup ramp simulation 1 9 40 pLab AVVERTENZA No validator registered for it simnumerica mulab model machine ComponentPin 29 40 pLab AVVERTENZA No validator registered for it simnmumerica mulab model machine ComponentPin 40 yLab AVVERTE
74. ration 1_algo_con_PWM_e_startup_ramp l Figure 6 7 Click 95 96 Test Sequences Design S Test editor E Details Firmwares Machine configuration Link configuration External data configuration Machine model Value E controller dh PMSM iV T_load N m default 3 iV Va V default iV Vb V default iV Ve V default Y la A default Y Ib A default iV Ic default Y GRECOO_m default ro id default iV iq default iY theta default Y omega_m rpm default i theta_norm default i P Lg default i P GRECOP_PM default iP Rs default PK default iP default i P np default iP Md default iP M_dq default du Nia Anka le Figure 6 8 Click Create new Test to add a new Test in the Test Se quence Test editor 183 Details Firmwares Machine configuration Link configuration External data configuration Machine model Enabled we Torque Default X 57 MotorSupply Default z g ADC Default y 57 PWM Default d we buttons Default Ys 57 OK Default 57 estimates Default nA currents Default x E Figure 6 9 Click Create new Test to add a new Test in the Test Se quence Rearranging the Test list 97 e L Test editor Details Firmwares Machine configuration Link configuration External data configuration Using datafile ScopeData txtwith the following columns used e Va evb evc ela eb Omega_out
75. rties to show e Groups Nothing happens by clicking on groups The main pane 45 2 5 2 Project Dictionaries view The Project Dictionaries view lets you manage the dictionaries of all the relevant project items defined in the current TestBench Each panel from left to right and from top to bottom containes the following dic tionaries e the Dictionary of firmware variables subroutines cfr sec 4 1 e the Dictionary of processor I O signals cfr sec 4 2 e the Dictionary of processor implementations cfr sec 4 3 e the Dictionary of external data files cfr sec 4 6 e the Dictionary of runtime firmware subroutines substitutions cfr sec 4 4 e the Dictionary of firmware implementations cfr sec 4 5 e the Dictionary of post process scripts cfr sec 4 7 Posiprocess scripts Figure 2 12 The Project Dictionaries view 46 Interface Overview TT Sinhtumeica plab 2010 ES ii procedure Test sequences Simulation Network Help MPLAB X Figure 2 13 The Debug Procedures view 2 5 3 Debug Procedures view The Debug Procedures view lets you manage the debug procedures for the current test bench The list on the left pane displays the available debug procedures you can click the New Debug Procedure button at the bottom to create a new one or click an existing one to show the instructions it is com posed of and use the buttons at the bottom to rename or d
76. s button Specify the string you want to search in the Search text field select one of the two result display modes and click Ok to perform the search e search reports and show list looks for matches with the spec ified string and displays a list of the Reports containing any matches you may then pick which Reports to open by selecting them on the list press CTRL while clicking them for multiple selections and clicking Choose e search reports and open them looks for matches with the spec ified string and automatically open all of the Reports containing Test Reports 115 any matches 7 6 3 Report Groups management Report Groups are created by default when you execute a whole Test Sequence a Report generated by the execution of a single Test that is by using the Launch just 1 test in the sequence setting by de fault does not belong to any Report Groups Double click on a Group to expand or collapse it expanding a Group shows a list of the Reports it contains Select a set of Reports press CTRL while clicking the single Reports for multiple selection and click the Create button to create a new group containing the selected Reports select an existing group and click Rename to rename it select an existing group and click Dissolve to remove the Group only the Reports it contained will become single Reports select an existing group and click Delete to remove the Group and delete the Reports it contains 116 Co Simul
77. sor I O signals Inged A SalJeUOy5Ip paloig B Japow aulpeln LY state_monitor Ly PORTG Ly PORTB Ly ReadADCParm qADValue vy ParkParm y ADC1BUFO run stop button SpeedDemand pot PWM1H PWMI1L PWM2H PWM2L y AD1CON4 y TIMER3 y AD1CHSO y AD1CON2 y ADC1BUF3 Wy bypass_ADC y ADC1BUF2 Variable Subroutine alias Name ReadADCParm qk eS ok Cancel ReadADCParm qK y ADC1BUF1 vy PDC1 y SVGenParm iPWMPeriod Ly SVGenParm qVri Ly ParkParm qld Ly ParkParm qlq y ParkParm gAngle wwf AVdd AVss CLKI CLKO theta omega theta_est omega_est Figure 4 1 Here it is the list of firmware variable subroutine aliases at the left bottom there are four buttons to create a variable blue star create a subroutine yellow star modify the selected vari able subroutine pencil delete the selected variable subroutine thrash then press OK to actuate the selected action or cancel to abandon it 4 2 Dictionary of processor I O signals In order to create modify or delete an alias of a processor I O signal for brevity pin alias see sec 3 3 2 Dictionary of processor implementations 73 4 3 Dictionary of processor implementations In order to create modify or delete a processor implementation use the panel and the buttons indicated in Figure 4 2 The editor is shown in Figure 4 3 Processor implementations dsPIC v
78. st bench Machine buttons e new component e new embedded platform e new link e edit item e remove item Zoom bar You can use this scroll bar to select the zoom level for the graph Move the slider to the left to zoom out and move it to the right to zoom in 38 Interface Overview 2 4 The Tool bar for the Simulation View Simulation buttons e start simulation e debug simulation e pause current simulation e resume current simulation e abort current simulation e open simulation docs The main pane 39 2 5 The main pane Use the Navigation Bar to choose between the Machine view the Project Dictionaries view the Debug Procedures view the Test Sequences view and the Simulation view for the main pane 2 5 1 Machine view SimNumerica pLab 2010 File Machine Debug procedure Test sequences Simulation Working notes Reports Help S E EAA IC J a mi T i gt O 2 Ge p Machine mask s lt No machine mask gt y pe L 4 E 3 sal EN a embedde lt No Formula available gt o pa T is oo Al v ie 8 2 0S qe Machine details A q E di Description z a q Parameters A generat shape HE 2 e ch 1 0 3 ymax 4 0 5 Vmin 1 0 Z Y a 3 E a 3 gt Model Ih Graph 291494 MB ADC_Polling_SingleCony 4 Figure 2 9 The Machine view The Machine view is used to show and edit the machine you re cur rently working on This view is split in two main panes the left one
79. sume the current simulation inactive if no simulations are active and paused See also 7 2 2 Cancel abort the current simulation inactive if no simulations are ac tive See also 7 2 3 Docs open the workbench notes and test reports managers Interface Overview 36 2 1 6 Help menu SimNumerica Lab 2010 File Machine Debug procedure Test sequences Simulation Working notes Reports sels L H au sa a 7 a i Help online F1 Java system properties 4 OS environment variables Ll About Ctri A ka lt No formula ava u E a embedde a Figure 2 7 The Help menu The Help menu figure 2 7 lets you access various assistance tools Online Help open the integrated uLab Online Help MONDO SEE 2 FOR MORE INFO AND SUGGESTIONS ON HOW TO USE IT EFFEC TIVELY Java system properties open a viewer that lists the Java properties of your system Cannot be used to modify their values OS environment variables open a viewer that lists the environment variables of your system Cannot be used to modify their values About show an informative popup about pLab The Tool bar 37 2 2 The Tool bar The Tool bar provides quick shortcuts for the most commonly used func tions of the Menu bar It changes with the view selected in the Naviga tion Bar as described in the following sections 2 3 The Tool bar for the Machine View Figure 2 8 The Tool bar Test bench buttons e new test bench e load te
80. t from the Machine menu or press the button shown in Fig ure 3 3 to open the Component creation wizard Figure 3 4 The first A Figure 3 3 Press the New component button to create a new component and add it to the current machine page of the wizard allows you to specify the name required and add a brief description optional of the new component then press Next New component model gt Name and Description Specify component name and description Name 1 Name and Description 2 Model type 3 N ical model Description arameters and Variables Pins and Plugs Cancel Figure 3 4 Name and description of the new component 3 2 2 Model type Now choose an available model type and then press Next In this re lease of the software we consider only the Python model type 56 Machine Process Modelling New component model x Model type Choose the component model type Choose the model type among these 1 Name and Descripti 2 Model type e Python 5 3 Numerical model The muLab component is modeled by Python equations 4 Parameters and Variabli 5 Pins and Plugs lt Back e s Cancel Figure 3 5 Model type of the new component 3 2 3 Numerical model The following step of the wizard requires you to formulate the numerical model of the new component Once you ve decided the model type you may have to specify some additional settings This operation is strongly dependent fro
81. tarting Simulation 7 1 1 Test selection 7 1 2 Machine configuration 7 1 3 Links configuration 7 1 4 Debug components Simulation flow 7 2 1 Pausing Simulations 7 2 2 Resuming Simulations 7 2 3 Aborting Simulations Data visualization 7 3 1 Data view 7 3 2 Chart view 7 3 3 Animation view 7 3 4 Debug view Co simulation logs Post Processing 7 6 1 Reports Manager 7 6 2 Text search tools Contents Contents 7 6 3 Report Groups management 7 7 Working NOTES re 2 4 304 4 ae SO Se ew aR les Contents Chapter 1 Getting Started This chapter describes the preliminary steps you should perform to start using pLab uLab is meant to be executed as a cloud application providing the following advantages for its end users e since all the heavy work is being performed in the cloud server the only system requirement we demand from the developer per spective is a reasonable internet connection actually a common standard connection is sufficient to smoothly interact with wLab e because of this you don t need to update any of your computer hardware e furthermore because all of your projects run in a cloud server you can access and work on them from any locations and devices e multiple access are allowed to give to a distributed teamwork the possibility to interact within the same simulation Let us describe all the steps needed to get uLab up and running as well to provide safety and security to a
82. the Menu Bar e the Toolbar e the Main Pane e the Status Bar and includes a WYSIWYG text editor for writing notes and examining test reports see 2 18 during your Lab work session This chapter explains how to navigate the dashboard and access all of the main pLab functionalities you can find specific details in the corresponding sections 28 Navigation pane Interface Overview Tool bar Menu bar SimNumerica plab amp 2010 Fie Machine Debug procedufe Test sequences Simulation Working notes Help LE Aass a _ _ Q um Machine mask a lt No machine rr Mo Formul 4 EE Machine details ID Name Description Model Main pane Status bar Figure 2 1 The main ppLab dashboard The menu bar 29 2 1 The menu bar The menu bar contains several menus used to manage the contents of your machine and your tests 2 1 1 File menu SimNumerica Lab 2010 j Machine Debug procedure Test sequences Simulation Working motes Reports Help New test bench Ctrl N a A I S GT r oa E T Load test bench Ctrl L pu Machine mask y About current test bench lt No machine mask gt Quit Ctrl Q I M embedde lt No formula ava Figure 2 2 The File menu Bult The File menu figure 2 2 is used to manage your test bench files New test bench create a new empty test bench See also 3 1 1 for a detailed walkthrough Load test bench l
83. tinue the simulation until the following breakpoint is reached see Figure 7 15 Click the Memories button to show a watch table for variables data Figure 7 16 110 Co Simulations run epow supen 4 saueuogap pefo E saunpazo d Bngeq i saauanbas 358 1 Ea pu 3 2 8 Status details Running simulation loop Global time 0 001000s Working dir moTestBenchidemoAN1078_di_Paolo Data ki Chart MM Animation A Post process El Docs controller Firmware Python routines dsPIC33EP256MC506 control h dsPIC33EP256MC506 RTDM h dsPIC33EP256MC506 pi h A ee dsPIC33EP256MC506 RTDM c I dsPIC33EP2561 uart h dsPIC33EP256MC506 CalcRef s dsPIC33EP256MC506 UserParms h dsPIC33EP256MC506 MeasCurr s dsPIC33EP256MC506 smcpos c dsPIC33EP256MC506 svgen h dsPIC33EP256MC506 pi s dsPIC33EP256MC506 SVGEN S dsPIC33EP256MC506 ReadADC h dsPIC33EP256MC506 smcpos h dsPIC33EP256MC506 atan2CORDIC s i dsPIC33EP256MC506 park h dsPIC33EP256MC506 parms h dsPIC33EP256MC506 smc s dsPIC33EP256MC506 InvPark s dsPIC33EP256MC506 initdspic c dsPIC33EP256MC506 FdWeak h dsPIC33EP256MC506 PMSM c dsPIC33EP256MC506 RTDMUSER h dsPIC33EP256MC506 FdWeak c dsPIC33EP256MC506 general h dsPIC33EP256MC506 ReadADCO s dsPIC33EP256MC506 clrkpark s Address Code Execution 1047 CH1 positive input is CMPO CH2 positive input is CMP1 CH3 positi
84. tion 4 Links activation status 5 Debug components Select the test sequence containing the test you want to debug TA prova Ee 2 test s Back Next gt Cancel Je Figure 7 3 Choose a test sequence from the list and click Next Test Select the test you want to debug X gt 1 Test sequence 2 Test 3 Machine initial configuration 4 Links activation status 5 Debug components sinusoide 7q Duration 1 0 sec s Sampling period 0 0010 sec s Main debug procedure dummy 4 s Duration 5 0 secs Sampling period 0 0050 sec s Main debug procedure dummy costante Duration 5 0 sec s Sampling period 0 0010 sec s Main debug procedure dummy gradino Duration 0 4 sec s Sampling period 0 0020 sec s Main debug procedure dummy rampa Duration 2 5 sec s Sampling period 0 0010 sec s Main debug procedure dummy python Duration 10 0 sec s Sampling period 5 0E 5 sec s Main debug procedure void python PWM Duration 10 0 sec s Sampling period 5 0E 5 sec s Main debug procedure void n PWM startup ram Duration 1 5 sec s Sampling period 5 0E 5 sec s Main debug procedure void python PWM estimator startup ramp as WH gt ada AAA Figure 7 4 Select the test you want to execute and click Next 7 1 2 Machine configuration 101 Machine variables and parameters are displayed in a tree structured ta ble group
85. to con tinue 6 2 Renaming a Test Sequence To rename a test sequence select it from the list and click the Edit test sequence button 90 Test Sequences Design m prova cambio Ts E Y 2 test s Duration 5 0 sec s Sampling period 0 0050 sec s Main debug procedure dummy os ra SS Br 9 test s Duration 5 0 sec s Sampling period 0 0010 seq s Main debug procedure dummy a 2 FL IA gradino Q 1 test s Duration 0 4 sec s Sampling period 0 0020 sec s Main debug procedure dummy BEL rampa y 1 tests Duration 2 5 sec s Sampling period 0 0010 sec s Main debug procedure dummy a sinusoide a Duration 1 0 sec s Sampling period 0 0010 seq s Main debug procedure dummy T a python A Duration 10 0 sec s Sampling period 5 0E 5 sec s Main debug procedure void El T python PWM a Duration 10 0 sec s Sampling period 5 0E 5 sec s Main debug procedure void python PWM estimator startup ramp Duration 10 0 sec s Sampling period 5 0E 5 sec s Main debug procedure void sainpazoid ngaa A I D B gt o o a i lu 3 A o DB uo ens Figure 6 1 The Test Sequences View there are two vertical sections that show the list of the existing Test Sequences left and the list of the Tests right defined in the selected Test Sequence 6 3 Deleting a test sequence To delete a test sequence select it and click the R
86. ugs and wires Target plug dh VDD 0 parameter s 4 vw BD Plug PowerSupply 4 pins Y Wires Drag source pin and drop it on the target pin to create a wire e AVDD V Microp pin e AVSS V Microp pin e VDD V Microp pin 8 vss v Microp pin VDD V Output VSS V Output AVDD V Output Autoconnect Clear lt Back Next Finish Cancel Figure 3 22 The selected plugs are compatible drag the output microp pins to the input microp pins to create wires Press Finish when done New link EI Plugs and wires Q Specify source plug target plug and wires e 1 Name and description 2 Plugs and wires Source plug M1 0 parameter s 0 Target plug d Output Width 0 v JB Plug PowerSupply 4 pin s Y y J Plug OW 1 pin s Plugs selected are not compatible X lt Back Next Finish jl Cancel Figure 3 23 The selected plugs are not compatible for connection 3 5 Groups Selecting multiple components by either clicking them one by one while pressing ctrl or shift or by doing a rectangle selection enables the group Groups 69 command on the toolbar 404 Image not found Figure 3 24 Drag a box around the components you want to group You may now press the Group button to group them Upon creating a group you ll be asked for a group name cannot be blank 404 Image not found Figure 3 25 Specify the name o
87. ution press the the rightmost button thrash icon Firmware subroutine runtime substitutions with Python functions Firmware subroutine Arguments RAM vars and processor pins Python module Python function bypass_ADC ADC1BUFO ADC1BUF2 ADC1BUF3 SpeedDemand po a ADC py updateADCBUF control_algo theta omega PWM1H PWM2H PVWM3H V_ia V_ib Sp control_algo py i control_algo PWM1H PWMI1L PWM2H PWM2L PWM3H PWM3L o control_algo_con_P main control_algo V_ia V_ib theta omega PWM1H PWM2H PWM3H ru a control_algo_con_P main control_algo V_ia V_ib PWM1H PWM2H PWM3H run stop button control_algo_con_P main J L Choose the subroutine from the list eS y bypass_ADC Wy control_algo nex A o J Choose Cancel Figure 4 5 Select the alias of the firmware function to be substituted and press Choose to confirm the selection or cancel to discard it 76 Project Dictionaries Design Firmware subroutine runtime substitutions with Python functions Firmware subroutine alias Arguments Fw variables and pins alias model params Python module Python function bypass_ADC ADC1BUFO ADC1BUF2 ADC1BUF3 SpeedDemand pot V_ia V A ADC py updateADCBUF control_algo theta omega PWM1H PWM2H PWM3H V_ia V_ib SpeedDem a control_algo py _ main controlalgo PWM PWMIL PWM2H PWM2L PWM3H PWM3L omega the a control_algo_co main control_algo via
88. ve input is CMP2 a 1048 ADICHS123bits CH1235A 1 1049 1050 ADCSSL ADC Input Scan Select Register 1051 ADICSSL 1052 1053 Turn on A D module 1054 AD1ICONIbits ADON 1 1055 1056 ifdef ENVOLTRIPPLE 1057 1058 CHO is AN10 for VDC 1059 ADICHSObits CHOSA 10 1060 Wait until first conversion takes place to measure offsets 1061 DebounceDelay 1062 Target DC Bus without sign 1063 TargetDCbus SFRAC16 ADCIBUFO gt gt 1 Q15 0 5 1064 1065 CHO is AN13 for POT 1066 ADICHSObits CHOSA 13 1067 uGF bit ADCHO_PotOrVde 0 1068 1069 endif 1070 1071 Wait until first conversion takes place to measure offsets DS 1073 1074 fault enabled 1075 FCLCON1 0x005C Fault enabled Fault SRC Comparator 4 0 P 1076 gt 1077 FCLCON3 0x005C Fault enabled Fault SRC Comparator 4 O 1078 1079 Initial Current offsets X Logs Memories _ amp Search subroutine step Continue for Skip Continue 49 python PWM startup ramp simulation 0 gt rampa simulation 1 Figure 7 14 simulation Active breakpoints in the embedded firmware co Figure 7 15 Debug control buttons El 1069 fendif 1070 El 1071 Wait until first conversion takes place to measure offsets a oe
89. w also supports Simulation Masks analogue to Ma chine Masks they can be used to filter the values shown in the tables which is especially useful when dealing with complex models described by large quantities of data Data visualization 107 7 3 2 Chart view The chart view gives you a real time graphical representation of the model variables and parameters updated instant by instant while the Test is being executed The timeline starts at the beginning of the simulation Status details Running simulation loop Global time 0 102750 s Working dir moTestBench demoAN1078_di_Paolo Data Chart Wi Animation d Debug 7 Post process Docs z 1 10E01 f 1 70E01 controller ES 1 60E01 1 00E01 4 5 oe Poe H loa m 3 1 50E01 3 75E01 9 00E00 h Bea po a 1 40E01 V o Vb V a 8 00E00 h ui 3 5001 A V Mu 1 20E01 7 00E00 V la A 1 10E01 V A 6 00E00 B 00E0 cal i a Vic gi 5 000 y ceca m Bao 90551 4 00800 Vi a 7 00E j V 5 6 00E00 2 75601 3 0000 VV omega_m rpm S DOE00
90. xt to continue Embedded Platforms 63 L jM1 eS Details Pinout Plugs Name M1 Description Ok Cancel Figure 3 16 Select New Embedded Platform to create a new Embed ded Platform and add it to the current machine S controller p lt z Details Pinout Plugs E A El Jserinterface Name Signal Adapter R run stop button la a SpeedDemand pot SN z b tons PWM1H Output duty cycle frequency 20 000 Hz PWMIL PWM2H Output duty cycle frequency 20 000 Hz mM gA ewm 3 PWM3H Output duty cycle frequency 20 000 Hz a es tt PWM3L T A controll ye l 3 N V_overcurreni t E Vdd E Vss Input voltage voltage 0 V estati AVdd AVsS KI Clock frequency frequency 8 000 000 PowerSupply CLKO Clock frequency frequency 8 000 000 seunpazoid Bngeq A o e a Ok Cancel aa Figure 3 17 Setup the pinout of the embedded platform 3 3 2 Pinout The pinout configuration lets the user to create modify or delete the items of the Dictionary of processor I O signals for brevity pin alias and to setup the adapters for these items The Name column displays the name of the pin alias The value on the Signal column shows the name of the model variable connected to each pin by a link it s empty if the pin isn t connected to 64 Machine Process Modelling any components The Adapter column lets you specify an
91. xternal datafile the user should specify a name the datafiles involved in this reference usually there is a single datafile and the bindings of each column of data with the corresponding project item that can be items of the Dictionary of firmware variables sec 4 1 items of the Dictionary of the processors I O signals and model parameters and variables sec 3 2 4 Postprocess scripts max velocity error Figure 4 13 Here it is the list of the postprocessing scripts existing in the project at the left bottom there are three buttons to create modify or delete the selected implementation Dictionary of post process scripts Postprocessing alias Name max velocity error Script 1 import numpy as np from postprocess util import setPostprocessPath testBenchPostprocessPath x np array 1 2 3 Y np array 3 2 4 1 plotFigure x y traiettoria Check syntax UT_DIRS mulab core 3 0 demoT estBench demoAN1078_di_Paolo maxvelerr py mj Ok at Cancel 81 Figure 4 14 The editor of a postprocessing script the user should spec ify a name the python file containing the postprocessing script and write the python code of the script 82 Project Dictionaries Design Chapter 5 Debug Procedures Design Use the navigation bar from the main pLab dashboard to access the Debug Procedures View sec 2 5 3 it allows the user to design the De bug Procedures to be used in the pr
Download Pdf Manuals
Related Search
Related Contents
取扱説明書 改訂第1版 Descarga el manual G-scan取扱説明書(ホンダ編)第15版 User Manual - Kollmorgen Network Technologies Console Switch User's Manual MIIX 3-830 UG GR - CNET Content Solutions Silent TS - US Dental Depot PPMS mode d`emploi v2 - Circonscription de St Gilles Croix de Vie Betriebsanleitung Operating Instructions Bruksanvisning Notice d Copyright © All rights reserved.
Failed to retrieve file