simulink

Initialization of a Dymola FMU in Simulink

无人久伴 提交于 2019-12-04 06:18:19
问题 I have encountered an issue while trying to simulate a model using an fmu file in Simulink: I am using the Modelon FMI toolbox for a Dymola/Simulink interface to import a Model-Exchange type fmu file (version 1.0) into the Simulink model. I have a Matlab m-file that programmatically simulates the model sequentially, saving the final internal states of the model for initialization in the next simulation. The first iteration of the simulation runs without errors, but on the second iteration,

bldc 不用GPIO外部中断来换向

亡梦爱人 提交于 2019-12-03 14:51:00
bldc 无刷电机控制 可以不用 外部中断(GPIO 上升沿、下降沿)触发来换向,实现方法是可以把下列 simulink 算法 内容,放到 pwm 中断当中,poling查询模式。 为什么有这样的需求呢? 因为在 电机测速算法当中,需要一个0.1ms级别的 时间基准。 比如stm32 的TIM8_UP_TIM13_IRQHandler pwm 的update 中断就是 10khz左右 触发一次。用到simulink Detect Change 模块。 来源: https://www.cnblogs.com/qingqingzijin666/p/11801013.html

Kalman filter in computer vision: the choice of Q and R noise covariances

与世无争的帅哥 提交于 2019-12-03 07:51:20
I read some works about Kalman filter for CV object tracking but I can't find some reference about the choice of: 1)the process noise covariance Q; 2)Measurement noise covariance R. So far I have realized that the model is equation of motion (someone uses acceleration as state variable, others use position and speed only) but nobody is clear about Q and R choice including this example by mathworks: http://www.mathworks.it/it/help/vision/examples/using-kalman-filter-for-object-tracking.html Recently I found this page: http://blog.cordiner.net/2011/05/03/object-tracking-using-a-kalman-filter

Unit testing/continuous integration with Simulink/Stateflow

邮差的信 提交于 2019-12-03 04:58:00
问题 How can I perform unit testing in Simulink, or preferably, Stateflow? I'm a fan of agile software methods, including test driven development. I'm responsible for the development of safety critical control software and we're using Matlab/Simulink/Stateflow for the development of it. This toolset is selected because of the link with plant (hardware) models. (model-in-the-loop, hardware-in-the-loop) I have found some links on Stackoverflow: Unit-testing framework for MATLAB: xunit, slunit and

3rd-order rate limiter in Simulink? How to generate smooth triggered signals?

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: First for those, who are not familiar with Simulink, there is a imaginable outside-Simulink partial solution: I need to create a vector satisfying the following conditions: known initial value a1 known final value a2 it has a pre-defined step size, but the length is not pre-determined the first derivative over the whole range is limited to v_max resp. -v_max the second derivative over the whole range is limited to a_max resp. -a_max the third derivative over the whole range is limited to j_max resp. -j_max at the first and the final point

Get Errors when running Simulink block, but get Success when running respective M-file alone

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to transmit an encoded image using USRP. The first step is to load the image using Matlab and encode it. The respective codes are shown as follows. function msg = genMsg1 %#codegen persistent msgStrSet count; if isempty(msgStrSet) count = 0; msgStrSet = imread('cameraman.tif'); % Load the image of cameraman.tif end msgtemp = dec2bin(msgStrSet); % Covert msgStrSet into binary value msg_1ine = msgtemp(count+1,:).'; % Take msgtemp line by line and tranpose it msg = str2num(msg_1ine); % Convert each line from string into column

Simulink学习笔记(三)――Simulink自动代码生成(二)

匿名 (未验证) 提交于 2019-12-03 00:32:02
前言: 一、建立系统框图 的简单算法,我们在simulink中建立系统框图如下所示: 然后设置Code Generation标签页,如下所示: 然后在Report子标签页,配置允许生成报告,如下所示: 再按ok,如下: 二、代码生成 不巧,产生错误了,这个只需要更改一下文件保存路径就好了,我们将红框中的路径更改为要保存文件的地址,我就放在桌面,如下所示: 重新进入simulink,ctrl+B编译模型,可以看到算法的基本代码已经生成了,如下所示: 三、代码优化 我们再按下ctrl+B快捷键,生成的代码如下: 弹出如下菜单,设置我们需要的子模块名称及文件名称: 再按下ctrl+B快捷键,子模块及其功能代码就生成了,如下: 文章来源: Simulink学习笔记(三)――Simulink自动代码生成(二)

Prescan-行人识别实现

匿名 (未验证) 提交于 2019-12-03 00:29:01
1、场景创建 要求场景至少具有一辆车,一条道路,一个行人,然后指定行驶路线,如下图所示,大概也就一两分钟的工作量。 2、添加Sensors 将Camera+Bounding Rectangle添加到车辆上,此处保持参数默认就行 3、解析编译 通过解析编译生产simulink仿真文件: 4、Simulink中添加BRS_Camera_Color_Display Block 5、Run 文章来源: Prescan-行人识别实现

BP神经网络+PID控制simulink仿真

匿名 (未验证) 提交于 2019-12-03 00:22:01
点击打开链接 点击打开链接 点击打开链接 )早已经做过类似的工作了,并且总结出许多经验和错误,但鉴于在论坛中许多错误没有一个完整的回答,信息都是零零散散,于是我打算把我做的一整套流程记录下来,以免日后忘记,同时也希望可以帮助到一些人。 链接1 里面是我最早看到的资料,前辈1在MATLAB中文论坛中发布自己搭建的工程文件及其所遇到的问题,后面楼主说是解决了问题,但是没有上传(这个可以谅解),另外里面有许多热心网友的回答是非常有用的(这些回答对我自己后面解决相关问题,成功实现Simulink仿真是非常关键的,在这里非常感谢论坛中的各位前辈 )。 链接2 这个确实是可以用的,只不过对MATLAB版本有限制。开始我下载之后用我的MATLAB2016b打开工程,点击run后就报错, The block 'BPPID/Subsystem/Unit Delay1' does not permit continuous sample time (0 or [0,0]) for the parameter 'SampleTime'. 里面分了两大派,一部分人说亲测有效,大赞跟帖;一部分人也像我一样运行报错,此时我疑惑了。于是猜测可能是MATLAB版本问题,于是在另一台电脑上的MATLAB2014b版本运行,果然得到楼主那一条漂亮的曲线(虽然我的工作就是点击一下run,但是还是很开心 )