Stream Sample and Hold Problem.

For general discussion related FlowStone
Post Reply
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Stream Sample and Hold Problem.

Post by Perfect Human Interface »

I'm having trouble getting anything out of this stream Sample and Hold module. If anyone could tell me what I'm doing wrong that would be appreciated!
Attachments
Sample and Hold Problem.fsm
(9.68 KiB) Downloaded 776 times
User avatar
nix
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Stream Sample and Hold Problem.

Post by nix »

Heya!
Glad I can help.
The 0 crossing s&h need to rise from minus to plus to sample->
Sample and Hold Problem_mod.fsm
(10.01 KiB) Downloaded 787 times


Enjoy the linkage
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: Stream Sample and Hold Problem.

Post by Perfect Human Interface »

Thanks so much Nix!

Looks like whomever wrote this left out an equals sign.

Oops.PNG
Oops.PNG (7.54 KiB) Viewed 10770 times


Now it works in the 0 -> 1 case.
Youlean
Posts: 176
Joined: Mon Jun 09, 2014 2:49 pm

Re: Stream Sample and Hold Problem.

Post by Youlean »

If you need, here is immediate sample and hold...
Attachments
Hold.fsm
(304.19 KiB) Downloaded 763 times
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: Stream Sample and Hold Problem.

Post by Perfect Human Interface »

That's an interesting method Youtlean. You could add a line to make it hold when > 0 rather than just either 0 or 1.

Hold2.PNG
Hold2.PNG (3.76 KiB) Viewed 10765 times


Perhaps this is slightly faster than the above?
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: Stream Sample and Hold Problem.

Post by Perfect Human Interface »

Here, I took Youlean's code and tweaked it so it accepts stream bool or zero cross. Stream bool is probably the best method overall since you can use them with the stream compare prims.

Edit: Ok so just so it's clear to everyone (now that I realize it myself) this kind of "sample&hold" only holds so long as the bool is true and passes the signal otherwise, while the above module I was originally working with samples when the control value goes from <0 to >0 and holds until the next time it samples. Useful for different things.
Attachments
Hold_PHI edit.fsm
(585.56 KiB) Downloaded 780 times
Post Reply