Timeline for How to implement a discrete transfer function into an arduino?
Current License: CC BY-SA 4.0
18 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 1, 2020 at 19:00 | comment | added | FrancoVS | Let us continue this discussion in chat. | |
Apr 1, 2020 at 18:45 | comment | added | Leoc | Appreciate the patience you have with me. I am starting to get it more now. If i == 0 to current value then when i == 1 how do you evaluate it when it has 2 delays like U_i_2 and Y_i_2, I know Y_i_1 = Y_i same with the input but how do you go about that? | |
Apr 1, 2020 at 18:41 | comment | added | FrancoVS |
in my example, the first sample is U_0 , and the first output is Y_0 , but you could change that, of course. Also, right now I think jDAQ's answer might be cleared than mine
|
|
Apr 1, 2020 at 18:01 | comment | added | Leoc | So essentially start from the beginning again. You dont calculate U_i at time zero right (i = 0)? You would want to start it at i =i ? | |
Apr 1, 2020 at 17:47 | comment | added | FrancoVS |
I'd just throw Y_i_2 away: it became Y_i_3 , which we will never need
|
|
Apr 1, 2020 at 17:21 | comment | added | Leoc | I see. The problem I am having is the rinse and repeat part. Do you go back to your initial conditions or is your Y_i_2 your new Y_i now? | |
Apr 1, 2020 at 17:18 | comment | added | FrancoVS |
To me, Y_i and U_i shoudn't be arrays, and there should be no for and no if/else inside loop() : you just need to implement steps 2~7 in order. That being said, " to solve the output we need to do solve the past 2 input and output values essentially and rinse and repeat" is exactly the spirit.
|
|
Mar 31, 2020 at 23:06 | comment | added | Leoc | Is the code I have there correct ish? So essentially to solve the output we need to do solve the past 2 input and output values essentially and rinse and repeat? | |
Mar 31, 2020 at 22:49 | vote | accept | Leoc | ||
Mar 31, 2020 at 22:21 | comment | added | Leoc | Edit main post with arduino code | |
Mar 31, 2020 at 22:07 | history | edited | FrancoVS | CC BY-SA 4.0 |
rewrote items again
|
Mar 31, 2020 at 21:54 | history | edited | FrancoVS | CC BY-SA 4.0 |
preposition
|
Mar 31, 2020 at 21:48 | comment | added | FrancoVS | every iteration is the same: you acquire Ui, calculate a new Yi, and advance time. | |
Mar 31, 2020 at 21:48 | comment | added | Leoc | When solving for the two iterations do I need to put this in a loop or can I first solve them then once I do put the equation in a loop? | |
Mar 31, 2020 at 21:45 | comment | added | Leoc | Sorry, the other question was stating what do you have you solve the second iteration. To me it looks like you need to solve the two iterations and thats it, what happens after that? | |
Mar 31, 2020 at 21:04 | comment | added | FrancoVS | "Did the Yi before becomes Yi-1 now?" Yes. I did not understand your other question | |
Mar 31, 2020 at 19:41 | comment | added | Leoc | Let me know if I am wrong here but: Initialize all the variables to 0 Set Ui = ADC First Iteration: Yi = a Constant. Second Iteration: Did the Yi before becomes Yi-1 now? After I I iterate to Yi-2 what now? Is it done? can I not sample "Continuously" now? | |
Mar 31, 2020 at 19:02 | history | answered | FrancoVS | CC BY-SA 4.0 |