使用离散模型积分模块输出不符合预期
6 views (last 30 days)
Show older comments
在模型中我采用了stateflow,case1中为初始化两个outport(outport输出为数字信号),在1s之后进入case2,并根据ADC采样所得的电压去控制两个outport的输出

在case2中,我根据将采样所得的电压分为三个分段,分别是0-2V,在0-2V的时候两个outport置为1,在2-3V时,使用了积分模块,对采样所得的电压值进行积分,当超过一定值后将两个outport置为0,超过3V时,将两个outport置为0。


当把模型烧录进芯片后,调节电压值可以看到数字输出在2-3V时是符合模型设计的,但是将电压从2-3V调节至3V以上时,数字输出为1(理根据模型设计应为0),而当把积分模块删除之后,只保留0-2V和3V以上两种情况的模型时,数字输出正常(即0-2V,数字信号输出为1,3V以上输出为0,并且连续调节电压无问题),请问是否我模型中积分模块使用错误?
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!