1 view (last 30 days)
Danikha Shyken on 25 Sep 2023
Commented: Danikha Shyken on 27 Sep 2023
I'm particularly confused about the part which says '... and the phase delay parameters of this block need to be integer multiples of the fixed step size.
Danikha Shyken on 25 Sep 2023

Fangjun Jiang on 25 Sep 2023
Edited: Fangjun Jiang on 25 Sep 2023
If the pulse width is 87.85%, then the gap of the pulses will be 12.15%. Then you have to be able to distinguish at least 0.05% of the period to be able to make the 87.85% pulse and the 12.15% gap.
0.05% of the period (5e-7) is 2.5e-10, the number in the error message.
In other words, the simulation program has to be able to increase the simulation time every 2.5e-10 to be able to make the pulse. Your simulation step size (0.2) is way more bigger than that. Changing the simulation step size to be 2.5e-10 will fix the problem.
Feeding the Pulse Generator to the control port of the Multiport Switch block doesn't make sense. The value of the control port should be 1, or 2, or 3, to pass the 1st, or the 2nd, or the 3rd input, just like the icon of the block indicates.
Constant value [0.3:0.4] or [0.4:1.2] or [1.2:2] don't make sense either.
[0.3:0.4]
ans = 0.3000
[0.4:1.2]
ans = 0.4000
[1.2:2]
ans = 1.2000
Fangjun Jiang on 27 Sep 2023
Your logic is all mixed up. This is my final comment on this topic.
1. Use a MATLAB Function block with "if-elseif" statement to process 4 manual switch inputs to create an interim output. The value of the interim output could be 1, 2, 3 or 4.
2. Use this interim output to control that Multi-port Switch to pass through 4 possible voltage source. You got a single voltage output signal. The range of this signal is from 0.3 to 2.
3. Use another MATLAB Function block to read the value of this single voltage signal to generate the output signal "mode". You seem to have this function already.
4. There is other simpler way to do this. But at least, this approach should be able to generate the desirable output signal "mode".
Danikha Shyken on 27 Sep 2023
I understand. Thank you so much for your time and insights; your assistance has been valuable.