档案交换一周

我们最好的用户提交

Data Acquisition Tool

肖恩本周的选择是Data Acquisition Tool经过艾萨克·诺(Isaac Noh)

Data Acquisition Hardware

您是否曾经想将数据直接从硬件带入MATLAB或通过数据采集板控制某些东西?

在2008年冬季,使用数据采集硬件是我在MATLAB的第一个项目。我有一个微型负载框架,透明了X射线,用于将负载施加到混凝土缸上。共有三个传感器输入:两个位移,力量和一个输出:施加力的压电执行器的电压。这是我论文的一个数字:

I built a user interface in GUIDE to allow me to apply the load while recording and plotting the signals. To complicate matters, the session based interface for theData Acquisition Toolbox还不存在,所以我也自己与计时器一起做所有事情。

I can only imagine how much easier it would've been with this app. I no longer have access to the load frame, so instead here's an example getting data from anAdalm1000,低成本的数据采集设备。

让我们用应用程序控制它。首先,我将得到连接并从附件的RC电路中获取一些数据。请注意我以前必须install the hardware support packagefor this board.

似乎奏效了,太好了!

Now I want to output some data to it. There are two channels, the first will be a sine wave and the second a cosine wave. The board can take 0-5V so add 1 to the waves keep them positive.

t = linspace(0,8*pi,100000)'; x = [sin(t) cos(t)]+1;

In order to get them into the output, we simply pick the variable:

然后运行会话:

从这里,可以从文件菜单中生成数据,也可以生成等效代码以自动化此采集会话。

我唯一的反馈意见是,错误消息并非全部通过对话框暴露。例如,我第一次选择Xwith the range -1:1, it errored at the command line with a useful message that I didn't see because the app was maximized.

回到大学期间,我试图控制负载,并以排量来控制负载,以使加载速率大致是线性的。为此,我进行了一堆实验,并适合许多圆柱体的负载v。位移曲线。当时,我一无所知万博1manbetxor how it could help me. If challenged with the same task today, I would likely use the数据采集​​块in Simulink R2016b to control the actuator. This would allow me to then use the PID block and its tuning capabilities to accomplish what I was doing much more quickly.

For nostalgia's sake, I put together a quick a model of the system.

Comments

您是否使用数据采集硬件?尝试一下,让我们知道您的想法here或留下一个评论对于以撒。




与Matlab®R2016B一起出版

|

Comments

要发表评论,请单击here登录您的数学帐户或创建一个新帐户。