├── CodeGen ├── SAMD21 │ ├── lib │ │ └── README │ └── .gitignore ├── STM32H7 │ ├── lib │ │ └── README │ ├── objects │ │ ├── obj │ │ │ └── README │ │ ├── inc │ │ │ ├── stm32h7xx.h │ │ │ └── stm32h7xx_hal_fdcan.h │ │ ├── srcHAL │ │ │ ├── stm32h7xx_hal_cryp.c │ │ │ ├── stm32h7xx_hal_wwdg.c │ │ │ └── stm32h7xx_hal_cryp_ex.c │ │ └── set_dir.py │ ├── include │ │ ├── stm32SPI4.h │ │ └── stm32Fun.h │ ├── .gitignore │ ├── OTG │ │ ├── obj │ │ │ └── Makefile │ │ ├── Makefile │ │ └── usb_files.txt │ └── Makefile ├── LinuxRT │ ├── fmu │ │ ├── lib │ │ │ └── README │ │ └── fmuinc │ │ │ ├── include │ │ │ ├── fmi2Functions.h │ │ │ ├── fmi2FunctionTypes.h │ │ │ └── fmi2TypesPlatform.h │ │ │ └── fmu_fun.h │ ├── lib │ │ └── README │ ├── .gitignore │ └── devices │ │ └── .gitignore ├── Common │ ├── CAN_dev │ │ └── .gitignore │ ├── include │ │ ├── commonFun.h │ │ ├── matop.h │ │ └── canopen.h │ ├── common_dev │ │ └── commonFun.c │ └── rules │ │ └── make-ulut.inc ├── tos1a │ ├── .gitignore │ ├── includes │ │ └── tos1a.h │ └── .editorconfig ├── Raspberry_PI │ ├── .gitignore │ ├── include │ │ ├── spiconfADC.h │ │ ├── spiconfIMU.h │ │ └── rpi_gpclk.h │ └── lib │ │ └── README ├── arduinoFirmata │ ├── .gitignore │ ├── tools │ │ └── FirmataTest │ │ │ ├── .gitignore │ │ │ └── test.c │ ├── .editorconfig │ ├── includes │ │ └── arduino_firmata.h │ └── src │ │ └── help_TCLab_temperature.c ├── linux_mz_apo │ ├── devices │ │ └── README.md │ ├── include │ │ ├── spiconfADC.h │ │ └── spiconfIMU.h │ ├── .gitignore │ └── lib │ │ └── README ├── nuttx │ └── .gitignore └── templates │ ├── nuttx.tmf │ ├── nuttx_timerhook.tmf │ ├── nuttx_systemtickhook.tmf │ └── templates.txt ├── .gitignore ├── toolbox ├── supsisim │ └── supsisim │ │ ├── __init__.py │ │ ├── const.py │ │ └── shv │ │ ├── __init__.py │ │ └── SHVInstance.py ├── supsictrl │ └── supsictrl │ │ └── __init__.py └── .gitignore ├── userLib ├── dummy.c ├── userpyblk.a └── Makefile ├── ExtLibs ├── .gitignore ├── config │ ├── ulut-git.url │ ├── ulut-version.sha │ ├── shv-libs4c-version.sha │ └── shv-libs4c-git.url └── README.txt ├── Book ├── eps │ ├── #rena.sh# │ ├── aw.png │ ├── blocks.pdf │ ├── bode.pdf │ ├── ctrmot.pdf │ ├── disks.pdf │ ├── libs.png │ ├── lsim.pdf │ ├── motid.pdf │ ├── pyedit.pdf │ ├── pzmap.pdf │ ├── rlocus.pdf │ ├── rtout.pdf │ ├── simout.pdf │ ├── step1.pdf │ ├── step1.png │ ├── disksrt.pdf │ ├── disksrt.png │ ├── diskssim.pdf │ ├── diskssim.png │ ├── exa_plot.pdf │ ├── impulse.pdf │ ├── initial.pdf │ ├── nichols.pdf │ ├── nyquist.pdf │ ├── pendinv.jpg │ ├── pendinv.pdf │ ├── pendolo.pdf │ ├── stepresp.pdf │ ├── xblk2Blk.pdf │ ├── BallOnWheel.pdf │ ├── bodeplant.pdf │ ├── bodeplantpi.pdf │ ├── defBlocks.pdf │ ├── dstepresp.pdf │ ├── env_pyEdit.eps │ ├── env_pyEdit.pdf │ ├── exa_final.eps │ ├── exa_final.pdf │ ├── exa_step1.eps │ ├── exa_step1.pdf │ ├── exa_step2.eps │ ├── exa_step2.pdf │ ├── gendialog.png │ ├── pidexastep.pdf │ ├── squareblk.png │ ├── bodeplantpilead.pdf │ ├── bodeplantpileadK.pdf │ └── rena.py ├── BookPythonForControl.pdf └── .gitignore ├── resources ├── blocks │ ├── rcpBlk │ │ ├── help │ │ │ └── noHelp.hlp │ │ ├── dialogs │ │ │ └── plotDlg.py │ │ ├── output │ │ │ ├── nullBlk.py │ │ │ ├── printBlk.py │ │ │ ├── plotBlk.py │ │ │ ├── loggerBlk.py │ │ │ ├── toFileBlk.py │ │ │ ├── ledStream.py │ │ │ ├── scopeStream.py │ │ │ └── plotJugglerBlk.py │ │ ├── SAMD21 │ │ │ ├── ImuAccBlk.py │ │ │ ├── ImuGyroBlk.py │ │ │ ├── toESP32Blk.py │ │ │ ├── ImuTempBlk.py │ │ │ ├── brikiRGBBlk.py │ │ │ ├── brikiLuxBlk.py │ │ │ ├── brikiRangeBlk.py │ │ │ ├── fromESP32Blk.py │ │ │ ├── brikiSerialInBlk.py │ │ │ ├── brikiSerialOutBlk.py │ │ │ ├── brikiAOBlk.py │ │ │ ├── brikiAIBlk.py │ │ │ └── brikiESCBlk.py │ │ ├── input │ │ │ ├── getTimerBlk.py │ │ │ ├── sweepBlk.py │ │ │ ├── stepBlk.py │ │ │ ├── constBlk.py │ │ │ ├── sineBlk.py │ │ │ └── squareBlk.py │ │ ├── AR2INO │ │ │ ├── ar2inoSetupBlk.py │ │ │ ├── ar2inoENCBlk.py │ │ │ ├── ar2inoDOBlk.py │ │ │ ├── ar2inoAIBlk.py │ │ │ ├── ar2inoDIBlk.py │ │ │ ├── ar2inoPWMBlk.py │ │ │ └── ar2inoAOBlk.py │ │ ├── Communication │ │ │ ├── SHVInputBlk.py │ │ │ ├── SHVOutputBlk.py │ │ │ ├── serialInBlk.py │ │ │ ├── serialOutBlk.py │ │ │ ├── UDPsocketTxBlk.py │ │ │ ├── UDPsocketRxBlk.py │ │ │ ├── serialOutFloatBlk.py │ │ │ ├── shmemInBlk.py │ │ │ ├── shmemOutBlk.py │ │ │ ├── serialInFloatBlk.py │ │ │ ├── unixsocketCBlk.py │ │ │ ├── unixsocketSBlk.py │ │ │ └── TCPsocketTxBlk.py │ │ ├── Math │ │ │ ├── divBlk.py │ │ │ ├── moduloBlk.py │ │ │ ├── maxFromNInputs.py │ │ │ ├── minFromNInputs.py │ │ │ ├── park_forwardBlk.py │ │ │ ├── park_inverseBlk.py │ │ │ ├── clarke_inverseBlk.py │ │ │ ├── hall3ph2secBlk.py │ │ │ ├── prodBlk.py │ │ │ ├── relBlk.py │ │ │ └── pmsm_alignBlk.py │ │ ├── arduinoFirmata │ │ │ ├── setup_af.py │ │ │ ├── help_TCLab_temperature.py │ │ │ ├── pinRead_af.py │ │ │ ├── customRead_af.py │ │ │ ├── digitalWrite_af.py │ │ │ ├── encoderRead_af.py │ │ │ ├── analogWrite_af.py │ │ │ └── help_HeatShield_temperature.py │ │ ├── can_Faulhaber_3XXX │ │ │ ├── FH_3XXX_INIT_Blk.py │ │ │ ├── FH_3XXX_VBlk.py │ │ │ ├── FH_3XXX_ENCBlk.py │ │ │ ├── FH_3XXX_getVBlk.py │ │ │ ├── FH_3XXX_XBlk.py │ │ │ ├── FH_CO_MotXBlk.py │ │ │ └── FH_3XXX_ADBlk.py │ │ ├── can_Faulhaber_5XXX │ │ │ ├── FH_5XXX_INIT_Blk.py │ │ │ ├── FH_5XXX_VBlk.py │ │ │ ├── FH_5XXX_ENCBlk.py │ │ │ ├── FH_5XXX_getVBlk.py │ │ │ ├── FH_5XXX_getTQBlk.py │ │ │ ├── FH_5XXX_setTQBlk.py │ │ │ ├── FH_5XXX_XBlk.py │ │ │ └── FH_5XXX_ADBlk.py │ │ ├── Raspberry │ │ │ ├── P3MotBlk.py │ │ │ ├── AccelBlk.py │ │ │ ├── GyroBlk.py │ │ │ ├── pi_ADBlk.py │ │ │ ├── pwmBlk.py │ │ │ └── compFiltBlk.py │ │ ├── linux_mz_apo │ │ │ ├── mz_apo_3pmdrv1.py │ │ │ ├── mz_apo_DCmotBlk.py │ │ │ └── mz_apo_ENCBlk.py │ │ ├── STM32H7 │ │ │ ├── stm32ENCBlk.py │ │ │ ├── USB_OTG_OutBlk.py │ │ │ ├── stm32AOBlk.py │ │ │ ├── stm32AIBlk.py │ │ │ ├── stm32PWMBlk.py │ │ │ └── USB_OTG_InBlk.py │ │ ├── can_Maxon │ │ │ ├── init_epos_MotIBlk.py │ │ │ ├── epos_MotIBlk.py │ │ │ ├── epos_MotXBlk.py │ │ │ ├── epos_areadBlk.py │ │ │ ├── maxon_MotBlk.py │ │ │ ├── epos_EncBlk.py │ │ │ └── maxon_EncBlk.py │ │ ├── NuttX_sensors │ │ │ └── nuttx_DHTXXBlk.py │ │ ├── can_generic │ │ │ ├── can_gen_recvBlk.py │ │ │ ├── can_sdo_sendThBlk.py │ │ │ ├── can_sdo_recvBlk.py │ │ │ └── baumer_EncBlk.py │ │ ├── nonlin │ │ │ ├── upowBlk.py │ │ │ ├── deadzoneBlk.py │ │ │ ├── switchOutBlk.py │ │ │ ├── absBlk.py │ │ │ └── genericBlk.py │ │ ├── NuttX │ │ │ ├── nuttxDOBlk.py │ │ │ ├── nuttx_DACBlk.py │ │ │ ├── P3MotNuttxBlk.py │ │ │ ├── nuttxDIBlk.py │ │ │ ├── nuttxSerialOutBlk.py │ │ │ └── nuttxENCBlk.py │ │ ├── tos1a │ │ │ └── tos1a.py │ │ ├── comedi │ │ │ ├── comediDABlk.py │ │ │ ├── comediDOBlk.py │ │ │ ├── comediADBlk.py │ │ │ ├── comediDIBlk.py │ │ │ └── comediPWMBlk.py │ │ └── linear │ │ │ └── discretePIDBlk.py │ ├── .gitignore │ ├── blocks │ │ ├── common.blks │ │ ├── SAMD21 │ │ │ ├── IMUAcc.xblk │ │ │ ├── IMUGyro.xblk │ │ │ ├── IMUTemp.xblk │ │ │ ├── brikiSerialIn.xblk │ │ │ ├── brikiSerialOut.xblk │ │ │ ├── toESP32.xblk │ │ │ ├── fromESP32.xblk │ │ │ ├── brikiRGB.xblk │ │ │ ├── brikiLux.xblk │ │ │ ├── brikiRange.xblk │ │ │ ├── brikiDI.xblk │ │ │ ├── brikiEcho.xblk │ │ │ ├── brikiDCMot.xblk │ │ │ ├── brikiDO.xblk │ │ │ ├── brikiAO.xblk │ │ │ ├── brikiAI.xblk │ │ │ ├── brikiESC.xblk │ │ │ └── brikiPWM.xblk │ │ ├── Communication │ │ │ ├── shv_input.xblk │ │ │ ├── shv_output.xblk │ │ │ ├── SHMEMin.xblk │ │ │ ├── SHMEMout.xblk │ │ │ ├── serialIn.xblk │ │ │ ├── serialOut.xblk │ │ │ ├── serialInFloat.xblk │ │ │ ├── serialOutFloat.xblk │ │ │ ├── unixSkClient.xblk │ │ │ ├── UDPsocketTX.xblk │ │ │ ├── TCPsocketTXRX.xblk │ │ │ ├── UDPsocketRX.xblk │ │ │ ├── unixSkServer.xblk │ │ │ └── TCPsocketAsyncBlk.xblk │ │ ├── Math │ │ │ ├── Prod.xblk │ │ │ ├── Maximum.xblk │ │ │ ├── Minimum.xblk │ │ │ ├── Div.xblk │ │ │ ├── clarke_inverse.xblk │ │ │ ├── mod.xblk │ │ │ ├── Sub.xblk │ │ │ ├── Sum.xblk │ │ │ ├── hall3ph2sec.xblk │ │ │ ├── clarke_forward.xblk │ │ │ ├── park_inverse.xblk │ │ │ ├── park_forward.xblk │ │ │ └── Rel.xblk │ │ ├── linear │ │ │ ├── Der.xblk │ │ │ ├── Gain.xblk │ │ │ ├── Integral.xblk │ │ │ ├── Delay.xblk │ │ │ ├── DiscretePID.xblk │ │ │ ├── Init_enc.xblk │ │ │ ├── LTI_continous.xblk │ │ │ └── LTI_discrete.xblk │ │ ├── nonlin │ │ │ ├── Abs.xblk │ │ │ ├── UPOW.xblk │ │ │ ├── Trig.xblk │ │ │ ├── deadzone.xblk │ │ │ ├── Saturation.xblk │ │ │ ├── antideadzone.xblk │ │ │ ├── Lookup.xblk │ │ │ ├── SwitchOut.xblk │ │ │ └── Switch.xblk │ │ ├── input │ │ │ ├── Const.xblk │ │ │ ├── Timer.xblk │ │ │ ├── Step.xblk │ │ │ ├── triangle.xblk │ │ │ ├── Sine_wave.xblk │ │ │ ├── sweep.xblk │ │ │ ├── PulseGenerator.xblk │ │ │ └── Extdata.xblk │ │ ├── AR2INO │ │ │ ├── ar2inoDI.xblk │ │ │ ├── ar2inoENC.xblk │ │ │ ├── ar2inoSetup.xblk │ │ │ ├── ar2inoDO.xblk │ │ │ ├── ar2inoAI.xblk │ │ │ ├── ar2inoPWM.xblk │ │ │ └── ar2inoAO.xblk │ │ ├── STM32H7 │ │ │ ├── stm32DI.xblk │ │ │ ├── stm32ENC.xblk │ │ │ ├── stm32DO.xblk │ │ │ ├── USB_OTG_In.xblk │ │ │ ├── USB_OTG_Out.xblk │ │ │ ├── stm32AO.xblk │ │ │ ├── stm32SPI.xblk │ │ │ └── stm32PWM.xblk │ │ ├── NuttX │ │ │ ├── nuttx_DAC.xblk │ │ │ ├── microros.xblk │ │ │ ├── nuttxDI.xblk │ │ │ ├── P3MotorNuttx.xblk │ │ │ ├── nuttxSerialOut.xblk │ │ │ ├── nuttxDO.xblk │ │ │ ├── nuttx_PWM.xblk │ │ │ ├── nuttxENC.xblk │ │ │ └── nuttx_ADC.xblk │ │ ├── output │ │ │ ├── Print.xblk │ │ │ ├── toFile.xblk │ │ │ ├── streamLed.xblk │ │ │ ├── Logger.xblk │ │ │ ├── Plot.xblk │ │ │ ├── streamPlot.xblk │ │ │ ├── PlotJuggler.xblk │ │ │ └── Null.xblk │ │ ├── arduinoFirmata │ │ │ ├── digitalWrite_af.xblk │ │ │ ├── help_tcLab_temperature.xblk │ │ │ ├── encoderRead_af.xblk │ │ │ ├── customRead_af.xblk │ │ │ ├── setup_af.xblk │ │ │ ├── pinRead_af.xblk │ │ │ └── analogWrite_af.xblk │ │ ├── Raspberry │ │ │ ├── P3Motor.xblk │ │ │ ├── PWM.xblk │ │ │ ├── pi_AD.xblk │ │ │ ├── Gyro.xblk │ │ │ ├── ACCEL.xblk │ │ │ └── compFilt.xblk │ │ ├── linux_mz_apo │ │ │ ├── mz_apo_DCmotor.xblk │ │ │ ├── mz_apo_ENC.xblk │ │ │ └── mz_apo_3pmdrv1.xblk │ │ ├── folders │ │ ├── NuttX_sensors │ │ │ └── nuttx_DHTXX.xblk │ │ ├── comedi │ │ │ ├── DI.xblk │ │ │ ├── ENC.xblk │ │ │ ├── comediPWM.xblk │ │ │ ├── DO.xblk │ │ │ ├── AD.xblk │ │ │ └── DA.xblk │ │ ├── can_Maxon │ │ │ ├── Epos_mot_I.xblk │ │ │ ├── Epos_mot_X.xblk │ │ │ ├── Epos_AD.xblk │ │ │ ├── Epos_enc.xblk │ │ │ ├── Maxon_enc.xblk │ │ │ ├── Maxon_mot_I.xblk │ │ │ └── Init_EposMot.xblk │ │ ├── can_Faulhaber_5XXX │ │ │ ├── FH_5XXX_V.xblk │ │ │ ├── FH_5XXX_getV.xblk │ │ │ ├── FH_5XXX_AD.xblk │ │ │ ├── FH_5XXX_getTQ.xblk │ │ │ ├── FH_5XXX_setTQ.xblk │ │ │ ├── FH_5XXX_X.xblk │ │ │ └── FH_5XXX_ENC.xblk │ │ ├── can_Faulhaber_3XXX │ │ │ ├── FH_3XXX_AD.xblk │ │ │ ├── FH_3XXX_V.xblk │ │ │ ├── FH_3XXX_getV.xblk │ │ │ ├── FH_3XXX_X.xblk │ │ │ ├── FH_CO_mot_X.xblk │ │ │ └── FH_3XXX_ENC.xblk │ │ └── can_generic │ │ │ ├── canSDO_RecvMsg.xblk │ │ │ ├── canSDO_SendMsg.xblk │ │ │ ├── Baumer_enc.xblk │ │ │ └── canGeneric_RecvMsg.xblk │ └── Icons │ │ └── REL.svg └── icons │ ├── copy.png │ ├── cut.png │ ├── exit.png │ ├── psc.png │ ├── run.png │ ├── shv.png │ ├── undo.png │ ├── debug.png │ ├── folder.png │ ├── paste.png │ ├── print.png │ ├── python.png │ ├── codegen.png │ ├── filenew.png │ ├── fileopen.png │ ├── filesave.png │ ├── library.png │ ├── refresh.png │ ├── settings.png │ ├── updateimg.png │ ├── edit-clear.png │ ├── filesaveas.png │ ├── help-about.png │ └── ConnectCursor.png ├── Tests └── ControlDesign │ ├── PidExample │ ├── README │ └── pidExample.pdf │ ├── DisksAndSpring │ ├── disks.jpg │ ├── DisksAndSpring.fmu │ └── README │ ├── InvertedPendulum │ └── README │ └── Disks │ └── README ├── BlockEditor ├── gen_pydev ├── broker_conf.toml └── dataplot.py ├── DriverNRT ├── loadnrt └── README.md ├── launch.txt ├── python_libs_install.py └── requirements.txt /CodeGen/SAMD21/lib/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CodeGen/STM32H7/lib/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CodeGen/LinuxRT/fmu/lib/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Link.txt 2 | pysimCoder 3 | -------------------------------------------------------------------------------- /CodeGen/STM32H7/objects/obj/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /toolbox/supsisim/supsisim/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /toolbox/supsictrl/supsictrl/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /userLib/dummy.c: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | } 4 | -------------------------------------------------------------------------------- /CodeGen/Common/CAN_dev/.gitignore: -------------------------------------------------------------------------------- 1 | hbm_df30.c 2 | -------------------------------------------------------------------------------- /CodeGen/tos1a/.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | lib 3 | *.o 4 | -------------------------------------------------------------------------------- /ExtLibs/.gitignore: -------------------------------------------------------------------------------- 1 | libshv 2 | shv-libs4c 3 | ulut 4 | -------------------------------------------------------------------------------- /Book/eps/#rena.sh#: -------------------------------------------------------------------------------- 1 | for j in *.eps 2 | do 3 | mv -v "$j" -------------------------------------------------------------------------------- /CodeGen/Raspberry_PI/.gitignore: -------------------------------------------------------------------------------- 1 | lib/*.a 2 | devices/*.o 3 | -------------------------------------------------------------------------------- /CodeGen/arduinoFirmata/.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | lib 3 | *.o 4 | -------------------------------------------------------------------------------- /CodeGen/arduinoFirmata/tools/FirmataTest/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | -------------------------------------------------------------------------------- /toolbox/.gitignore: -------------------------------------------------------------------------------- 1 | */*/__pycache__ 2 | */*/*/__pycache__ 3 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/help/noHelp.hlp: -------------------------------------------------------------------------------- 1 | No help for this block 2 | -------------------------------------------------------------------------------- /ExtLibs/config/ulut-git.url: -------------------------------------------------------------------------------- 1 | https://git.code.sf.net/p/ulan/ulut.git 2 | -------------------------------------------------------------------------------- /CodeGen/LinuxRT/lib/README: -------------------------------------------------------------------------------- 1 | Folder for the block library 2 | - libpyblk.a 3 | -------------------------------------------------------------------------------- /CodeGen/tos1a/includes/tos1a.h: -------------------------------------------------------------------------------- 1 | void tos1a(int flag, python_block *block) 2 | -------------------------------------------------------------------------------- /ExtLibs/config/ulut-version.sha: -------------------------------------------------------------------------------- 1 | c931ea417a8dbfa57888984a956c49f39214d584 2 | -------------------------------------------------------------------------------- /Tests/ControlDesign/PidExample/README: -------------------------------------------------------------------------------- 1 | run 2 | 3 | python pid_example.py 4 | -------------------------------------------------------------------------------- /ExtLibs/config/shv-libs4c-version.sha: -------------------------------------------------------------------------------- 1 | 149cf26b71c73b9d5f59b5b21d5b079b1a1150c1 2 | -------------------------------------------------------------------------------- /ExtLibs/config/shv-libs4c-git.url: -------------------------------------------------------------------------------- 1 | https://github.com/silicon-heaven/shv-libs4c.git 2 | -------------------------------------------------------------------------------- /Book/eps/aw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/aw.png -------------------------------------------------------------------------------- /CodeGen/LinuxRT/.gitignore: -------------------------------------------------------------------------------- 1 | include-generated 2 | lib/*.a 3 | fmu/lib/*.a 4 | devices/*.o 5 | -------------------------------------------------------------------------------- /CodeGen/SAMD21/.gitignore: -------------------------------------------------------------------------------- 1 | lib/*.a 2 | devices/*.o 3 | devices/*.a 4 | devices/mod/* 5 | 6 | -------------------------------------------------------------------------------- /Book/eps/blocks.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/blocks.pdf -------------------------------------------------------------------------------- /Book/eps/bode.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/bode.pdf -------------------------------------------------------------------------------- /Book/eps/ctrmot.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/ctrmot.pdf -------------------------------------------------------------------------------- /Book/eps/disks.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/disks.pdf -------------------------------------------------------------------------------- /Book/eps/libs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/libs.png -------------------------------------------------------------------------------- /Book/eps/lsim.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/lsim.pdf -------------------------------------------------------------------------------- /Book/eps/motid.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/motid.pdf -------------------------------------------------------------------------------- /Book/eps/pyedit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/pyedit.pdf -------------------------------------------------------------------------------- /Book/eps/pzmap.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/pzmap.pdf -------------------------------------------------------------------------------- /Book/eps/rlocus.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/rlocus.pdf -------------------------------------------------------------------------------- /Book/eps/rtout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/rtout.pdf -------------------------------------------------------------------------------- /Book/eps/simout.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/simout.pdf -------------------------------------------------------------------------------- /Book/eps/step1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/step1.pdf -------------------------------------------------------------------------------- /Book/eps/step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/step1.png -------------------------------------------------------------------------------- /CodeGen/STM32H7/include/stm32SPI4.h: -------------------------------------------------------------------------------- 1 | void MX_SPI4_Init(void); 2 | void MX_SPI4_Init_NOSS(void); 3 | -------------------------------------------------------------------------------- /userLib/userpyblk.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/userLib/userpyblk.a -------------------------------------------------------------------------------- /Book/eps/disksrt.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/disksrt.pdf -------------------------------------------------------------------------------- /Book/eps/disksrt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/disksrt.png -------------------------------------------------------------------------------- /Book/eps/diskssim.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/diskssim.pdf -------------------------------------------------------------------------------- /Book/eps/diskssim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/diskssim.png -------------------------------------------------------------------------------- /Book/eps/exa_plot.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/exa_plot.pdf -------------------------------------------------------------------------------- /Book/eps/impulse.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/impulse.pdf -------------------------------------------------------------------------------- /Book/eps/initial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/initial.pdf -------------------------------------------------------------------------------- /Book/eps/nichols.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/nichols.pdf -------------------------------------------------------------------------------- /Book/eps/nyquist.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/nyquist.pdf -------------------------------------------------------------------------------- /Book/eps/pendinv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/pendinv.jpg -------------------------------------------------------------------------------- /Book/eps/pendinv.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/pendinv.pdf -------------------------------------------------------------------------------- /Book/eps/pendolo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/pendolo.pdf -------------------------------------------------------------------------------- /Book/eps/stepresp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/stepresp.pdf -------------------------------------------------------------------------------- /Book/eps/xblk2Blk.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/xblk2Blk.pdf -------------------------------------------------------------------------------- /CodeGen/LinuxRT/devices/.gitignore: -------------------------------------------------------------------------------- 1 | _build 2 | _compiled 3 | spi* 4 | *.omk-default 5 | libpyblk.a 6 | -------------------------------------------------------------------------------- /BlockEditor/gen_pydev: -------------------------------------------------------------------------------- 1 | sed s/xxxx/$1/ ${PYSUPSICTRL}/CodeGen/LinuxRT/devices/template.c.tmp > $1.c 2 | 3 | -------------------------------------------------------------------------------- /Book/eps/BallOnWheel.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/BallOnWheel.pdf -------------------------------------------------------------------------------- /Book/eps/bodeplant.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/bodeplant.pdf -------------------------------------------------------------------------------- /Book/eps/bodeplantpi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/bodeplantpi.pdf -------------------------------------------------------------------------------- /Book/eps/defBlocks.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/defBlocks.pdf -------------------------------------------------------------------------------- /Book/eps/dstepresp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/dstepresp.pdf -------------------------------------------------------------------------------- /Book/eps/env_pyEdit.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/env_pyEdit.eps -------------------------------------------------------------------------------- /Book/eps/env_pyEdit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/env_pyEdit.pdf -------------------------------------------------------------------------------- /Book/eps/exa_final.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/exa_final.eps -------------------------------------------------------------------------------- /Book/eps/exa_final.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/exa_final.pdf -------------------------------------------------------------------------------- /Book/eps/exa_step1.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/exa_step1.eps -------------------------------------------------------------------------------- /Book/eps/exa_step1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/exa_step1.pdf -------------------------------------------------------------------------------- /Book/eps/exa_step2.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/exa_step2.eps -------------------------------------------------------------------------------- /Book/eps/exa_step2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/exa_step2.pdf -------------------------------------------------------------------------------- /Book/eps/gendialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/gendialog.png -------------------------------------------------------------------------------- /Book/eps/pidexastep.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/pidexastep.pdf -------------------------------------------------------------------------------- /Book/eps/squareblk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/squareblk.png -------------------------------------------------------------------------------- /resources/icons/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/copy.png -------------------------------------------------------------------------------- /resources/icons/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/cut.png -------------------------------------------------------------------------------- /resources/icons/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/exit.png -------------------------------------------------------------------------------- /resources/icons/psc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/psc.png -------------------------------------------------------------------------------- /resources/icons/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/run.png -------------------------------------------------------------------------------- /resources/icons/shv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/shv.png -------------------------------------------------------------------------------- /resources/icons/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/undo.png -------------------------------------------------------------------------------- /CodeGen/STM32H7/.gitignore: -------------------------------------------------------------------------------- 1 | lib/*.a 2 | devices/*.o 3 | devices/mod/* 4 | objects/obj/*.o 5 | objects/objects.list1 -------------------------------------------------------------------------------- /resources/icons/debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/debug.png -------------------------------------------------------------------------------- /resources/icons/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/folder.png -------------------------------------------------------------------------------- /resources/icons/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/paste.png -------------------------------------------------------------------------------- /resources/icons/print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/print.png -------------------------------------------------------------------------------- /resources/icons/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/python.png -------------------------------------------------------------------------------- /Book/BookPythonForControl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/BookPythonForControl.pdf -------------------------------------------------------------------------------- /Book/eps/bodeplantpilead.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/bodeplantpilead.pdf -------------------------------------------------------------------------------- /Book/eps/bodeplantpileadK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Book/eps/bodeplantpileadK.pdf -------------------------------------------------------------------------------- /resources/icons/codegen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/codegen.png -------------------------------------------------------------------------------- /resources/icons/filenew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/filenew.png -------------------------------------------------------------------------------- /resources/icons/fileopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/fileopen.png -------------------------------------------------------------------------------- /resources/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/filesave.png -------------------------------------------------------------------------------- /resources/icons/library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/library.png -------------------------------------------------------------------------------- /resources/icons/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/refresh.png -------------------------------------------------------------------------------- /resources/icons/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/settings.png -------------------------------------------------------------------------------- /resources/icons/updateimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/updateimg.png -------------------------------------------------------------------------------- /Book/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.bbl 3 | *.blg 4 | *.dvi 5 | *.lof 6 | *.log 7 | *.synctex.gz 8 | *.toc 9 | *.bst 10 | -------------------------------------------------------------------------------- /CodeGen/linux_mz_apo/devices/README.md: -------------------------------------------------------------------------------- 1 | For compilation with SHV usage you must compile the code with "SHV=1" flagy 2 | 3 | -------------------------------------------------------------------------------- /DriverNRT/loadnrt: -------------------------------------------------------------------------------- 1 | sudo insmod /lib/modules/`uname -r`/kernel/drivers/misc/nrt.ko 2 | sudo mknod -m0666 /dev/nrt c 20 0 3 | -------------------------------------------------------------------------------- /resources/icons/edit-clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/edit-clear.png -------------------------------------------------------------------------------- /resources/icons/filesaveas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/filesaveas.png -------------------------------------------------------------------------------- /resources/icons/help-about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/help-about.png -------------------------------------------------------------------------------- /resources/icons/ConnectCursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/resources/icons/ConnectCursor.png -------------------------------------------------------------------------------- /CodeGen/STM32H7/objects/inc/stm32h7xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/CodeGen/STM32H7/objects/inc/stm32h7xx.h -------------------------------------------------------------------------------- /CodeGen/Raspberry_PI/include/spiconfADC.h: -------------------------------------------------------------------------------- 1 | uint16_t adc_reg_ADC(uint8_t reg); 2 | int spiOpen_ADC(int dev); 3 | void spiClose_ADC(); 4 | 5 | -------------------------------------------------------------------------------- /CodeGen/linux_mz_apo/include/spiconfADC.h: -------------------------------------------------------------------------------- 1 | uint16_t adc_reg_ADC(uint8_t reg); 2 | int spiOpen_ADC(int dev); 3 | void spiClose_ADC(); 4 | 5 | -------------------------------------------------------------------------------- /launch.txt: -------------------------------------------------------------------------------- 1 | 2 | if [ -t 0 -a -t 1 ] 3 | then 4 | pysimCoder.py $1 5 | else 6 | pysimCoder.py $1 > /tmp/pysimCoder.log 7 | fi 8 | 9 | -------------------------------------------------------------------------------- /CodeGen/Common/include/commonFun.h: -------------------------------------------------------------------------------- 1 | double mapD2wD(double u, double umin, double umax); 2 | double maprD2D(double val, double umin, double umax); 3 | -------------------------------------------------------------------------------- /Tests/ControlDesign/DisksAndSpring/disks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Tests/ControlDesign/DisksAndSpring/disks.jpg -------------------------------------------------------------------------------- /Tests/ControlDesign/PidExample/pidExample.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Tests/ControlDesign/PidExample/pidExample.pdf -------------------------------------------------------------------------------- /CodeGen/STM32H7/objects/inc/stm32h7xx_hal_fdcan.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/CodeGen/STM32H7/objects/inc/stm32h7xx_hal_fdcan.h -------------------------------------------------------------------------------- /Tests/ControlDesign/InvertedPendulum/README: -------------------------------------------------------------------------------- 1 | Classical inverted pendulum with 2 controllers: 2 | - swing up 3 | - control of the unstable equilibrium point 4 | -------------------------------------------------------------------------------- /CodeGen/LinuxRT/fmu/fmuinc/include/fmi2Functions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/CodeGen/LinuxRT/fmu/fmuinc/include/fmi2Functions.h -------------------------------------------------------------------------------- /CodeGen/STM32H7/objects/srcHAL/stm32h7xx_hal_cryp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/CodeGen/STM32H7/objects/srcHAL/stm32h7xx_hal_cryp.c -------------------------------------------------------------------------------- /CodeGen/STM32H7/objects/srcHAL/stm32h7xx_hal_wwdg.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/CodeGen/STM32H7/objects/srcHAL/stm32h7xx_hal_wwdg.c -------------------------------------------------------------------------------- /CodeGen/LinuxRT/fmu/fmuinc/include/fmi2FunctionTypes.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/CodeGen/LinuxRT/fmu/fmuinc/include/fmi2FunctionTypes.h -------------------------------------------------------------------------------- /CodeGen/LinuxRT/fmu/fmuinc/include/fmi2TypesPlatform.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/CodeGen/LinuxRT/fmu/fmuinc/include/fmi2TypesPlatform.h -------------------------------------------------------------------------------- /CodeGen/STM32H7/include/stm32Fun.h: -------------------------------------------------------------------------------- 1 | int set_GPIO_outPort(int port, unsigned short ch); 2 | int set_GPIO_inPort(int port, unsigned short ch); 3 | void start_OTG(); 4 | -------------------------------------------------------------------------------- /CodeGen/STM32H7/objects/srcHAL/stm32h7xx_hal_cryp_ex.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/CodeGen/STM32H7/objects/srcHAL/stm32h7xx_hal_cryp_ex.c -------------------------------------------------------------------------------- /Tests/ControlDesign/DisksAndSpring/DisksAndSpring.fmu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertobucher/pysimCoder/HEAD/Tests/ControlDesign/DisksAndSpring/DisksAndSpring.fmu -------------------------------------------------------------------------------- /CodeGen/linux_mz_apo/.gitignore: -------------------------------------------------------------------------------- 1 | lib/*.a 2 | devices/*.o 3 | devices/*.omk-default 4 | devices/_build 5 | devices/_compiled 6 | devices/libpyblk.a 7 | include-generated 8 | -------------------------------------------------------------------------------- /ExtLibs/README.txt: -------------------------------------------------------------------------------- 1 | This is a space for external libraries required for some pysimCoder features. Those libraries should be downloaded automatically during code build. 2 | -------------------------------------------------------------------------------- /CodeGen/nuttx/.gitignore: -------------------------------------------------------------------------------- 1 | nuttx-export* 2 | lib/*.a 3 | devices/*.o 4 | devices/*.omk-default 5 | devices/_build 6 | devices/_compiled 7 | devices/libpyblk.a 8 | include-generated 9 | get_lib 10 | set_lib 11 | -------------------------------------------------------------------------------- /CodeGen/tos1a/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | -------------------------------------------------------------------------------- /CodeGen/arduinoFirmata/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | -------------------------------------------------------------------------------- /resources/blocks/.gitignore: -------------------------------------------------------------------------------- 1 | rcpBlk/*/__pycache__ 2 | rcpBlk/__pycache__ 3 | Icons/SPIBDG.svg 4 | Icons/SUBSYSTEM.svg 5 | blocks/ControlBoard/* 6 | blocks/can_generic/hbm_df30.xblk 7 | rcpBlk/ControlBoard/spiBridge* 8 | rcpBlk/can_generic/hbm_df30Blk.py 9 | -------------------------------------------------------------------------------- /Tests/ControlDesign/DisksAndSpring/README: -------------------------------------------------------------------------------- 1 | System with 2 rotating motors and a last, with a spring between the two lasts. 2 | 3 | The original system is based on Maxon motors. 4 | The communication between controller and motor driver is based on CAN bus. 5 | 6 | -------------------------------------------------------------------------------- /python_libs_install.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import subprocess 3 | 4 | # assumes you got pip installed for the same python version you have 5 | # want to use for the tool chain 6 | 7 | subprocess.call([sys.executable, "-m", "pip", "install", "-r requirements.txt"]) 8 | -------------------------------------------------------------------------------- /resources/blocks/blocks/common.blks: -------------------------------------------------------------------------------- 1 | linear/Gain.xblk 2 | linear/LTI_continous.xblk 3 | linear/LTI_discrete.xblk 4 | output/Plot.xblk 5 | output/PlotJuggler.xblk 6 | output/streamPlot.xblk 7 | output/streamLed.xblk 8 | input/Step.xblk 9 | Math/Sub.xblk 10 | -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/IMUAcc.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "IMUAcc", 4 | "ip": 0, 5 | "op": 3, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "IMU", 9 | "params": "ImuAccBlk", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/shv_input.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "SHVInput", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "SHV", 9 | "params": "SHVInputBlk", 10 | "help": "SHV Input block\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/Prod.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Prod", 4 | "ip": 2, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "PROD", 9 | "params": "prodBlk", 10 | "help": "This block multiply the two input signals.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/IMUGyro.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "IMUGyro", 4 | "ip": 0, 5 | "op": 3, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "IMU", 9 | "params": "ImuGyroBlk", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/IMUTemp.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "IMUTemp", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "IMU", 9 | "params": "ImuTempBlk", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /CodeGen/Raspberry_PI/include/spiconfIMU.h: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | short X; 3 | short Y; 4 | short Z; 5 | }IMU_data; 6 | 7 | int conf_reg_IMU(uint8_t reg, uint8_t val); 8 | IMU_data imu_reg_IMU(uint8_t reg); 9 | int spiOpen_IMU(); 10 | void spiClose_IMU(); 11 | 12 | -------------------------------------------------------------------------------- /CodeGen/linux_mz_apo/include/spiconfIMU.h: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | short X; 3 | short Y; 4 | short Z; 5 | }IMU_data; 6 | 7 | int conf_reg_IMU(uint8_t reg, uint8_t val); 8 | IMU_data imu_reg_IMU(uint8_t reg); 9 | int spiOpen_IMU(); 10 | void spiClose_IMU(); 11 | 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/shv_output.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "SHVOutput", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "SHV", 9 | "params": "SHVOutputBlk", 10 | "help": "SHV Output block\n" 11 | } -------------------------------------------------------------------------------- /Tests/ControlDesign/Disks/README: -------------------------------------------------------------------------------- 1 | System with a rotating motor and a last, controlled in torque mode. 2 | 3 | The original system is based on Maxon motors (disk1 and disk2 are 2 differents motors). 4 | The communication between controller and motor driver is based on CAN bus. 5 | 6 | -------------------------------------------------------------------------------- /resources/blocks/blocks/linear/Der.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linear", 3 | "name": "derivative", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DER", 9 | "params": "derBlk", 10 | "help": "This block implements a continous derivate block\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/nonlin/Abs.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "nonlin", 3 | "name": "Abs", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ABS", 9 | "params": "absBlk", 10 | "help": "This block implements the mathematical function \"ABS\"\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/Maximum.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Maximum", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "MAXIMUM", 9 | "params": "maxFromNInputs", 10 | "help": "Find the maximum from all inputs and output it." 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/Minimum.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Minimum", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "MINIMUM", 9 | "params": "minFromNInputs", 10 | "help": "Find the minimum from all inputs and output it." 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiSerialIn.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "serialIn", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "SERIAL", 9 | "params": "brikiSerialInBlk", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/input/Const.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "input", 3 | "name": "Const", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "CONST", 9 | "params": "constBlk|Value: 0: double", 10 | "help": "This block implements a constant input signal.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/input/Timer.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "input", 3 | "name": "Timer", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "TIMER", 9 | "params": "getTimerBlk", 10 | "help": "This block put the execution time as output value.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/AR2INO/ar2inoDI.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "AR2INO", 3 | "name": "DI", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DI", 9 | "params": "ar2inoDIBlk|Channel: 0:int", 10 | "help": "Parameters\nChannel: PIN for digital input\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/Div.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Div", 4 | "ip": 2, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DIV", 9 | "params": "divBlk", 10 | "help": "This block divide the first input signals by the second input signal.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/STM32H7/stm32DI.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "STM32H7", 3 | "name": "DI", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DI", 9 | "params": "stm32DIBlk|Port:'PORTA':str|Channel: 0:int", 10 | "help": "Parameters\nPort\nChannel\n" 11 | } -------------------------------------------------------------------------------- /CodeGen/STM32H7/OTG/obj/Makefile: -------------------------------------------------------------------------------- 1 | LIB = libOTG.a 2 | 3 | all: install 4 | 5 | BIN_DIR = /usr/bin 6 | 7 | AR = $(BIN_DIR)/arm-none-eabi-ar 8 | 9 | $(LIB): 10 | $(AR) -r $(LIB) *.o 11 | 12 | install: $(LIB) 13 | mv $(LIB) $(STM32H7_HOME)/lib 14 | 15 | clean: 16 | rm -f *.o 17 | 18 | -------------------------------------------------------------------------------- /resources/blocks/blocks/nonlin/UPOW.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "nonlin", 3 | "name": "UPOWV", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "UV", 9 | "params": "upowBlk|K:1:double|v:1:double", 10 | "help": "This block implements the function K*|u|^v\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/SHMEMin.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "SHMEMin", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "SHMEM", 9 | "params": "shmemInBlk|SHM name:'in_shm':str", 10 | "help": "Shared memory for input data" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX/nuttx_DAC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX", 3 | "name": "DAC", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DAC", 9 | "params": "nuttx_DACBlk|Port:'/dev/dac0':str|Channel:0:int", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/AR2INO/ar2inoENC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "AR2INO", 3 | "name": "Encoder", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "ar2inoENCBlk|Resolution:1:int|Reset [0=no/1=yes]:1:int", 10 | "help": "Define an encoder block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/SHMEMout.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "SHMEMout", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "SHMEM", 9 | "params": "shmemOutBlk|SHM name:'out_shm':str", 10 | "help": "Shared memory for output data" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiSerialOut.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "serialOut", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "SERIAL", 9 | "params": "brikiSerialOutBlk|Decimation:1:int", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/toESP32.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "toESP32", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "TO_ESP32", 9 | "params": "toESP32Blk", 10 | "help": "Comunication with the ESP32 core - Sending data\n\nParameters\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/output/Print.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "output", 3 | "name": "Print", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "PRINT", 9 | "params": "printBlk", 10 | "help": "This block print the signals values at the input on the simulation shell.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/output/toFile.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "output", 3 | "name": "toFile", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "TOFILE", 9 | "params": "toFileBlk|File name: 'data.txt':str", 10 | "help": "Input signals are stored into a text file.\n" 11 | } -------------------------------------------------------------------------------- /CodeGen/Common/common_dev/commonFun.c: -------------------------------------------------------------------------------- 1 | double mapD2wD(double u, double umin, double umax) 2 | { 3 | double uVal = (u-umin)/(umax-umin); 4 | return uVal; 5 | } 6 | 7 | double maprD2D(double val, double umin, double umax) 8 | { 9 | double dVal = val*(umax-umin) + umin; 10 | return dVal; 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX/microros.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX", 3 | "name": "MICROROS", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 1, 8 | "icon": "MICROROS", 9 | "params": "microrosBlk", 10 | "help": "This block only works with NuttX if microros have been installed!\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX/nuttxDI.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX", 3 | "name": "DI", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DI", 9 | "params": "nuttxDIBlk|Port:'/dev/gpio0':str", 10 | "help": "Parameters\nPort: device associated to the digital input\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/fromESP32.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "fromESP32", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "FROM_ESP32", 9 | "params": "fromESP32Blk", 10 | "help": "Comunication with the ESP32 core - Getting Data\n\nParameters\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/serialIn.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "serialIn", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "SERIAL", 9 | "params": "serialInBlk|Port:'/dev/ttyACM0':str", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/serialOut.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "serialOut", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "SERIAL", 9 | "params": "serialOutBlk|Port:'/dev/ttyACM0':str", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/clarke_inverse.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Inverse Clarke", 4 | "ip": 2, 5 | "op": 3, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "INVERSE_CLARKE", 9 | "params": "clarke_inverseBlk", 10 | "help": "This block performs inverse Clarke transformation.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/arduinoFirmata/digitalWrite_af.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "arduinoFirmata", 3 | "name": "Digital Write", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "FIRMDATA", 9 | "params": "digitalWrite_af|Device pin:8:int", 10 | "help": "No help available" 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/AR2INO/ar2inoSetup.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "AR2INO", 3 | "name": "Setup", 4 | "ip": 0, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "INIT", 9 | "params": "ar2inoSetupBlk|Port:'/dev/ttyACM0':str|Baud:115200:int", 10 | "help": "Setup the channel for the communication" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX/P3MotorNuttx.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX", 3 | "name": "Phase3Motor", 4 | "ip": 6, 5 | "op": 7, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT", 9 | "params": "P3MotNuttxBlk", 10 | "help": "Block for controlling 3-Phase DC Motor using SPI connection in NuttX\n\n\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Raspberry/P3Motor.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Raspberry", 3 | "name": "Phase3Motor", 4 | "ip": 6, 5 | "op": 7, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT", 9 | "params": "P3MotBlk", 10 | "help": "Block for controlling 3-Phase DC Motor using SPI connection in RPi\n\n\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/STM32H7/stm32ENC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "STM32H7", 3 | "name": "stm32_ENC", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "stm32ENCBlk|Resolution:1000:double", 10 | "help": "Parameters\n=======\nResolution: encoder resolution\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/arduinoFirmata/help_tcLab_temperature.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "arduinoFirmata", 3 | "name": "Helper TCLab Temperature", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "TCLAB", 9 | "params": "help_TCLab_temperature", 10 | "help": "No help available" 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/linear/Gain.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linear", 3 | "name": "Gain", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 1, 8 | "icon": "MULT", 9 | "params": "matmultBlk|Gains: 1:double", 10 | "help": "Implements the multiplication of the input with a matrix of coefficients.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/linux_mz_apo/mz_apo_DCmotor.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linux_mz_apo", 3 | "name": "mzapoDCmot", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT", 9 | "params": "mz_apo_DCmotBlk|Motor ID:0:int", 10 | "help": "Parameters\nMotor ID: 0 or 1\n\n\n" 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/mod.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "modulo", 4 | "ip": 2, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOD", 9 | "params": "moduloBlk", 10 | "help": "This block computes the floating-point remainder of dividing x by y. The remainder is truncuated.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX/nuttxSerialOut.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX", 3 | "name": "serialOut", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "SERIAL", 9 | "params": "nuttxSerialOutBlk|Port:'/dev/ttyS0':str|Decimation:1:int", 10 | "help": "Parameters\nPort: device name\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/arduinoFirmata/encoderRead_af.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "arduinoFirmata", 3 | "name": "Encoder", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "encoderRead_af|Encode no:0:int|Pin A:2:int|Pin B:3:int", 10 | "help": "Define an encoder block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/output/streamLed.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "output", 3 | "name": "RT LED", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "LED", 9 | "params": "ledStream|Decimation:1:int", 10 | "help": "This block allows to display in real time the input 0/1 signal as LED\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/serialInFloat.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "serialInFloat", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "SERIAL", 9 | "params": "serialInFloatBlk|Port:'/dev/ttyACM0':str", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/serialOutFloat.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "serialOutFloat", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "SERIAL", 9 | "params": "serialOutFloatBlk|Port:'/dev/ttyACM0':str", 10 | "help": " No help available for this block" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/Sub.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Sub", 4 | "ip": 2, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "PM", 9 | "params": "sumBlk|Gains: [1,-1]:double", 10 | "help": "This block get the weighted sum of the input signals.\n\nIt can have more than 2 inputs.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/Sum.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Sum", 4 | "ip": 2, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "SUM", 9 | "params": "sumBlk|Gains: [1,1]:double", 10 | "help": "This block get the weighted sum of the input signals.\n\nIt can have more than 2 inputs.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/folders: -------------------------------------------------------------------------------- 1 | arduinoFirmata 2 | can_Faulhaber_3XXX 3 | can_Faulhaber_5XXX 4 | can_generic 5 | can_Maxon 6 | comedi 7 | Communication 8 | ControlBoard 9 | input 10 | linear 11 | linux_mz_apo 12 | Math 13 | nonlin 14 | NuttX 15 | NuttX_sensors 16 | output 17 | Raspberry 18 | SAMD21 19 | STM32H7 20 | tos1a 21 | -------------------------------------------------------------------------------- /CodeGen/Common/include/matop.h: -------------------------------------------------------------------------------- 1 | int matmult(double *a, int na, int ma, double *b, int nb, int mb, double* c); 2 | int matsum(double *a, int na, int ma, double *b, int nb, int mb, double* c); 3 | int integralFunc(double t, const double y[], double f[], void *params); 4 | int cssFunc(double t, const double y[], double f[], void *params); 5 | -------------------------------------------------------------------------------- /resources/blocks/blocks/STM32H7/stm32DO.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "STM32H7", 3 | "name": "DO", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DO", 9 | "params": "stm32DOBlk|Port:'PORTA':str|Channel [0-15]:0:int|Threshold:0.5:double", 10 | "help": "Parameters\nPort\nChannel [0-15]\nThreshold\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/arduinoFirmata/customRead_af.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "arduinoFirmata", 3 | "name": "Custom Read", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "FIRMDATA", 9 | "params": "customRead_af|Value:0:int", 10 | "help": "Values from 0 to 6; 0 = FIRMATA_VL53L0X_GET_DISTANCE"} 11 | -------------------------------------------------------------------------------- /resources/blocks/blocks/arduinoFirmata/setup_af.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "stin": 0, 3 | "name": "Setup", 4 | "lib": "arduinoFirmata", 5 | "ip": 0, 6 | "help": "Setup the channel for the communication", 7 | "params": "setup_af|Port:'/dev/ttyACM0':str|Baud:57600:int", 8 | "stout": 0, 9 | "icon": "INIT", 10 | "op": 0 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/nonlin/Trig.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "nonlin", 3 | "name": "Trig", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "TRIG", 9 | "params": "trigBlk|sin->1 cos->2 tan->3: 1:int", 10 | "help": "This block implements trigonometrics functions (as given with the parameter)." 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiRGB.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "brikiRGB", 4 | "ip": 4, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "LED", 9 | "params": "brikiRGBBlk", 10 | "help": "The 4 input signals represent\n\n1: brightness (0..1)\n2: Red (0..1)\n3: Green (0..1)\n4: Blue (0..1)\n" 11 | } -------------------------------------------------------------------------------- /BlockEditor/broker_conf.toml: -------------------------------------------------------------------------------- 1 | name = "pysimCoderBroker" 2 | listen = ["tcp://[::]:3755", "unix:shvbroker.sock"] 3 | 4 | [user.admin] 5 | password = "admin!123" 6 | role = "admin" 7 | 8 | [role.admin] 9 | access.ssrv = "**" 10 | mountPoints = "**" # can mount itself anywhere 11 | access.dev = "**:*" # can access everything with DEV level 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/hall3ph2sec.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Hall to 6 Sectors", 4 | "ip": 3, 5 | "op": 2, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "HALL_2_SEC", 9 | "params": "hall3ph2secBlk|Inverted: 0:int", 10 | "help": "Converstion of 3 phase Hall to 6 sectors.\nInverted: 1 (yes), 0 (no).\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiLux.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "brikiLux", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "LUX", 9 | "params": "brikiLuxBlk", 10 | "help": "This block allows to measure the Light on the briki ABC card,\n\nParameters:\nNo parameters are required.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/STM32H7/USB_OTG_In.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "STM32H7", 3 | "name": "USB_OTG_In", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "SERIAL", 9 | "params": "USB_OTG_InBlk|Default outputs:[0.]:double", 10 | "help": "Parameters\n\nDefault output: the output before arriving of data\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/linear/Integral.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linear", 3 | "name": "Integral", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "INTG", 9 | "params": "intgBlk|Initial conditions: 0:double", 10 | "help": "This block implements a continous integration block\n\nParameters:\nInitial condition\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/nonlin/deadzone.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "nonlin", 3 | "name": "Deadzone", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DEAD", 9 | "params": "deadzoneBlk|Start:-1:double|End:1:double", 10 | "help": "This block implements a deadzone function\n\nParameters:\nLimits of the deadzone\n" 11 | } -------------------------------------------------------------------------------- /CodeGen/Raspberry_PI/lib/README: -------------------------------------------------------------------------------- 1 | Folder for the Raspberry PI libraries 2 | 3 | In particular, the specific RPI libraries can be downloaded using 4 | 5 | wget http://robertobucher.dti.supsi.ch/wp-content/uploads/2017/03/RaspLibs.zip + unzip 6 | 7 | libcrypt.a 8 | libm.a 9 | libpthread.a 10 | librt.a 11 | libwiringPi.a 12 | libwiringPiDev.a 13 | 14 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/clarke_forward.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Forward Clarke", 4 | "ip": 3, 5 | "op": 2, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "FORWARD_CLARKE", 9 | "params": "clarke_forwardBlk", 10 | "help": "This block performs forward Clarke transformation.\nBlock can have either 2 or 3 inputs.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX/nuttxDO.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX", 3 | "name": "DO", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DO", 9 | "params": "nuttxDOBlk|Port:'/dev/gpio4':str|Threshold:0.5:double", 10 | "help": "Parameters\nPort: device associated to the output\nThreshold: Value between 0 and 1\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/linear/Delay.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linear", 3 | "name": "Delay", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DELAY", 9 | "params": "zdelayBlk|Initial conditions: 0:double", 10 | "help": "This block implements a unit delay in discrete time domain.\n\nNo parameters are required.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/output/Logger.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "output", 3 | "name": "Logger", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "TOFILE", 9 | "params": "loggerBlk|Log file:'log_file':str", 10 | "help": "This block implements a logger method fro data from the block diagram into the \"log file\"\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/output/Plot.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "output", 3 | "name": "Plot", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "PLOT", 9 | "params": "plotBlk", 10 | "help": "This block saves the input signals into a plot.\n\nThe plot is stored under the tmp folder and can be opend with a double click\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/output/streamPlot.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "output", 3 | "name": "RT Plot", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "PLOT", 9 | "params": "scopeStream|Sample(0) or time(1) based:1:int|Decimation:1:int", 10 | "help": "This block allows to display in real time the input signals.\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/output/PlotJuggler.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "output", 3 | "name": "PlotJuggler", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "PLOT", 9 | "params": "plotJugglerBlk|IP Addr:'127.0.0.1':str| Port:5005:int", 10 | "help": "This block send the data to PlotJuggler, including the time as [ts] field.\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/unixSkClient.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "UnixSkClient", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "UNIXSOCK", 9 | "params": "unixsocketCBlk|Socket: 'bsock':str", 10 | "help": "This block implements a Unix Sochet Client to send the data to a Unix Socket Server.\n\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/nonlin/Saturation.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "nonlin", 3 | "name": "Saturation", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "SATUR", 9 | "params": "saturBlk|Upper saturation:10:double|Lower saturation: -10:double", 10 | "help": "This block saturates the input signals to the two limits passed as parameters.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/output/Null.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "output", 3 | "name": "NULL", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "NULL", 9 | "params": "nullBlk", 10 | "help": "Not used signals must be connecte to the inputs of this block.\n\nAttention: It is not possible to have unconnected signals in a block diagram yet!\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/AR2INO/ar2inoDO.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "AR2INO", 3 | "name": "DO", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DO", 9 | "params": "ar2inoDOBlk|Channel: 0:int|Threshold:0.5:double", 10 | "help": "Parameters\nChannel: PIN for digital output\n\nThe threshold represents the level limit between the LOW and the HIGH signal" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/UDPsocketTX.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "UDPsocketTx", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "UDPSOCK", 9 | "params": "UDPsocketTxBlk|IP Addr:'127.0.0.1':str| Port:1024:int", 10 | "help": "This Block implements a UDP sender\n\nParameters\nIP address of the receiver\nPort\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Raspberry/PWM.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Raspberry", 3 | "name": "PWM", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "PWM", 9 | "params": "pwmBlk|Channel:0:int|Umin [V]:0.0:double|Umax [V]:5.0:double", 10 | "help": "This block implement the PWM output for a Raspberry PI uC\n\nThe input must be between -5 and 5.\n\n\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/dialogs/plotDlg.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | 4 | def plotDlg(nin, nout, pars, name): 5 | fn = '/tmp/'+name 6 | 7 | try: 8 | x = np.loadtxt(fn) 9 | t = x[:,0] 10 | y = x[:,1:] 11 | plt.plot(t,y) 12 | plt.grid() 13 | plt.show() 14 | except: 15 | pass 16 | 17 | -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiRange.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "brikiRange", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "TOF", 9 | "params": "brikiRangeBlk", 10 | "help": "This block implements the \"ToF\" function on the Briki ABC card.\n\nAt the moment this block doesn't work correctly...\n\nParameters\nNo parameters" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/input/Step.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "input", 3 | "name": "Step", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "STEP", 9 | "params": "stepBlk|Step Time: 1: double|Initial Value: 0: double|Final Value: 1: double", 10 | "help": "This block implements a step input signal.\n\nParameters:\nStep Time:\nInitial value:\nFinal value:" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Raspberry/pi_AD.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Raspberry", 3 | "name": "pi_AD", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "AD", 9 | "params": "pi_ADBlk|Device:0:int|Channel:0:int|Vref:0.0:double", 10 | "help": "Parameters\nDevice: device number on the target board [0 or 1]\nChannel: channel of the ADC (0:3)\nVref: Reference voltage\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiDI.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "DI", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DI", 9 | "params": "brikiDIBlk|Channel: 0:int", 10 | "help": "Parameters\nChannel: Number is the same on the ABC Board for Digital and PWM\n\nPossible values are: 11, 13, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31\n\n" 11 | } -------------------------------------------------------------------------------- /toolbox/supsisim/supsisim/const.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | GRID = 10 4 | PW = 6 5 | 6 | BWmin = 80 7 | BHmin = 60 8 | BHstep = 20 9 | 10 | PD = 40 11 | NW = 4 12 | LW =2 13 | DP = 100.0 14 | 15 | DB = 4 16 | 17 | VERSION = 0.95 18 | 19 | path = os.environ.get('PYSUPSICTRL') + '/' 20 | respath = path+'resources/' 21 | pycmd = 'jupyter qtconsole &' 22 | pyrun = 'python3' 23 | TEMP = '.' 24 | 25 | -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiEcho.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "brikiEcho", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ECHO", 9 | "params": "brikiEchoBlk|Trigger Pin:11:int|Echo Pin:13:int", 10 | "help": "This block implements the \"echo\" function on an Arduino system.\n\nParameters:\nTrigger Pin\nEcho Pin\n\nBoth are digital I/O." 11 | } -------------------------------------------------------------------------------- /CodeGen/STM32H7/Makefile: -------------------------------------------------------------------------------- 1 | all: devices objlib objects OTG 2 | 3 | .PHONY: devices objlib objects OTG 4 | 5 | devices: 6 | cd devices; make; make install; make clean 7 | 8 | objlib: 9 | cd objects/srcHAL; make; make install; make clean 10 | 11 | objects: 12 | cd objects/src; make; make clean 13 | 14 | OTG: 15 | cd OTG; make; make clean 16 | cd OTG/obj; make install; make clean 17 | 18 | 19 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/park_inverse.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Inverse Park", 4 | "ip": 3, 5 | "op": 2, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "INVERSE_PARK", 9 | "params": "park_inverseBlk", 10 | "help": "This block performs inverse Park transformation.\nFirst two inputs are for rotating reference frame quantities, the third one is for the rotation angle.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX_sensors/nuttx_DHTXX.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX Sensors", 3 | "name": "DHTXX", 4 | "ip": 0, 5 | "op": 2, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DHTXX", 9 | "params": "nuttx_DHTXXBlk|Port:'/dev/hum0':str", 10 | "help": "Block for DHT22 and DHT11 sensors.\n\nOutput 1: humidity\nOutput 2: temperture\n\nParameters\nPort : device name (ex. '/dev/hum0')\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/AR2INO/ar2inoAI.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "AR2INO", 3 | "name": "Analog Input", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "AD", 9 | "params": "ar2inoAIBlk|Pin:18:int|Umin [V]:0.0:double|Umax [V]:5.0:double", 10 | "help": "Parameters\nInput: Analog input PIN\n\nThe input signal (0..3V) is automatically mapped to a value between Umin and Umax.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/STM32H7/USB_OTG_Out.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "STM32H7", 3 | "name": "USB_OTG_Out", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "SERIAL", 9 | "params": "USB_OTG_OutBlk|Decimation:1:double", 10 | "help": "This block sends values from the STM32H7 card to the serial port, allowing to get them from an external system.\n\nParameters:\nDecimation: \n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/output/nullBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def nullBlk(pin: list[int]) -> RCPblk: 5 | """ 6 | Call: nullBlk(pin) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("toNull", pin, [], [0, 0], 1) 18 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/output/printBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def printBlk(pin: list[int]) -> RCPblk: 5 | """ 6 | Call: printBlk(pin) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("print", pin, [], [0, 0], 1) 18 | -------------------------------------------------------------------------------- /resources/blocks/blocks/comedi/DI.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "comedi", 3 | "name": "DI", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DI", 9 | "params": "comediDIBlk|Device: '/dev/comedi0':str|Channel: 0:int", 10 | "help": "Implementation of a COMEDI Digital Input interface.\n\nParameters:\nDevice and channel\n\nFor more details get the COMEDI documentation (www.comedi.org)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/comedi/ENC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "comedi", 3 | "name": "ENC", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "comediENCBlk|Device: '/dev/comedi0':str|Channel: 0:int", 10 | "help": "Implementation of a COMEDI Encoder interface.\n\nParameters:\nDevice and channel\n\nFor more details get the COMEDI documentation (www.comedi.org)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/input/triangle.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "input", 3 | "name": "triangle", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "TRIANGLE", 9 | "params": "triangleBlk|Amplitude: 1: double|Period [s]: 1: double|Bias: 0: double|Delay: 0: double", 10 | "help": "This block implements a triangle wave input signal.\n\nParameters:\nAmplitude\nPeriod [s]\nBias\nDelay\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/TCPsocketTXRX.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "TCPsocketTXRX", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 1, 8 | "icon": "TCPSOCKET", 9 | "params": "TCPsocketTxRxBlk|IP Addr:'127.0.0.1':str|Port:1024:int", 10 | "help": "This block implements a TCP sender and optional receiver\n\nParameters\nIP address of the receiver\nPort\n" 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/park_forward.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Forward Park", 4 | "ip": 3, 5 | "op": 2, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "FORWARD_PARK", 9 | "params": "park_forwardBlk", 10 | "help": "This block performs forward Park transformation.\nFirst two inputs are for orthogonal stationary reference frame quantities, the third one is for the rotation angle.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/comedi/comediPWM.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "comedi", 3 | "name": "PWM", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "PWM", 9 | "params": "comediPWMBlk|Device: '/dev/comedi0':str|Channel: 0:int|Prescaler: 0:int|Output pin: 0:int", 10 | "help": "Implementation of a COMEDI PWM interface\n\nFor more details get the COMEDI documentation (www.comedi.org)\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/linux_mz_apo/mz_apo_ENC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linux_mz_apo", 3 | "name": "mzapoENC", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "mz_apo_ENCBlk|channel:0:int|init_val:0:int", 10 | "help": "Parameters\nChannel[0]: Encoder 1 (RED)\nChannel[1]: Encoder 2 (GREEN)\nChannel[2]: Encoder 3 (BLUE)\nInitial Value: any integer\n\n\n" 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/ImuAccBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def ImuAccBlk(pout: list[int]) -> RCPblk: 5 | """ 6 | Call: ImuAcc(pout) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("ImuAcc", [], pout, [0, 0], 0) 18 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/ImuGyroBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def ImuGyroBlk(pout: list[int]) -> RCPblk: 5 | """ 6 | Call: ImuGyro(pout) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("ImuGyro", [], pout, [0, 0], 0) 18 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/toESP32Blk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def toESP32Blk(pin: list[int]) -> RCPblk: 5 | """ 6 | Call: toESP32Blk(pin) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("toESP32", pin, [], [0, 0], 1) 18 | -------------------------------------------------------------------------------- /CodeGen/linux_mz_apo/lib/README: -------------------------------------------------------------------------------- 1 | Folder for the MZ_APO CTU education kit. 2 | 3 | The board is based on Xilinx Zynq Microzed board 4 | and is used in computer architectures courses 5 | 6 | https://cw.fel.cvut.cz/wiki/courses/b35apo/en/start 7 | 8 | at Czech Technical University in Prague. 9 | 10 | More documentation 11 | 12 | https://cw.fel.cvut.cz/b202/_media/courses/b35apo/en/semestral/mz_apo-datasheet-en.pdf 13 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/ImuTempBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def ImuTempBlk(pout: list[int]) -> RCPblk: 5 | """ 6 | Call: ImuTempBlk(pout) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("ImuTemp", [], pout, [0, 0], 0) 18 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/brikiRGBBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def brikiRGBBlk(pin: list[int]) -> RCPblk: 5 | """ 6 | Call: brikiRGBBlk(pin) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("brikiRGB", pin, [], [0, 0], 1) 18 | -------------------------------------------------------------------------------- /CodeGen/Raspberry_PI/include/rpi_gpclk.h: -------------------------------------------------------------------------------- 1 | #ifndef _RPI_GPCLK_H 2 | #define _RPI_GPCLK_H 3 | 4 | #define RPI_GPCLK_PLLD_500_MHZ 0 /*500 MHz*/ 5 | #define RPI_GPCLK_OSC_19_MHZ_2 1 /*19.2 MHz*/ 6 | #define RPI_GPCLK_HDMI_216_MHZ 2 /*216 MHz*/ 7 | #define RPI_GPCLK_PLLC_1000_MHZ 3 /*1000 MHz, changes with overclock*/ 8 | 9 | int rpi_gpclk_setup(int chan, int source, int div_int, int div_frac); 10 | 11 | #endif /*_RPI_GPCLK_H*/ -------------------------------------------------------------------------------- /resources/blocks/blocks/input/Sine_wave.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "input", 3 | "name": "Sine_wave", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "SINUS", 9 | "params": "sineBlk|Amplitude: 1: double|Freq [Hz]: 1: double|Phase: 0: double|Bias: 0: double|Delay: 0: double", 10 | "help": "This block implements a Sinus input signal\n\nParameters:\nAmplitude\nFrequency (Hz)\nPhase\nBias\nDelay\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/input/sweep.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "input", 3 | "name": "Sweep", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "CHIRP", 9 | "params": "sweepBlk|Gain:0.1:double|Type linear(1), quadratic (2) :1:int", 10 | "help": "This block implements a chirp signal for identifications purposes\n\nAt present only the linear methos is implemented. Other methods are ignored yet.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/brikiLuxBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def brikiLuxBlk(pout: list[int]) -> RCPblk: 5 | """ 6 | Call: brikiLuxBlk(pout) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("brikiLux", [], pout, [0, 0], 0) 18 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/input/getTimerBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def getTimerBlk(pout: list[int]) -> RCPblk: 5 | """ 6 | Call: getTimerBlk(pout) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("getTimer", [], pout, [0, 0], 0) 18 | -------------------------------------------------------------------------------- /toolbox/supsisim/supsisim/shv/__init__.py: -------------------------------------------------------------------------------- 1 | """Implementation of SHV tree generation and communication via pySHV.""" 2 | 3 | from .client import ShvClient, ShvFwUpdateClient, ShvCallError 4 | from .generator import ShvTreeGenerator 5 | from .SHVInstance import SHVInstance 6 | 7 | __all__ = [ 8 | "ShvClient", 9 | "ShvFwUpdateClient", 10 | "ShvCallError", 11 | "ShvTreeGenerator", 12 | "SHVInstance" 13 | ] 14 | -------------------------------------------------------------------------------- /resources/blocks/blocks/nonlin/antideadzone.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "nonlin", 3 | "name": "Anti Deadzone", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ANTIDEAD", 9 | "params": "antideadzoneBlk|Upper:0.0:double|Lower:0.0:double", 10 | "help": "This block implements an anti-deadzone compensator.\nThe upper field must be greater or equal to zero.\nThe lower field must be lower or equal to zero." 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/brikiRangeBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def brikiRangeBlk(pout: list[int]) -> RCPblk: 5 | """ 6 | Call: brikiRangeBlk(pout) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("brikiRange", [], pout, [0, 0], 0) 18 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/fromESP32Blk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def fromESP32Blk(pout: list[int]) -> RCPblk: 5 | """ 6 | Call: fromESP32Blk(pout) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("fromESP32", [], pout, [0, 0], 0) 18 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/brikiSerialInBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def brikiSerialInBlk(pout: list[int]) -> RCPblk: 5 | """ 6 | Call: brikiSerialInBlk(pin) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("serialIn", [], pout, [0, 0], 0) 18 | -------------------------------------------------------------------------------- /userLib/Makefile: -------------------------------------------------------------------------------- 1 | all: lib 2 | 3 | LIB = userpyblk.a 4 | RTPYINC = ./ 5 | SRCALL = $(wildcard *.c) 6 | OBJ = $(SRCALL:.c=.o) 7 | 8 | ######DBG = -g -fPIC 9 | DBG = -g 10 | 11 | OBJEX = $(SRC:.c=.o) 12 | #CC_FLAGS = -c $(DBG) -I$(RTPYINC) 13 | 14 | CC_FLAGS = -c $(DBG) -I$(RTPYINC) $(INCFMI) 15 | 16 | 17 | %.o: %.c 18 | cc $(CC_FLAGS) $< 19 | 20 | lib: $(OBJ) 21 | ar -r $(LIB) $(OBJ) 22 | 23 | clean: 24 | rm -f $(LIB) $(OBJ) 25 | -------------------------------------------------------------------------------- /toolbox/supsisim/supsisim/shv/SHVInstance.py: -------------------------------------------------------------------------------- 1 | class SHVInstance: 2 | def __init__(self, filename): 3 | self.used = False 4 | self.ip = '127.0.0.1' 5 | self.port = '3755' 6 | self.user = 'admin' 7 | self.passw = 'admin!123' 8 | self.devid = filename 9 | self.mount = 'test' 10 | 11 | self.tuned = False 12 | self.updates = False 13 | 14 | self.tree = 'GAVL' 15 | -------------------------------------------------------------------------------- /CodeGen/STM32H7/objects/set_dir.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | path = os.environ.get('STM32_HOME') + '/objects/obj/' 4 | 5 | fnin = open('list1','r') 6 | fnout = open('objects.list1','w') 7 | for el in fnin: 8 | fnout.write(path+el) 9 | fnin.close() 10 | fnout.close() 11 | 12 | fnin = open('list2','r') 13 | fnout = open('objects.list2','w') 14 | for el in fnin: 15 | fnout.write(path+el) 16 | fnin.close() 17 | fnout.close() 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/AR2INO/ar2inoSetupBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def ar2inoSetupBlk(params: RcpParam) -> RCPblk: 5 | """ 6 | Call: ar2inoSetup(params) 7 | 8 | Parameters 9 | ---------- 10 | params: block's parameters 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("ar2inoSetup", [], [], [0, 0], 0, params) 18 | -------------------------------------------------------------------------------- /CodeGen/STM32H7/OTG/Makefile: -------------------------------------------------------------------------------- 1 | all: install 2 | 3 | install: 4 | cd STM32_USB_Device_Library/Core/Src; make 5 | cd STM32_USB_Device_Library/Class/CDC/Src; make 6 | cd USB_DEVICE/Target; make 7 | cd USB_DEVICE/App; make 8 | 9 | clean: 10 | cd STM32_USB_Device_Library/Core/Src; make clean 11 | cd STM32_USB_Device_Library/Class/CDC/Src; make clean 12 | cd USB_DEVICE/Target; make clean 13 | cd USB_DEVICE/App; make clean 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /CodeGen/templates/nuttx.tmf: -------------------------------------------------------------------------------- 1 | MODEL = $$MODEL$$ 2 | ADDITIONAL_DEFINES = $$ADDITIONAL_DEFINES$$ 3 | ADD_FILES = $$ADD_FILES$$ 4 | 5 | PYCODEGEN = $(PYSUPSICTRL)/CodeGen 6 | MAINDIR = $(PYCODEGEN)/src 7 | LIBDIR = $(PYCODEGEN)/nuttx/lib 8 | INCDIR = $(PYCODEGEN)/nuttx/include 9 | NUTTX_EXPORT = $(PYCODEGEN)/nuttx/nuttx-export 10 | COMMON_INCDIR = $(PYCODEGEN)/Common/include 11 | 12 | MAIN = nuttx_main 13 | include $(PYCODEGEN)/nuttx/rules/make-rules.inc 14 | -------------------------------------------------------------------------------- /resources/blocks/blocks/input/PulseGenerator.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "input", 3 | "name": "PulseGenerator", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "SQUARE", 9 | "params": "squareBlk|Amplitude: 1: double|Period: 4: double|Width: 2: double|Bias: 0: double|Delay: 0: double", 10 | "help": "This block implements a Pulse input signal\n\nParameters:\nAmplitude\nPeriod (in sec)\nWidth of the High signal\nBias\nDelay\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/SHVInputBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def SHVInputBlk(pout): 5 | """ 6 | Call: SHVInputBlk(pout) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("shv_input", [], pout, [0, 0], 0, []) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/SHVOutputBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def SHVOutputBlk(pin): 5 | """ 6 | Call: SHVOutputBlk(pout) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("shv_output", pin, [], [0, 0], 0, []) 19 | -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiDCMot.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "brikiDCMot", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_V", 9 | "params": "brikiDCMotBlk|Enable Pin:11:int|In1 Pin:13:int|In2 Pin:23:int", 10 | "help": "Parameters\nEnable Pin: PIN for applying the PWM signal\nIn1 Pin: 1. PIN for direction\nIn2 Pin: 2. PIN for direction\n\nThe input signal can get a value between -1.0 and 1.0\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/comedi/DO.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "comedi", 3 | "name": "DO", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DO", 9 | "params": "comediDOBlk|Device: '/dev/comedi0':str|Channel: 0:int|Threshold: 1.0:double", 10 | "help": "Implementation of a COMEDI digital output interface\n\nParameters:\nDevice,channel and threshold for output \"1\"\n\nFor more details get the COMEDI documentation (www.comedi.org)\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/divBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def divBlk(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: divBlk(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("Div", pin, pout, [0, 0], 1) 19 | -------------------------------------------------------------------------------- /Book/eps/rena.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import glob 4 | import os 5 | 6 | mylist = [f for f in glob.glob('*-eps-converted-to.pdf')] 7 | 8 | for el in mylist: 9 | el1 = el.split('-') 10 | el1 = el1[0] 11 | 12 | el2 = el1+'.eps' 13 | el3 = el1+'.pdf' 14 | cmd1 = 'mv ' + el + ' ' + el3 15 | print(cmd1) 16 | os.system(cmd1) 17 | cmd2 = 'rm ' + el + ' ' + el2 18 | print(cmd2) 19 | os.system(cmd2) 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /resources/blocks/blocks/arduinoFirmata/pinRead_af.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "arduinoFirmata", 3 | "name": "Pin Read", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "FIRMDATA", 9 | "params": "pinRead_af|Device pin:3:int|Pin mode:0:int", 10 | "help": "#define MODE_INPUT 0x00\n#define MODE_OUTPUT 0x01\n#define MODE_ANALOG 0x02\n#define MODE_PWM 0x03\n#define MODE_SERVO 0x04\n#define MODE_SHIFT 0x05\n#define MODE_I2C 0x06" 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/arduinoFirmata/setup_af.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def setup_af(params: RcpParam) -> RCPblk: 5 | """ 6 | 7 | Call: setup_af(params) 8 | 9 | Parameters 10 | ---------- 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("setup_af", [], [], [0, 0], 0, [], params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_3XXX/FH_3XXX_INIT_Blk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_3XXX_INIT_Blk(params: RcpParam) -> RCPblk: 5 | """ 6 | Call: FH_3XXX_INIT_Blk(params) 7 | 8 | Parameters 9 | ---------- 10 | params: block's parameters 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("FH_3XXX_INIT", [], [], [0, 0], 0, params) 18 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_5XXX/FH_5XXX_INIT_Blk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_5XXX_INIT_Blk(params: RcpParam) -> RCPblk: 5 | """ 6 | Call: FH_5XXX_INIT_Blk(params) 7 | 8 | Parameters 9 | ---------- 10 | params: block's parameters 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | return RCPblk("FH_5XXX_INIT", [], [], [0, 0], 0, params) 18 | -------------------------------------------------------------------------------- /CodeGen/templates/nuttx_timerhook.tmf: -------------------------------------------------------------------------------- 1 | MODEL = $$MODEL$$ 2 | ADDITIONAL_DEFINES = $$ADDITIONAL_DEFINES$$ 3 | ADD_FILES = $$ADD_FILES$$ 4 | 5 | PYCODEGEN = $(PYSUPSICTRL)/CodeGen 6 | MAINDIR = $(PYCODEGEN)/src 7 | LIBDIR = $(PYCODEGEN)/nuttx/lib 8 | INCDIR = $(PYCODEGEN)/nuttx/include 9 | NUTTX_EXPORT = $(PYCODEGEN)/nuttx/nuttx-export 10 | COMMON_INCDIR = $(PYCODEGEN)/Common/include 11 | 12 | MAIN = nuttx_main_timerhook 13 | include $(PYCODEGEN)/nuttx/rules/make-rules.inc 14 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/UDPsocketRX.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "UDPsocketRx", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "UDPSOCK", 9 | "params": "UDPsocketRxBlk|IP Addr: '0.0.0.0':str| Port:5000:int", 10 | "help": "This block implements a UDP socket, which can receive signals from a client and put them into the block diagram.\n\nParameters:\nIP address of sender (or \"0.0.0.0\" for all)\nPort\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Raspberry/Gyro.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Raspberry", 3 | "name": "GYRO", 4 | "ip": 0, 5 | "op": 3, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "IMU", 9 | "params": "GyroBlk|CorrX: 0.7:double | CorrY: 0.7:double | CorrZ: 0.7:double", 10 | "help": "This block read the Gyroscope signals of a LSM9DS1 IMU platform on a Raspberry PI uC.\n\nThe 3 outputs are Gx, Gy and Gz.\n\nParameters:\nCorrX:\nCorrY:\nCorrZ:\n\nrepresent the correction factors" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiDO.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "DO", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DO", 9 | "params": "brikiDOBlk|Channel: 0:int|Threshold:0.5:double", 10 | "help": "Parameters\nChannel: Number is the same on the ABC Board (Digital Pins)\n\nPossible values are: 11, 13, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31\n\nThe threshold represents the level limit between the LOW and the HIGH signal" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/nonlin/Lookup.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "nonlin", 3 | "name": "Lookup", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "LOOKUP", 9 | "params": "lutBlk|Coeff : [1,0]:double", 10 | "help": "This block calculates the output with polynomial coefficients applied to the input value.\n\nThe order of the polynom is given by the numebr of coefficients. The first coefficient is related to the higher exponent of the input signal.\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Raspberry/P3MotBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def P3MotBlk(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: P3MotBlk(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("P3M_spi", pin, pout, [0, 0], 0) 19 | -------------------------------------------------------------------------------- /BlockEditor/dataplot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import numpy as np 4 | import matplotlib.pyplot as plt 5 | import sys 6 | 7 | def dataplt(fn): 8 | try: 9 | x = np.loadtxt(fn) 10 | t = x[:,0] 11 | y = x[:,1:] 12 | plt.plot(t,y) 13 | plt.grid() 14 | plt.show() 15 | except: 16 | pass 17 | 18 | 19 | if __name__ == "__main__": 20 | if len(sys.argv) > 1: 21 | fname = sys.argv[1] 22 | dataplt(fname) 23 | -------------------------------------------------------------------------------- /CodeGen/templates/nuttx_systemtickhook.tmf: -------------------------------------------------------------------------------- 1 | MODEL = $$MODEL$$ 2 | ADDITIONAL_DEFINES = $$ADDITIONAL_DEFINES$$ 3 | ADD_FILES = $$ADD_FILES$$ 4 | 5 | PYCODEGEN = $(PYSUPSICTRL)/CodeGen 6 | MAINDIR = $(PYCODEGEN)/src 7 | LIBDIR = $(PYCODEGEN)/nuttx/lib 8 | INCDIR = $(PYCODEGEN)/nuttx/include 9 | NUTTX_EXPORT = $(PYCODEGEN)/nuttx/nuttx-export 10 | COMMON_INCDIR = $(PYCODEGEN)/Common/include 11 | 12 | MAIN = nuttx_main_systemtickhook 13 | include $(PYCODEGEN)/nuttx/rules/make-rules.inc 14 | -------------------------------------------------------------------------------- /resources/blocks/blocks/STM32H7/stm32AO.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "STM32H7", 3 | "name": "AnalogOut", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DA", 9 | "params": "stm32AOBlk|ch [0,1]:0:int|Umin [V]:0.0:double|Umax [V]:3.3:double", 10 | "help": "Input voltage is mapped to 0-3.3 V\n\nParameters\nch : channel (0 or 1) to be connected\nUmin [V] : minimum voltage -> 0V\nUmax [V] : maximum voltage -> 3.3V\n\nChannel 0 --> PA4\nChannel 1 --> PA5\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/arduinoFirmata/analogWrite_af.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "arduinoFirmata", 3 | "name": "Analog Write", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "FIRMDATA", 9 | "params": "analogWrite_af|Device pin:7:int|Pin mode:0:int", 10 | "help": "#define MODE_INPUT 0x00\n#define MODE_OUTPUT 0x01\n#define MODE_ANALOG 0x02\n#define MODE_PWM 0x03\n#define MODE_SERVO 0x04\n#define MODE_SHIFT 0x05\n#define MODE_I2C 0x06" 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/moduloBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def moduloBlk(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: moduloBlk(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("pysim_modulo", pin, pout, [0, 0], 1) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/output/plotBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def plotBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: plotBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("plot", pin, [], [0, 0], 1, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/blocks/AR2INO/ar2inoPWM.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "AR2INO", 3 | "name": "PWM", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "PWM", 9 | "params": "ar2inoPWMBlk|Pin:0:int|Umin [V]:0.0:double|Umax [V]:100.0:double", 10 | "help": "This block implements a PWM output on the Arduino system.\n\nParameters:\nChannel: PIN for PWM output\n\nThe input signal can be a value between Umin and Umax and is automatically mapped to the PWM width 0-100%" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/AR2INO/ar2inoAO.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "AR2INO", 3 | "name": "AnalogOut", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DA", 9 | "params": "ar2inoAOBlk|Pin:14:int|Umin [V]:0.0:double|Umax [V]:5.0:double", 10 | "help": "Parameters\nPin: Output channel using value 0 \n\nPIN -> ch\nA0 -> 0 (the only allowed channel)\n\nThe input signal can be a value between Umin and Umax and is automatically mapped to 0-5V on the output pin.\n\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/Raspberry/ACCEL.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Raspberry", 3 | "name": "ACCEL", 4 | "ip": 0, 5 | "op": 3, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "IMU", 9 | "params": "AccelBlk|CorrX: 0.0621:double | CorrY: 0.0621:double | CorrZ: 0.0621:double", 10 | "help": "This block read the Accelerometers signals of a LSM9DS1 IMU platform on a Raspberry PI uC.\n\nThe 3 outputs are Ax, Ay and Az.\n\nParameters:\nCorrX:\nCorrY:\nCorrZ:\n\nrepresent the correction factors\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiAO.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "AnalogOut", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DA", 9 | "params": "brikiAOBlk|Pin:26:int|Umin [V]:0.0:double|Umax [V]:3.3:double", 10 | "help": "Parameters\nPin: Output channel using value 0 \n\nPIN -> ch\nA0 -> 0 (the only allowed channel)\n\nThe input signal can be a value between Umin and Umax and is automatically mapped to 0-3.3V on the output pin.\n\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/output/loggerBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def loggerBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: loggerBlk(pin, param) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("logger", pin, [], [0, 0], 1, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/output/toFileBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def toFileBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: toFileBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("toFile", pin, [], [0, 0], 1, params) 19 | -------------------------------------------------------------------------------- /CodeGen/STM32H7/OTG/usb_files.txt: -------------------------------------------------------------------------------- 1 | "USB_DEVICE/Target/usbd_conf.o" 2 | "USB_DEVICE/App/usb_device.o" 3 | "USB_DEVICE/App/usbd_cdc_if.o" 4 | "USB_DEVICE/App/usbd_desc.o" 5 | "Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.o" 6 | "Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.o" 7 | "Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.o" 8 | "Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.o" 9 | "Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_usb.o" 10 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/maxFromNInputs.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def maxFromNInputs(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: maxFromNInputs(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("maxFromNInputs", pin, pout, [0, 0], 0) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/minFromNInputs.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def minFromNInputs(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: minFromNInputs(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("minFromNInputs", pin, pout, [0, 0], 0) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/park_forwardBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def park_forwardBlk(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: park_forwardBlk(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("forward_park", pin, pout, [0, 0], 1) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/park_inverseBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def park_inverseBlk(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: park_inverseBlk(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("inverse_park", pin, pout, [0, 0], 1) 19 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Raspberry/compFilt.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Raspberry", 3 | "name": "CompFilter", 4 | "ip": 4, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "COMPFILT", 9 | "params": "compFiltBlk|Alpha:0.001:double", 10 | "help": "Implementation of a complementary filter for the Raspberry PI uC.\nThis block can be used with other uC.\n\nParameters:\nalpha value (value between 0 and 1!)\n\nThe inputs are:\nAx, Ay, Az and Gy\n\nfor a standars system (rotation on the Y axes)." 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Maxon/Epos_mot_I.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Maxon", 3 | "name": "Epos_mot_I", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_I", 9 | "params": "epos_MotIBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This Block implements the functions related to a Maxon EPOS motion controller for Torque writing\n\nParameters:\nCan dev: device (ex. '/dev/can0')\nDevice ID\n\nSee the Maxon homepage for more details (www.maxon.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/linux_mz_apo/mz_apo_3pmdrv1.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def mz_apo_3pmdrv1(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: mz_apo_3pmdrv1(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin : connected input ports 11 | pout: connected output ports 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("zynq_3pmdrv1", pin, pout, [0, 0], 0) 19 | -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Maxon/Epos_mot_X.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Maxon", 3 | "name": "Epos_mot_X", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_X", 9 | "params": "epos_MotXBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This Block implements the functions related to a Maxon EPOS motion controller for position control\n\nParameters:\nCan dev: device (ex. '/dev/can0')\nDevice ID\n\nSee the Maxon homepage for more details (www.maxon.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/clarke_inverseBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def clarke_inverseBlk(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: clarke_inverseBlk(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("inverse_clarke", pin, pout, [0, 0], 1) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/STM32H7/stm32ENCBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def stm32ENCBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: stm32ENCBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("stm32ENC", [], pout, [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/blocks/linear/DiscretePID.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linear", 3 | "name": "Discrete PID", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "PID", 9 | "params": "discretePIDBlk|Proportional gain: 1:double|Integral gain: 1:double|Derivative gain: 1:double|Min value: -3.3:double|Max value: 3.3:double", 10 | "help": "Discrete PID controller\n\nParameters\nProportional gain\nIntegral gain\nDiscrete gain\nMin value: minimal output value\nMax value: maximal output value\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Maxon/init_epos_MotIBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def init_epos_MotIBlk(params: RcpParam) -> RCPblk: 5 | """ 6 | Call: init_epos_MotIBlk(params) 7 | 8 | Parameters 9 | ---------- 10 | params: block's parameters 11 | 12 | Returns 13 | ------- 14 | Block's reprezentation RCPblk 15 | """ 16 | 17 | params[4].value = -1 * params[4].value 18 | return RCPblk("init_epos_Mot", [], [], [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /CodeGen/arduinoFirmata/includes/arduino_firmata.h: -------------------------------------------------------------------------------- 1 | void setup_af(int Flag, python_block *block); 2 | void digitalWrite_af(int flag, python_block *block); 3 | void analogWrite_af(int flag, python_block *block); 4 | void pinRead_af(int flag, python_block *block); 5 | void customRead_af(int flag, python_block *block); 6 | 7 | // helper blocks 8 | void help_HeatShield_temperature(int flag, python_block *block); 9 | void help_TCLab_temperature(int flag, python_block *block); 10 | 11 | extern t_firmata * af_firmataInstance; 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/STM32H7/stm32SPI.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "STM32H7", 3 | "name": "STM32SPI", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 1, 8 | "icon": "SPI", 9 | "params": "stm32SPIBlk|CS Port:'NSS':str|CS PIN:0:int|Outputs (max 5):[0]:int", 10 | "help": "This Block communicates using SPI with the target\n\nParameters\nCS Port: use 'NSS' to use internal CS system in the SPI communication or 'PORTX'\nCS PIN: PIN for CS\nOutputs: array to extract the signals from the SPI message\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/arduinoFirmata/help_TCLab_temperature.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | 3 | 4 | def help_TCLab_temperature(pin, pout): 5 | """ 6 | 7 | Call: help_TCLab_temperature(pin, pout) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | pout: connected output port(s) 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | return RCPblk("help_TCLab_temperature", pin, pout, [0, 0], 0) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/arduinoFirmata/pinRead_af.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def pinRead_af(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | 7 | Call: pinRead_af(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | return RCPblk("pinRead_af", [], pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_3XXX/FH_3XXX_VBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_3XXX_VBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: FH_3XXX_VBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("FH_3XXX_V", pin, [], [0, 0], 1, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_5XXX/FH_5XXX_VBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_5XXX_VBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: FH_5XXX_VBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("FH_5XXX_V", pin, [], [0, 0], 1, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/blocks/STM32H7/stm32PWM.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "STM32H7", 3 | "name": "PWM", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "PWM", 9 | "params": "stm32PWMBlk|Channel [1..4]:1:int|Umin [V]:0.0:double|Umax [V]:3.3:double", 10 | "help": "Input voltage is mapped to 0-3.3 V\n\nParameters\nChannel: PWM channel (1-4)\nUmin [V]: minimum voltage -> 0% PWM\nUmax [V]: maximum voltage -> 100% PWM\n\nChannel 1 --> PD12\nChannel 2 --> PD13\nChannel 3 --> PD14\nChannel 4 --> PD15\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_5XXX/FH_5XXX_V.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 5XXX", 3 | "name": "FH_5XXX_V", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_V", 9 | "params": "FH_5XXX_VBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This block implements the speed output interface of a MC5XXX Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH5XXX_INIT block!\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/comedi/AD.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "comedi", 3 | "name": "AD", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "AD", 9 | "params": "comediADBlk|Device: '/dev/comedi0':str|Channel: 0:int|Range: 0:int|Reference [0..3]:0:int", 10 | "help": "Implementation of a COMEDI Analog to Digital converter\n\nParameter\nDevice,channel and range (card specific!)\nReference 0: ground, 1: common, 2: diff, 3: other\n\nFor more details get the COMEDI documentation (www.comedi.org)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/comedi/DA.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "comedi", 3 | "name": "DA", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "DA", 9 | "params": "comediDABlk|Device: '/dev/comedi0':str|Channel: 0:int|Range: 0:int|Reference [0..3]:0:int", 10 | "help": "Implementation of a COMEDI Digital to Analog interface\n\nParameters:\nDevice, channel and range (card specific!)\nReference 0: ground, 1: common, 2: diff, 3: other\n\nFor more details get the COMEDI documentation (www.comedi.org)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiAI.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "AnalogIn", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "AD", 9 | "params": "brikiAIBlk|Pin:26:int|Umin [V]:0.0:double|Umax [V]:3.3:double", 10 | "help": "Parameters\nInput: Channel with value 0 to 5\n\nPIN\nA0 -> 26\t\nA1 -> 27\nA2 -> 28\nA3 -> 29\nA4 -> 30\nA5 -> 31\nA9 -> 20 (Microphone)\n\nThe input signal (0..3V) is automatically mapped to a value between Umin and Umax.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_5XXX/FH_5XXX_getV.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 5XXX", 3 | "name": "FH_5XXX_getV", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "FH_5XXX_getVBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This block implements the speed input interface of a MC5XXX Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH5XXX_INIT block!\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/NuttX_sensors/nuttx_DHTXXBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def nuttx_DHTXXBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | 7 | Call: nuttx_DHTXXBlk(pout, port) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | return RCPblk("nuttx_DHTXX", [], pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/arduinoFirmata/customRead_af.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def customRead_af(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: customRead_af(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("customRead_af", [], pout, [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/arduinoFirmata/digitalWrite_af.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def digitalWrite_af(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: digitalWrite_af(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("digitalWrite_af", pin, [], [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/arduinoFirmata/encoderRead_af.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def encoderRead_af(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: encoderRead_af(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("encoderRead_af", [], pout, [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_generic/can_gen_recvBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def can_gen_recvBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: can_gen_recvBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("can_gen_recv", [], pout, [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_generic/can_sdo_sendThBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def can_sdo_sendThBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: can_sdo_sendThBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("can_sdo_send", pin, [], [0, 0], 1, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_3XXX/FH_3XXX_ENCBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_3XXX_ENCBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: FH_3XXX_ENCBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("FH_3XXX_ENC", [], pout, [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_3XXX/FH_3XXX_getVBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_3XXX_getVBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: FH_3XXX_getVBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("FH_3XXX_getV", [], pout, [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_5XXX/FH_5XXX_ENCBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_5XXX_ENCBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: FH_5XXX_ENCBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("FH_5XXX_ENC", [], pout, [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_5XXX/FH_5XXX_getVBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_5XXX_getVBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: FH_5XXX_getVBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("FH_5XXX_getV", [], pout, [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/unixSkServer.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "UnixSkServer", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "UNIXSOCK", 9 | "params": "unixsocketSBlk|Socket: 'ssock':str|Default outputs:[0.]:double", 10 | "help": "This block implements a Unix Socket Server, which can receive signals from a client and pass them as double values into the block diagram.\n\nParameters:\nSocket: the socket name\nDefault output: the output before arriving of data\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_5XXX/FH_5XXX_AD.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 5XXX", 3 | "name": "FH_5XXX_AD", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "AD", 9 | "params": "FH_5XXX_ADBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Channel: 0:int", 10 | "help": "This block implements the analog input interface of a MC5XXX Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH5XXX_INIT block!\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_5XXX/FH_5XXX_getTQ.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 5XXX", 3 | "name": "FH_5XXX_getTQ", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_TQ", 9 | "params": "FH_5XXX_getTQBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This block implements the torque input interface of a MC5XXX Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH5XXX_INIT block!\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_5XXX/FH_5XXX_setTQ.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 5XXX", 3 | "name": "FH_5XXX_setTQ", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_TQ", 9 | "params": "FH_5XXX_setTQBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This block implements the torque output interface of a MC5XXX Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH5XXX_INIT block!\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Maxon/Epos_AD.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Maxon", 3 | "name": "Epos_AD", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "AD", 9 | "params": "epos_areadBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Channel [0/1]: 0:int", 10 | "help": "This Block implements the functions related to a Maxon EPOS motion controller for Analog read.\n\nParameters:\nCan dev: device (ex. '/dev/can0')\nDevice ID and channel number\n\nsee the Maxon homepage for more details (www.maxon.com)\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/nonlin/SwitchOut.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "nonlin", 3 | "name": "Output Switch", 4 | "ip": 2, 5 | "op": 2, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "SWITCH_OUT", 9 | "params": "switchOutBlk|Compare Value: 0.5:double", 10 | "help": "This block decides which output is used based on the value in input 2. If this value is greater than \"Compare\" value set in block\u00b4s parameters, then input 1 is routed to output 2 and vice versa.\n\nZero value is written to the output that is not currently used.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_5XXX/FH_5XXX_getTQBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_5XXX_getTQBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: FH_5XXX_getTQBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | return RCPblk("FH_5XXX_getTQ", [], pout, [0, 0], 0, params) 19 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_5XXX/FH_5XXX_setTQBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def FH_5XXX_setTQBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | 7 | Call: FH_5XXX_setTQBlk(pin, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | return RCPblk("FH_5XXX_setTQ", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_3XXX/FH_3XXX_AD.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 3XXX", 3 | "name": "FH_3XXX_AD", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "AD", 9 | "params": "FH_3XXX_ADBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This block implements the analog input interface of a MCDC 3002 or a MCBL 3002 Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH3XXX_INIT block!\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_3XXX/FH_3XXX_V.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 3XXX", 3 | "name": "FH_3XXX_V", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_V", 9 | "params": "FH_3XXX_VBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This block implements the speed output interface of a MCDC 3002 or a MCBL 3002 Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH3XXX_INIT block!\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_3XXX/FH_3XXX_getV.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 3XXX", 3 | "name": "FH_3XXX_getV", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "FH_3XXX_getVBlk|Can dev:'/dev/pcan32'|Device ID: 0x01:int", 10 | "help": "This block implements the speed input interface of a MCDC 3002 or a MCBL 3002 Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH3XXX_INIT block!\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/linear/Init_enc.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linear", 3 | "name": "Init_enc", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "INIT", 9 | "params": "init_encBlk|Trigger Time: 1:double|Default Output: 0:double|Offset: 0:double", 10 | "help": "Tis block can be used to initialize a generic input after a given time to a specific value\n\nThe block put in output the default value till the execution time reaches the \"trigger time\" and then put the difference between input signal and offset.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/nonlin/upowBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def upowBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: upowBlk(pin, pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | return RCPblk("upow", pin, pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/output/ledStream.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def ledStream(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: ledStream(pin, param) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("Internal", 0, RcpParam.Type.INT)) 19 | return RCPblk("led", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX/nuttx_PWM.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX", 3 | "name": "PWM", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 1, 7 | "stout": 0, 8 | "icon": "PWM", 9 | "params": "nuttx_PWMBlk|Port:'/dev/pwm0':str|channels: [1]:int|PWM freq [Hz]:10000:double|Umin [V]:0.0:double|Umax [V]:100.0:double", 10 | "help": "Parameters\nPort : device name\nchannel: 1..4 (array)\nFrequency: PWM freq in Hz\nUmin [V]: minimal value (umin -> 0%)\nUmax [V] : maximal value (umax -> 100%)\n\nCan have multiple inputs to support\nmultiple channel PWM.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/linear/LTI_continous.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linear", 3 | "name": "LTI_continous", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 1, 8 | "icon": "CSS", 9 | "params": "cssBlk|System:tf(1,[1,1])|Initial conditions: 0:double", 10 | "help": "This block implements a linear continous dynamic system.\n\nIt can be defined as transfer function (control.tf) or as state space system (control.ss)\n\nParameters:\nLTI continous system\nInitial conditions of the state(s) as array, or \"0\" (all states have 0 initial conditions)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Raspberry/AccelBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def AccelBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: AccelBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("Internal", 0, RcpParam.Type.INT)) 19 | return RCPblk("ImuAcc", [], pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Raspberry/GyroBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def GyroBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: GyroBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("Internal", 0, RcpParam.Type.INT)) 19 | return RCPblk("ImuGyro", [], pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Raspberry/pi_ADBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def pi_ADBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: pi_ADBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("Internal", 0, RcpParam.Type.INT)) 19 | return RCPblk("pi_AD", [], pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/output/scopeStream.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def scopeStream(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: scopeStream(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("Internal", 0, RcpParam.Type.INT)) 19 | return RCPblk("scope", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Maxon/Epos_enc.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Maxon", 3 | "name": "Epos_enc", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "epos_EncBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Resolution: 1000:double", 10 | "help": "This Block implements the functions related to a Maxon EPOS motion controller for Encoder read.\n\nParameters:\nCan dev: device (ex. '/dev/can0')\nDevice ID and encoder resolution (to angle in radiants)\n\nSee the Maxon homepage for more details (www.maxon.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Maxon/Maxon_enc.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Maxon", 3 | "name": "Maxon_enc", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "maxon_EncBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Resolution: 1000:double", 10 | "help": "This Block implements the functions related to a Maxon motion controller for Encoder read.\n\nParameters:\nCan dev: device (ex. '/dev/can0'\nDevice ID and encoder resolution (to angle in radiants)\n\nMore info are available at the maxon homepage www.maxon.com.\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/linear/LTI_discrete.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linear", 3 | "name": "LTI_discrete", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 1, 8 | "icon": "DSS", 9 | "params": "dssBlk|System: sys|Initial conditions: 0:double", 10 | "help": "This block implements a linear discrete dynamic system.\n\nIt can be defined as transfer function (control.tf) or as state space system (control.ss)\n\nParameters:\nLTI discrete system\nInitial conditions of the state(s) as array, or \"0\" (in case that all the states have 0 initial condition).\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/NuttX/nuttxDOBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def nuttxDOBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: nuttxDOBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 19 | return RCPblk("nuttxDO", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/arduinoFirmata/analogWrite_af.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def analogWrite_af(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: analogWrite_af(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | return RCPblk("analogWrite_af", pin, [], [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/input/sweepBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import pi 3 | 4 | 5 | def sweepBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: sweepBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | params[0].value = 2 * pi * params[0].value 20 | return RCPblk("sweep", [], pout, [0, 0], 0, params) 21 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/NuttX/nuttx_DACBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def nuttx_DACBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: nuttx_DACBlk(pin, param) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 19 | return RCPblk("nuttx_DAC", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_generic/can_sdo_recvBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def can_sdo_recvBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: can_sdo_recvBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params[1].value = params[1] + 0x580 19 | return RCPblk("can_sdo_recv", [], pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/nonlin/deadzoneBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def deadzoneBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | 7 | Call: deadzoneBlk(pin, pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | pout: connected output port(s) 13 | params: block's parameters 14 | 15 | Returns 16 | ------- 17 | Block's reprezentation RCPblk 18 | """ 19 | 20 | return RCPblk("deadzone", pin, pout, [0, 0], 1, params) 21 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/nonlin/switchOutBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def switchOutBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: switchOutBlk(pin, pout, val) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input ports 11 | pout: connected output ports 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | return RCPblk("switch_output", pin, pout, [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX/nuttxENC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX", 3 | "name": "ENC", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "ENC", 9 | "params": "nuttxENCBlk|Port:'/dev/qe0':str|Resolution:500:double| reset counter [1 yes]:1:int", 10 | "help": "This block can have 1 or 3 outputs. Only position is returned if one output is used, position, index and index cound is returned if 3 outputs are selected.\n\nParameters\nPort: device name\nResolution: Encoder resolution (can be 0 if no resolution required)\nReset: 1=yes, 0 = no\n\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Maxon/Maxon_mot_I.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Maxon", 3 | "name": "Maxon_mot_I", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_I", 9 | "params": "maxon_MotBlk|Can dev: '/dev/pcan32':str|Device ID: 0x01:int|Prop. gain: 2200:double|Integ. gain: 500:double", 10 | "help": "This Block implements the functions related to a Maxon motion controller for Torque writing\n\nParameters:\nCan dev: device (ex. '/dev/can0'\nDevice ID\nController parameters\n\nMore info are available at the maxon homepage www.maxon.com.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/linux_mz_apo/mz_apo_3pmdrv1.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "linux_mz_apo", 3 | "name": "Phase3Motor_mz_apo_3pmdrv1", 4 | "ip": 6, 5 | "op": 7, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT", 9 | "params": "mz_apo_3pmdrv1", 10 | "help": "Block for controlling 3-Phase PMSM Motor on MZ Apo\n\n Inputs:\nu[0] to u[2] are PWM values, u[3] to u[5] are PWM enable signals \n\n Outputs:\ny[0] to y[2] are currents from ADC (12 bit, zero in the middle, uncalibrated)\nu[3] is IRC position, u[4] is IRC idx and u[5] is IRC index occur\nu[6] is HAL sector." 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/hall3ph2secBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def hall3ph2secBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: hall3ph2secBlk(pin, pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | return RCPblk("hall3ph2sec", pin, pout, [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/NuttX/P3MotNuttxBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def P3MotNuttxBlk(pin: list[int], pout: list[int]) -> RCPblk: 5 | """ 6 | Call: P3MotNuttxBlk(pin, pout) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params = RcpParam("File descriptor", 0, RcpParam.Type.INT) 19 | return RCPblk("nuttx_p3m_spi", pin, pout, [0, 0], params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/NuttX/nuttxDIBlk.py: -------------------------------------------------------------------------------- 1 | 2 | from supsisim.RCPblk import RCPblk, RcpParam 3 | 4 | 5 | def nuttxDIBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: nuttxDIBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 20 | return RCPblk('nuttxDI', [], pout, [0,0], 0, params) 21 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/STM32H7/USB_OTG_OutBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def USB_OTG_OutBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: USB_OTG_OutBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("Internal", 0, RcpParam.Type.INT)) 19 | return RCPblk("USB_OTG_Out", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Math/Rel.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "math", 3 | "name": "Relation Operator", 4 | "ip": 2, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "REL", 9 | "params": "relBlk|operator: '==':str", 10 | "help": "This block performs relational operation on two inputs\n\nSupported operations:\n '==' inputs are equal\n '!=' inputs are not equal\n '>=' input 1 is greater than or equal to input 2\n '<=' input 1 is less than or equal to input 2\n '>' input 1 is greater than input 2\n '<' input 1 is less than input 2\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_5XXX/FH_5XXX_X.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 5XXX", 3 | "name": "FH_5XXX_X", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_X", 9 | "params": "FH_5XXX_XBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This block implements the position output interface of a MC5XXX Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH5XXX_INIT block!\n\nThe output is given as encoder value for the motor.\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/brikiSerialOutBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def brikiSerialOutBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: brikiSerialOut(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("Internal", 0, RcpParam.Type.INT)) 19 | return RCPblk("serialOut", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | setuptools # MIT 2 | cmake # Apache Software License 2.0, BSD License 3 | tk-tools # MIT 4 | qtconsole>=5.0.2 # BSD License 5 | numpy>=1.19.5 # BSD License 6 | control>=0.9.2 # BSD License 7 | matplotlib>=3.3.4 # Python Software Foundation License (PSF) 8 | slycot>=0.5.0 # GNU General Public License v2 (GPLv2) (GPL-2.0) 9 | sympy>=1.7.1 # BSD License 10 | pyqtgraph>=0.11.0 # MIT 11 | lxml>=4.6.3 # BSD License 12 | tornado>=6.1 # Apache Software License 2.0 13 | scikit-build>=0.15.0 # MIT 14 | pyshv>=0.8.0 #MIT 15 | typing-extensions>=4.13.1 # PSF-2.0 16 | PyQt6 # GPLv3 17 | -------------------------------------------------------------------------------- /resources/blocks/blocks/input/Extdata.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "input", 3 | "name": "Extdata", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "EXTDATA", 9 | "params": "extdataBlk|Channels: 1: int|Data length: 1000: int|File name: 'data.txt':str", 10 | "help": "This block implements input signals read from an externel file.\n\nThe data are put repetively to the out as periodic signal.\n\nParameters:\nChannels: number of signals in output\nData lenght (must be the same for all the outputs!)\nFilename (the values are stored in column without the time)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/serialInBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def serialInBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: serialInBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 19 | return RCPblk("serialIn", [], pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/serialOutBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def serialOutBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: serialOutBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 19 | return RCPblk("serialOut", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/blocks/can_generic/canSDO_RecvMsg.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can generic", 3 | "name": "canSDO_RecvMsg", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "CAN_SDO_RECV", 9 | "params": "can_sdo_recvBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Index: 0x6064:int|SubIndex: 0x00:int|Conversion factor: 1.0:double", 10 | "help": "Implementation of a standard CAN bus generic message to be received\n\nParameters\nCan dev: device (ex. '/dev/can0')\nDevice ID: can ID (ex. 0x01)\nMessage Index and subindex\nMultiplication factor of the return value\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_generic/canSDO_SendMsg.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can generic", 3 | "name": "canSDO_SendMsg", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "CAN_SDO_SEND", 9 | "params": "can_sdo_sendThBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Index: 0x2030:int|SubIndex: 0x00:int| Data: 0x00:int| Use Input [0/1 no/yes]: 1:int", 10 | "help": "Implementation of a generic CAN bus message send\n\nParameters:\nCan dev: device (ex. '/dev/can0')\nDevice ID (ex. 0x01)\nIndex and subindex\nData type (byte,word,dword)\nUsing the input of the block\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/AR2INO/ar2inoENCBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def ar2inoENCBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: ar2inoENCBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.insert(0, RcpParam("Resolution multiplier", 4, RcpParam.Type.INT)) 19 | return RCPblk("ar2inoENC", [], pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/UDPsocketTxBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def UDPsocketTxBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: UDPsocketTxBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 19 | return RCPblk("UDPsocketTx", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/NuttX/nuttxSerialOutBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def nuttxSerialOutBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: nuttxSerialOutBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 19 | return RCPblk("serialOut", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/UDPsocketRxBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def UDPsocketRxBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: UDPsocketRxBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 19 | return RCPblk("UDPsocketRx", [], pout, [0, 0], 0, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiESC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "eSpeedControl", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ESC", 9 | "params": "brikiESCBlk|Pin:0:int|Umin [V]:-10:double|Umax [V]:10:double", 10 | "help": "This block implements the \"electronic speed function\" in the Arduino World.\nThis block can be used to move motors or servo motors.\n\nParameters:\nPin : Pin Number\nUmin [V]: Umin\nUmax [V]: Umax\n\nThe input signal can be a value between Umin and Umax and is automatically mapped to 500-2500us in the ESC system.\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/SAMD21/brikiPWM.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "SAMD21", 3 | "name": "PWM", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "PWM", 9 | "params": "brikiPWMBlk|Pin:0:int|Umin [V]:0.0:double|Umax [V]:3.3:double|Freq:1000:int", 10 | "help": "This block implements a PWM output on the Briki system.\n\nParameters:\nChannel: Channels on the ABC board\n\n\nPossible values for the channel are: 11, 13, 21, 22, 23, 24, 25\n\nThe input signal can be a value between Umin and Umax and is automatically mapped to the PWM width 0-100%, with a resolution of 12 bit.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_3XXX/FH_3XXX_X.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 3XXX", 3 | "name": "FH_3XXX_X", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_X", 9 | "params": "FH_3XXX_XBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int", 10 | "help": "This block implements the position output interface of a MCDC 3002 or a MCBL 3002 Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH3XXX_INIT block!\n\nThe output is given as encoder value for the motor.\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Raspberry/pwmBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def pwmBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: pwmBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | if params[0].value == 0: 18 | params[0].value = 1 19 | else: 20 | params[0].value = 23 21 | 22 | return RCPblk("pwm", pin, [], [0, 0], 1, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_3XXX/FH_CO_mot_X.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 3XXX", 3 | "name": "FH_CO_mot_X", 4 | "ip": 1, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "MOT_X", 9 | "params": "FH_CO_MotXBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Resolution: 125000:double", 10 | "help": "This block implement the Canopen output for the motor position for a MCDC 3002 or MCBL 3002 Faulhaber motion controller for synchronized output.\n\nIn the Block diagram shoud be present the FH3XXX_INIT block!\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/serialOutFloatBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def serialOutFloatBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: serialOutFloatBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 19 | return RCPblk("serialOutFloat", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/shmemInBlk.py: -------------------------------------------------------------------------------- 1 | 2 | from supsisim.RCPblk import RCPblk, RcpParam 3 | from numpy import size 4 | 5 | def shmemInBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | 8 | Call: shmemInBlk(pout, name) 9 | 10 | Parameters 11 | ---------- 12 | pout: connected output port(s) 13 | name : SHM name 14 | 15 | Returns 16 | ------- 17 | blk: RCPblk 18 | 19 | """ 20 | 21 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 22 | blk = RCPblk('shmemIn', [], pout, [0,0], 0, params) 23 | return blk 24 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/shmemOutBlk.py: -------------------------------------------------------------------------------- 1 | 2 | from supsisim.RCPblk import RCPblk, RcpParam 3 | from numpy import size 4 | 5 | def shmemOutBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | 8 | Call: shmemOutBlk(pin, name) 9 | 10 | Parameters 11 | ---------- 12 | pin: connected input port(s) 13 | name : SHM name 14 | 15 | Returns 16 | ------- 17 | blk: RCPblk 18 | 19 | """ 20 | 21 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 22 | blk = RCPblk('shmemOut', pin, [], [0,0], 1, params) 23 | return blk 24 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/output/plotJugglerBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def plotJugglerBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """Create an interactive scope. 6 | Call: plotJugglerBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("Internal", 0, RcpParam.Type.INT)) 19 | return RCPblk("plotJuggler", pin, [], [0, 0], 1, params) 20 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/serialInFloatBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def serialInFloatBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | 7 | Call: serialInFloatBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 20 | return RCPblk("serialInFloat", [], pout, [0, 0], 0, params) 21 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/tos1a/tos1a.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def tos1a(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: tos1a(pin, pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | params.append(RcpParam("Internal", 0, RcpParam.Type.INT)) 20 | return RCPblk("tos1a", pin, pout, [0, 0], 0, params) 21 | -------------------------------------------------------------------------------- /CodeGen/LinuxRT/fmu/fmuinc/fmu_fun.h: -------------------------------------------------------------------------------- 1 | #define UNZIP_CMD "unzip -o -d " 2 | #define RESOURCES_DIR "resources" 3 | #define DLL_DIR "binaries/linux64/" 4 | #define XML_FILE "modelDescription.xml" 5 | #define DLL_SUFFIX ".so" 6 | 7 | char *getTempResourcesLocation(const char* fmuFileName); 8 | void *getAdr(int *success, HMODULE dllHandle, const char *functionName); 9 | void loadFMU(FMU * fmu, const char* fmuFileName); 10 | void deleteUnzippedFiles(const char* fmuFileName); 11 | void fmuLogger(void *componentEnvironment, fmi2String instanceName, fmi2Status status, fmi2String category, fmi2String message, ...); 12 | -------------------------------------------------------------------------------- /resources/blocks/blocks/NuttX/nuttx_ADC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "NuttX", 3 | "name": "ADC", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 1, 8 | "icon": "AD", 9 | "params": "nuttx_ADCBlk|Port:'/dev/adc0':str|Channel: [0]:int|Resolution: 4095:int|SW Trigger needed: 0:int|Umin [V]:0.0:double|Umax [V]:3.3:double", 10 | "help": "Parameters\nChannel: [0, 1,..] Target depending\nPort : device name (ex. '/dev/adc0')\nSW Trigger On/Off: 1/0 - some ADCs need to be SW triggered first to measure\nResolution of ADC\nUmin [V]: minimal value (0 volt read -> umin)\nUmax [V] : maximal value (3.3V read -> umax)\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Maxon/Init_EposMot.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Maxon", 3 | "name": "Init_EposMot", 4 | "ip": 0, 5 | "op": 0, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "IN_EPOS", 9 | "params": "init_epos_MotIBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Prop. gain: 2200:double|Integ. gain: 500:double|Mode (1->Pos,2-> Vel,3-> Current):3:int", 10 | "help": "This block initialize a Maxon EPOS motion controller for different operations\n\nParameters:\nCan dev: device (ex. '/dev/can0')\nDevice ID\nControllers values\nOperation mode\n\nMore info are availbale at the Maxon homepage www.maxon.com\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/blocks/nonlin/Switch.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "nonlin", 3 | "name": "Switch", 4 | "ip": 3, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "SWITCH", 9 | "params": "switchBlk|Condition [0 < or 1 >] : 0:int|Compare Value: 0.5:double|Persistence [0 no or 1 yes]: 0:int", 10 | "help": "This block compare the signal on input 3 with the value of parameter 2 using the function given with parameters 1, and switch consequently from input 1 to input 2.\n\nThe 3rd parameters gives info about the possibility to pass from input 2 to input 1 again (0 yes, 1 no) or to block the changed situation.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/prodBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | from numpy import size 3 | 4 | 5 | def prodBlk(pin: list[int], pout: list[int]) -> RCPblk: 6 | """ 7 | Call: prodBlk(pin, pout) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | pout: connected output port(s) 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | return RCPblk("prod", pin, pout, [0, 0], 1) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/AR2INO/ar2inoDOBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def ar2inoDOBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: ar2inoDOBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | if 2 <= params[0].value <= 5: 19 | raise ValueError("Pin %i is reserved for encoders!" % (params[0].value)) 20 | 21 | return RCPblk("ar2inoDO", pin, [], [0, 0], 1, params) 22 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/unixsocketCBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def unixsocketCBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: unixsocketCBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params[0].value = "/tmp/" + params[0].value 19 | params.append(RcpParam("Socket", 0, RcpParam.Type.INT)) 20 | return RCPblk("unixsockC", pin, [], [0, 0], 1, params) 21 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/AR2INO/ar2inoAIBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def ar2inoAIBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: ar2inoAIBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | if 2 <= params[0].value <= 5: 19 | raise ValueError("Pin %i is reserved for encoders!" % (params[0].value)) 20 | 21 | return RCPblk("ar2inoAI", [], pout, [0, 0], 0, params) 22 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/AR2INO/ar2inoDIBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def ar2inoDIBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: ar2inoDIBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | if 2 <= params[0].value <= 5: 19 | raise ValueError("Pin %i is reserved for encoders!" % (params[0].value)) 20 | 21 | return RCPblk("ar2inoDI", [], pout, [0, 0], 0, params) 22 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/AR2INO/ar2inoPWMBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def ar2inoPWMBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: ar2inoPWMBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | if 2 <= params[0].value <= 5: 19 | raise ValueError("Pin %i is reserved for encoders!" % (params[0].value)) 20 | 21 | return RCPblk("ar2inoPWM", pin, [], [0, 0], 1, params) 22 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/unixsocketSBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def unixsocketSBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: unixsocketSBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params[0].value = "/tmp/" + params[0].value 19 | params.append(RcpParam("Socket", 0, RcpParam.Type.INT)) 20 | return RCPblk("unixsockS", [], pout, [0, 0], 0, params) 21 | -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_5XXX/FH_5XXX_ENC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 5XXX", 3 | "name": "FH_5XXX_ENC", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "FH_5XXX_ENCBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Resolution: 1:double", 10 | "help": "This block implements the encoder input interface of a MC5XXX Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH5XXX_INIT block!\n\nParameters:\nCan dev: device (ex. '/dev/can0')\nResolution (not related to a rotation!)\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/input/stepBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def stepBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: stepBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | return RCPblk("step", [], pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /CodeGen/arduinoFirmata/src/help_TCLab_temperature.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | //#include "firmata.h" 5 | 6 | 7 | double convertToTemp2(python_block *block) { 8 | 9 | double *u = block->u[0]; 10 | double U = (double)u[0] / 1024; // ADCREF = 1024 for arduino uno 11 | 12 | return (U * 5000.0 - 500.0) / 10.0; 13 | } 14 | 15 | static void inout(python_block *block) 16 | { 17 | double *y = block->y[0]; 18 | y[0] = convertToTemp2(block); 19 | } 20 | 21 | void help_TCLab_temperature(int flag, python_block *block) 22 | { 23 | if (flag==CG_OUT){ 24 | inout(block); 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/STM32H7/stm32AOBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def stm32AOBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: stm32AOBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | if params[0].valu < 0 or params[0].valu > 1: 19 | raise ValueError("Channel should have value 0 or 1 not %d" % params[0].valu) 20 | 21 | return RCPblk("stm32AO", pin, [], [0, 0], 1, params) 22 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/input/constBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def constBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: constBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | return RCPblk("constant", [], pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/input/sineBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def sineBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: sineBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if (nin := size(pout)) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % nin) 21 | 22 | return RCPblk("sinus", [], pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /CodeGen/Common/rules/make-ulut.inc: -------------------------------------------------------------------------------- 1 | # Makefile fragment for devices to download and build uLUt library 2 | 3 | .PHONY: make-ulut 4 | 5 | make-ulut: 6 | $(EXT_LIBS)/extlib-fetch.sh ulut 7 | cd $(EXT_LIBS)/ulut && make all \ 8 | CC="$(CC)" \ 9 | CXX="$(CXX)" \ 10 | CFLAGS="$(EXTLIB_CFLAGS)" \ 11 | CXXFLAGS="$(EXTLIB_CXXFLAGS)" \ 12 | LD="$(LD)" \ 13 | LDFLAGS="$(EXTLIB_LDFLAGS)" \ 14 | CONFIG_OC_ULUT_TESTS=n \ 15 | CONFIG_OC_ULUT_INCDIRONLY=y \ 16 | CONFIG_FILE=$(CURDIR)/config-ulut.omk \ 17 | W=1 \ 18 | OUTPUT_DIR="$(CURDIR)" \ 19 | USER_INCLUDE_DIR="$(OMK_COMPILED_INC_PATH)" \ 20 | USER_LIB_DIR="$(OMK_COMPILED_LIB_PATH)" 21 | -------------------------------------------------------------------------------- /resources/blocks/Icons/REL.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/STM32H7/stm32AIBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def stm32AIBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: stm32AIBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | if params[0].value > 9 or params[0].value < 0: 19 | raise ValueError("Channel should be in range 0-7 not %d" % params[0].value) 20 | 21 | return RCPblk("stm32AI", [], pout, [0, 0], 0, params) 22 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/input/squareBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def squareBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: squareBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | return RCPblk("squareSignal", [], pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/blocks/can_generic/Baumer_enc.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can generic", 3 | "name": "Baumer_enc", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "baumer_EncBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Resolution: 500:double|Encoder reset (1->Yes,0->No):1:int", 10 | "help": "This block implements the input of a Baumer differential encoder on the CABN bus.\n\nParameters:\nCan dev: device (ex. '/dev/can0')\nDevice ID: can bus device ID (ex. 0x01)\nResolution: Resolution of the encoder\nEncoder reset: 1 or 0. Setting this value to 1 reset the encoder at the beginning of the simulation.\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/AR2INO/ar2inoAOBlk.py: -------------------------------------------------------------------------------- 1 | 2 | from supsisim.RCPblk import RCPblk, RcpParam 3 | from numpy import size 4 | 5 | def ar2inoAOBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | 8 | Call: brikiAOBlk(pin, pin) 9 | 10 | Parameters 11 | ---------- 12 | pin: connected input port(s) 13 | pin : Pin 14 | 15 | Returns 16 | ------- 17 | blk: RCPblk 18 | 19 | """ 20 | DAlist = [14] 21 | if ch not in DAlist: 22 | raise ValueError("You pass a channel which is correct %i" % (ch)) 23 | 24 | blk = RCPblk('ar2inoAO', pin, [], [0,0], 1, params) 25 | return blk 26 | -------------------------------------------------------------------------------- /CodeGen/arduinoFirmata/tools/FirmataTest/test.c: -------------------------------------------------------------------------------- 1 | #include "firmata.h" 2 | 3 | int main() { 4 | t_firmata * firmata; 5 | int i = 0; 6 | 7 | firmata = firmata_new("/dev/ttyACM0"); //init Firmata 8 | while (!firmata -> isReady) { 9 | //Wait until device is up 10 | firmata_pull(firmata); 11 | } 12 | 13 | // firmata_pinMode(firmata, 8, MODE_OUTPUT); //set pin 13 (led on most arduino) to out 14 | 15 | while (1) { 16 | sleep(1); 17 | firmata_pull(firmata); 18 | 19 | if (i++ % 2) 20 | firmata_digitalWrite(firmata, 8, HIGH); //light led 21 | else 22 | firmata_digitalWrite(firmata, 8, LOW); //unlight led 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /resources/blocks/blocks/can_Faulhaber_3XXX/FH_3XXX_ENC.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can Faulhaber 3XXX", 3 | "name": "FH_3XXX_ENC", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "ENC", 9 | "params": "FH_3XXX_ENCBlk|Can dev:'/dev/pcan32':str|Device ID: 0x01:int|Resolution: 1:double", 10 | "help": "This block implements the encoder input interface of a MCDC 3002 or a MCBL 3002 Faulhaber motion controller.\n\nIn the Block diagram shoud be present the FH3XXX_INIT block!\n\nParameters:\nCan dev: device (ex. '/dev/can0')\nResolution (not only related to a rotation!)\n\nSee the Faulhaber homepage for more details (www.faulhaber.com)\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/arduinoFirmata/help_HeatShield_temperature.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def help_HeatShield_temperature( 5 | pin: list[int], pout: list[int], params: RcpParam 6 | ) -> RCPblk: 7 | """ 8 | 9 | Call: help_HeatShield_temperature(pin, pout, params) 10 | 11 | Parameters 12 | ---------- 13 | pin: connected input port(s) 14 | pout: connected output port(s) 15 | params: block's parameters 16 | 17 | Returns 18 | ------- 19 | Block's reprezentation RCPblk 20 | """ 21 | 22 | return RCPblk("help_HeatShield_temperature", pin, pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_3XXX/FH_3XXX_XBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def FH_3XXX_XBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: FH_3XXX_XBlk(pin, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pin) != 1: 20 | raise ValueError("Block should have 1 input port; received %i." % size(pin)) 21 | 22 | return RCPblk("FH_3XXX_X", pin, [], [0, 0], 1, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_5XXX/FH_5XXX_XBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def FH_5XXX_XBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: FH_5XXX_XBlk(pin, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pin) != 1: 20 | raise ValueError("Block should have 1 input port; received %i." % size(pin)) 21 | 22 | return RCPblk("FH_5XXX_X", pin, [], [0, 0], 1, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Maxon/epos_MotIBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def epos_MotIBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: epos_MotIBlk(pin, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pin) != 1: 20 | raise ValueError("Block should have 1 input port; received %i." % size(pin)) 21 | 22 | return RCPblk("epos_canopen_motI", pin, [], [0, 0], 1, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Maxon/epos_MotXBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def epos_MotXBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: epos_MotXBlk(pin, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pin) != 1: 20 | raise ValueError("Block should have 1 input port; received %i." % size(pin)) 21 | 22 | return RCPblk("epos_canopen_motX", pin, [], [0, 0], 1, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/comedi/comediDABlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def comediDABlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: comediDABlk(pin, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pin) != 1: 20 | raise ValueError("Block should have 1 input port; received %i !" % size(pin)) 21 | 22 | return RCPblk("comedi_analog_output", pin, [], [0, 0], 1, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/comedi/comediDOBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def comediDOBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: comediDOBlk(pin, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pin) != 1: 20 | raise ValueError("Block should have 1 input port; received %i !" % size(pin)) 21 | 22 | return RCPblk("comedi_digital_output", pin, [], [0, 0], 1, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/blocks/can_generic/canGeneric_RecvMsg.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "can generic", 3 | "name": "canGeneric_RecvMsg", 4 | "ip": 0, 5 | "op": 1, 6 | "stin": 0, 7 | "stout": 0, 8 | "icon": "CAN_GEN_RECV", 9 | "params": "can_gen_recvBlk|Can dev:'/dev/pcan32':str|Device ID: 0x3FF:int|ReturnID: 0x7FF:int|Index: 0x6004:int|SubIndex: 0x00:int|Conversion factor: 1.0:double", 10 | "help": "Implementation of a CAN bus generic message to be received\n\nParameters\nCan dev: device (ex. '/dev/can0')\nDevice ID: can ID (ex. 0x601)\nReturn ID: Return ID in the return message (ex. 0x581)\nMessage Index and subindex\nMultiplication factor of the return value\n\n" 11 | } -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/comedi/comediADBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def comediADBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: comediADBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 input port; received %i !" % size(pout)) 21 | 22 | return RCPblk("comedi_analog_input", [], pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /CodeGen/Common/include/canopen.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | union canDATA{ 4 | uint8_t u8[8]; 5 | uint16_t u16[4]; 6 | uint32_t u32[2]; 7 | }; 8 | 9 | typedef union canDATA cdata; 10 | 11 | void sendMsg(uint16_t ID, uint8_t DATA[], int len); 12 | int rcvMsg(uint8_t DATA[], int timeout); 13 | int rcvMsgCob(int cob, uint8_t DATA[], int timeout); 14 | int canOpen(char * dev); 15 | int canOpenTH(char * dev); 16 | void canClose(void); 17 | void canopen_synch(void); 18 | int registerMsg(uint16_t ID, uint16_t index, uint8_t subindex); 19 | int getValue(uint16_t ID, uint16_t index, uint8_t subindex); 20 | short get2ByteValue(uint16_t ID, uint16_t index, uint8_t subindex); 21 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_3XXX/FH_CO_MotXBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def FH_CO_MotXBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: FH_CO_MotXBlk(pin, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pin) != 1: 20 | raise ValueError("Block should have 1 input port; received %i." % size(pin)) 21 | 22 | return RCPblk("FH_canopen_motX", pin, [], [0, 0], 1, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/comedi/comediDIBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def comediDIBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | 8 | Call: comediDIBlk(pout, params) 9 | 10 | Parameters 11 | ---------- 12 | pout: connected output port(s) 13 | params: block's parameters 14 | 15 | Returns 16 | ------- 17 | Block's reprezentation RCPblk 18 | """ 19 | 20 | if size(pout) != 1: 21 | raise ValueError("Block should have 1 input port; received %i !" % size(pout)) 22 | 23 | return RCPblk("comedi_digital_input", [], pout, [0, 0], 0, params) 24 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_3XXX/FH_3XXX_ADBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def FH_3XXX_ADBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: FH_3XXX_ADBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | return RCPblk("FH_3XXX_AD", [], pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Faulhaber_5XXX/FH_5XXX_ADBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def FH_5XXX_ADBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: FH_5XXX_ADBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | return RCPblk("FH_5XXX_AD", [], pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Maxon/epos_areadBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def epos_areadBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: epos_areadBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | return RCPblk("epos_canopen_aread", [], pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/blocks/Communication/TCPsocketAsyncBlk.xblk: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "Communication", 3 | "name": "TCPsocketAsync", 4 | "ip": 1, 5 | "op": 1, 6 | "stin": 1, 7 | "stout": 1, 8 | "icon": "TCPSOCKET", 9 | "params": "TCPsocketAsyncBlk|IP Addr:'127.0.0.1':str|Port:1024:int|Buffer Size:32:int|Downsampling factor:1:int", 10 | "help": "This block implements an asynchronous TCP sender and optional receiver\nThis block keep a real time capabilities as send and receive is done in a separate thread from the main application.\nParameters\nIP address of the receiver\nPort\nBuffer size of send buffer\nDownsampling factor: data is sent/received only per xth sample.\n" 11 | } 12 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/STM32H7/stm32PWMBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def stm32PWMBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: stm32PWMBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | if params[0].value < 1 or params[0].value > 4: 19 | raise ValueError( 20 | "Channel should have value 1 2 3 or 4 not %d" % params[0].value 21 | ) 22 | 23 | return RCPblk("stm32PWM", pin, [], [0, 0], 1, params) 24 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/relBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def relBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: relBlk(pin, pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pin: connected input ports 12 | pout: connected output port 13 | params: block's parameters 14 | 15 | Returns 16 | ------- 17 | Block's reprezentation RCPblk 18 | """ 19 | 20 | if size(pout) != 1: 21 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 22 | 23 | return RCPblk("rel", pin, pout, [0, 0], 1, params) 24 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Maxon/maxon_MotBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def maxon_MotBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Maxon driver for torque control 8 | 9 | Call: maxon_MotBlk(pin, params) 10 | 11 | Parameters 12 | ---------- 13 | pin: connected input port(s) 14 | params: block's parameters 15 | 16 | Returns 17 | ------- 18 | Block's reprezentation RCPblk 19 | """ 20 | 21 | if size(pin) != 1: 22 | raise ValueError("Block should have 1 input port; received %i." % size(pin)) 23 | 24 | return RCPblk("maxon_mot", pin, [], [0, 0], 1, params) 25 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/linux_mz_apo/mz_apo_DCmotBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def mz_apo_DCmotBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: mz_apo_DCmotBlk(pin, pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pin : connected input ports 11 | pout: connected output ports 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | params.append( 20 | RcpParam("Motor position", 0, RcpParam.Type.INT, RcpParam.ShvFlag.VISIBLE) 21 | ) 22 | return RCPblk("mz_apo_DCmot", pin, pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/nonlin/absBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk 2 | from numpy import size 3 | 4 | 5 | def absBlk(pin: list[int], pout: list[int]) -> RCPblk: 6 | """ 7 | Call: absBlk(pin, pout) 8 | 9 | Parameters 10 | ---------- 11 | pin : connected input ports 12 | pout: connected output ports 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != size(pin): 20 | raise ValueError( 21 | "Block should have same input and output port sizes; received %i %i." 22 | % (size(pin), size(pout)) 23 | ) 24 | return RCPblk("absV", pin, pout, [0, 0], 1) 25 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Math/pmsm_alignBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def pmsm_alignBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: pmsm_alignBlk(pin, pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | params.append(RcpParam("Internal 1", 0, RcpParam.Type.INT)) 20 | params.append(RcpParam("Internal 2", 0, RcpParam.Type.INT)) 21 | return RCPblk("pmsm_align", pin, pout, [0, 0], 1, params) 22 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Raspberry/compFiltBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def compFiltBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: compFiltBlk(pin, pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | params.append(RcpParam("Internal 1", 0, RcpParam.Type.DOUBLE)) 20 | params.append(RcpParam("Internal 2", 0, RcpParam.Type.DOUBLE)) 21 | return RCPblk("compFilt", pin, pout, [0, 1], 0, params) 22 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Maxon/epos_EncBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def epos_EncBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: epos_EncBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | params[2].value = 4 * params[2].value 23 | return RCPblk("epos_canopen_enc", [], pout, [0, 0], 0, params) 24 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_Maxon/maxon_EncBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def maxon_EncBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: maxon_EncBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | params[2].value = 4 * params[2].value 23 | return RCPblk("maxon_enc", [], pout, [0, 0], 0, params) 24 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/STM32H7/USB_OTG_InBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def USB_OTG_InBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: USB_OTG_InBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | outputs = len(pout) 19 | if len(params[0].value) > outputs: 20 | N = outputs 21 | else: 22 | N = len(params[0].value) 23 | 24 | params[0].value = params[0].value[:N] 25 | 26 | return RCPblk("USB_OTG_In", [], pout, [0, 0], 0, params) 27 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/can_generic/baumer_EncBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def baumer_EncBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: baumer_EncBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if size(pout) != 1: 20 | raise ValueError("Block should have 1 output port; received %i." % size(pout)) 21 | 22 | params[2].value = 4 * params[2].value 23 | return RCPblk("baumer_enc", [], pout, [0, 0], 0, params) 24 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/nonlin/genericBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def genericBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: genericBlk(pin, pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input ports 11 | pout: connected output ports 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | fname = params[-1].value 20 | nx = params[0].value 21 | uy = params[1].value 22 | params.pop(-1) 23 | params.pop(0) 24 | params.pop(1) 25 | 26 | return RCPblk(fname, pin, pout, nx, uy, params) 27 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/comedi/comediPWMBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def comediPWMBlk(pin: list[int], params: RcpParam) -> RCPblk: 6 | """Create Comedi_PWM block 7 | 8 | Comedi_PWM 9 | 10 | Call: ComediPWMBlk(pin, params) 11 | 12 | Parameters 13 | ---------- 14 | pin : connected input port 15 | params: block's parameters 16 | 17 | Returns 18 | ------- 19 | Block's reprezentation RCPblk 20 | """ 21 | 22 | if size(pin) != 1: 23 | raise ValueError("Block should have only 1 input port, received %i" % size(pin)) 24 | 25 | return RCPblk("comedi_pwm_generator", pin, [], [0, 0], 1, params) 26 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/linear/discretePIDBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def discretePIDBlk(pin: list[int], pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: discretePIDBlk(pin, pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | params.append(RcpParam("Last Error", 0, RcpParam.Type.DOUBLE)) 20 | params.append(RcpParam("Integral Sum", 0, RcpParam.Type.DOUBLE)) 21 | return RCPblk("discretePID", pin, pout, [0, 0], 1, params) 22 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/brikiAOBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def brikiAOBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: brikiAOBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | DAlist = [26] 19 | if params[0].value not in DAlist: 20 | raise ValueError( 21 | "You pass a channel which is not in the ABC Board PIN list: %i" 22 | % (params[0].value) 23 | ) 24 | 25 | return RCPblk("brikiAO", pin, [], [0, 0], 1, params) 26 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/linux_mz_apo/mz_apo_ENCBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def mz_apo_ENCBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: mz_apo_ENCBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output ports 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | params.append(RcpParam("Value Raw", 0, RcpParam.Type.INT, RcpParam.ShvFlag.VISIBLE)) 19 | params.append( 20 | RcpParam("Value offset", 0, RcpParam.Type.INT, RcpParam.ShvFlag.VISIBLE) 21 | ) 22 | return RCPblk("mz_apo_ENC", [], pout, [0, 0], 0, params) 23 | -------------------------------------------------------------------------------- /DriverNRT/README.md: -------------------------------------------------------------------------------- 1 | # Driver nrt.ko 2 | 3 | The driver nrt.ko allows the normal user to lauch some 4 | speciali commands for changing scheduling policy and priority and 5 | other operations usually only permitted to superusers. 6 | 7 | ``` 8 | make 9 | sudo make install 10 | sudo make dev 11 | insmod /lib/modules/`uname -r`/misc/nrt.ko 12 | ``` 13 | 14 | In programs simply put this lines or similar in your source before using 15 | the threads 16 | 17 | ``` 18 | uid = geteuid(); 19 | if (uid!=0){ 20 | fd=open("/dev/nrt",O_RDWR); 21 | if (fd<0){ 22 | printf("This SW needs superuser privilegies to run!\n"); 23 | exit(1); 24 | } 25 | close(fd); 26 | } 27 | ``` 28 | 29 | to set the new permissions. 30 | -------------------------------------------------------------------------------- /CodeGen/templates/templates.txt: -------------------------------------------------------------------------------- 1 | sim.tmf Template for simulation (no RT) 2 | rt.tmf Template for RT execution 3 | rt_co.tmf Template for RT execution (incl. CAN Synch command) 4 | rt_pi.tmf Template for RT execution with cross compilation for Raspberry PI 5 | fmurt.tmf Template for simulation with libraries for FMU blocks (Functional Mockup Interface) 6 | fmusim.tmf Template for RT execution with libraries for FMU blocks (Functional Mockup Interface) 7 | rt_digi.tmf Template for RT execution with Digilent libraries 8 | nuttx.tmf Template for NuttX boards 9 | rt_mz_apo.tmf 10 | rt_nrt_iopl.tmf Template for Linux with iopl and RT support 11 | samd21.tmf Template for BRIKI board 12 | stm32h7.tmf Template for NUCLEO-H745ZI-Q board 13 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/NuttX/nuttxENCBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | from numpy import size 3 | 4 | 5 | def nuttxENCBlk(pout: list[int], params: RcpParam) -> RCPblk: 6 | """ 7 | Call: nuttxENCBlk(pout, params) 8 | 9 | Parameters 10 | ---------- 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if (nout := size(pout)) != 1 and nout != 3: 20 | raise ValueError("NuttxENC: Number of outputs (%i) should be 1 or 3" % nout) 21 | 22 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 23 | return RCPblk("nuttxENC", [], pout, [0, 0], 0, params) 24 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/Communication/TCPsocketTxBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def TCPsocketTxRxBlk(*args): 5 | """ 6 | Call: TCPsocketTxRxBlk(*args) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | pout: connected output port(s) 12 | params: block's parameters 13 | 14 | Returns 15 | ------- 16 | Block's reprezentation RCPblk 17 | """ 18 | 19 | if len(args) == 3: 20 | pin, pout, params = args 21 | elif len(args) == 2: 22 | pout = [] 23 | pin, params = args 24 | 25 | params.append(RcpParam("File descriptor", 0, RcpParam.Type.INT)) 26 | return RCPblk("TCPsocketTxRx", pin, pout, [0, 0], 1, params) 27 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/brikiAIBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def brikiAIBlk(pout: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: brikiAIBlk(pout, params) 7 | 8 | Parameters 9 | ---------- 10 | pout: connected output port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | ADlist = [26, 27, 28, 29, 30, 31, 20] 19 | if params[0].value not in ADlist: 20 | raise ValueError( 21 | "You pass a channel which is not in the ABC Board PIN list: %i" 22 | % (params[0].value) 23 | ) 24 | 25 | return RCPblk("brikiAI", [], pout, [0, 0], 0, params) 26 | -------------------------------------------------------------------------------- /resources/blocks/rcpBlk/SAMD21/brikiESCBlk.py: -------------------------------------------------------------------------------- 1 | from supsisim.RCPblk import RCPblk, RcpParam 2 | 3 | 4 | def brikiESCBlk(pin: list[int], params: RcpParam) -> RCPblk: 5 | """ 6 | Call: brikiESCBlk(pin, params) 7 | 8 | Parameters 9 | ---------- 10 | pin: connected input port(s) 11 | params: block's parameters 12 | 13 | Returns 14 | ------- 15 | Block's reprezentation RCPblk 16 | """ 17 | 18 | PWMlist = [11, 13, 21, 22, 23, 24, 25] 19 | 20 | if params[0].value not in PWMlist: 21 | raise ValueError( 22 | "You pass a channel which is not in the ABC Board PIN list: %i" 23 | % (params[0].value) 24 | ) 25 | return RCPblk("brikiESC", pin, [], [0, 0], 1, params) 26 | --------------------------------------------------------------------------------