1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

anyone know about PID control theory?

Discussion in 'REAKTOR' started by ANDREW221231, Jan 7, 2021.

  1. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    this confirms for me that i was going about it the right way, but for the wrong problem. I was trying to apply PID control to an index sorting problem, one where the input changes chaotically and instantaneous changes give no indication of where the input might be even at the next timestep

    this explanation is extremely helpful, as someone who lacks formal education, penetrating the technical literature can be confusing. but what you described matches what i observed very well. especially the part about the integrator becoming useless and oscillating if set to fast, something i was confused about

    probably just a function of being more interested in PID control and on the lookout for the first thing to apply it to, so having it not work as desired is just as valuable from that perspective. its funny, by trying to apply it to things not really suited for it,, i learned enough to realize that I already basically built one unwittingly -while reading about phase locked loops I saw they commonly use PID control in their architecture. and im pretty familiar with how they work from a PLL implementation published here in the user library long ago, which i'd i studied and modified at great length

    i had been under the mild delusion that the modifications i had made years ago to the PLL could even be something novel, but after making this connection and inspecting the structure, sure enough: all the basic elements of PID control were there, from trying to improve performance of the detection filter. though a bit clumsy, the derivative bit worked very well in this case

    you don't by chance have knowledge of kalman filters that falls within your range of ability to with such clarity and common sense, do you? that's mostly a joke, i expect that i will never understand the kalman filter
     
  2. Jean louis P

    Jean louis P New Member

    Messages:
    13
    glad that it was helpful for you.
    sorry for the kalman filter. :)
    i have worked with PID some years ago, then i have some memory about this.
    i had the feeling that the PID was not adapted to your work, because PID is made for managing float values, and not a number of objects.
     
  3. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    that was a factor that made me averse to try it, i was thinking i could let it accumulate with floats and quantize the integer component to address the index, but the back of my head i didn't know if that would cause problems.. it was also pointed out that the system it would be trying to correct is inherently nonlinear, in more than one aspect too i think

    once i learned a bit i decided pretty quick that it was not a good fit. but in that i ended up not even trying it. i'll think i'll try it just to see what happens. gobbledygook i suspect. either way, its good to have found a couple PID veterans here, hopefully at some point i'll have an example of a more valid and more pointed questions to get towards the subtleties of this art, i'm sure there are quite a few
     
  4. Kubrak

    Kubrak NI Product Owner

    Messages:
    1,056
    The same with me. Kalman filters are not, probably, anything difficult. But one would need some help to be able to use it..... And proper tools/SW.
     
  5. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    i come back to them every once in a while, to see if they make any more sense, but every time the matrix multiplication comes up my eyes glaze back over. have had success with other things by coming back at a later point to see if my general knowledge by then had increased enough to gain a foothold

    not sure if it matters though, have had a good breakthrough with this project im working on, anyway. just finding new ways to make measurements, there's always more information from them than you realize initially. working that out gives a new way to make a measurement, then putting those measurements against each other is another measurement

    automatic proportional gain control is such a stupidly easy thing i'd overlooked. it gave the needed stability for absolutely zero headache and adding it in is technically another measurement itself which might be leveraged

    thats kind of in the spirits of kalman filtering, without worryng about the prediction and error correction, which always felt too much like homework
     
  6. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    not just homework,, also hearing the way its explained comes across a bit philosophical. guess its probably justified, but nothing ever beats having an actual implementation to play with in reaktor to start building your own sense of physical meanings of a process.

    well, most of the time. some university dork in another forum posted his 'one pole random walk kalman filter' and i was over the moon, set right away to mapping the code to a reaktor file, which i did shortly notice was annoyingly similar to a regular one pole lowpass. but his apparent credentials, and the couple pretty minor differences, were enough to convince me to start using it extensively in projects in places i'd already be using a filter to smooth noise or something, confirmation bias told me there was an added oomph when using it, even in a couple side by sides

    about a month ago i remembered and dug it up, but he didn't get me again. very obviously just a garden variety integrator. actually, exactly the same as the ones now for the ZDF framework. not very pleased now with that guy for posting such basic a thing with not much explanation except an implication it might be a kind of magical bean. it lead to some weird notions about how the business end of a feedback loop might be considered to be doing error correction
     
  7. Kubrak

    Kubrak NI Product Owner

    Messages:
    1,056
    I think, that main problém in using Kalmann filters is to find values of matrices. The math with matrices is easy (for me). It was our daily bread for several years at University.....

    Maybe you could use PID in such a way.
    1) Remember current value of gain.
    2) Find out which gain gives you desired amount of active output bins/frequencies
    3) Difference between 1 and 2 is 'controll error' that you feed to PID (or any other regulator).
    4) Set gain according controll value from PID and get resulting bins/frequencies.
    5} Make new calculation and go to step 1)

    It might work, but no garantie.....

    Finding the gain value in step 2 might take quite resources. Halving the intervals method might do the job. There might be faster ways, but more tricky....
     
  8. Laureano Lopez

    Laureano Lopez NI Product Owner

    Messages:
    416
    Just came to second that feeling :D
    Also, I want to trip this high when I grow up
     
    • Funny Funny x 1
  9. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    i found a quick and dirty hack, which was to accumulate amplitudes for bins and send that to the level for the gate, so the probability of getting past i goes down as frequency goes up. i tried things like this but it never worked because it always used a fixed shape for the response curve, just feeding the signal into itself make the curve seems to be the secret ingredient. i was thinking, now that everything is more stable, that a PID correction like you said would be more feasible as it is now already in the ballpark, i'l have to determine if trying to converge to a fixed number is better than letting this new thing do its work. it seems to be selecting what i would call good candidates for root notes, which feels extremely promising. also, this newer way of gating can completely remove transients and even completely remove all traces of drums from full songs, as long as they are not mixed too prominently

    its funny, about performance: i seem to be able to add endless new elements running on the master index without any real performance hit, but anything that is at all like a subroutine or would need iteration is just about enough enough of a wrench in the cogs to be a death blow. now that i've separated likely root notes from possible overtones i think i can see a possible endgame
     
  10. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    plenty of time for that in the nursing home i suppose. i find myself feeling jealous of your learned hyper-competence. i guess one thing i can say, for the 'swinging an ax around wildly in the dark' approach, is one can occasionally hit meat
     
    • Like Like x 1
  11. Laureano Lopez

    Laureano Lopez NI Product Owner

    Messages:
    416
    I'm not that learned though, or that competent. People like Colin or David know much more than I do. I'm laborious and obsessive, often I know too much about one thing and nothing at all of the next one. That's how I dropped college (twice) -it was too fast, too result-oriented for me to engage with anything. It's very hard for me to do things that I don't (really) understand, so I tend to envy people who can "just play" with stuff. That's why I much prefer to work on other people's stuff than on my own. With my stuff, I easily fall into spirals that go nowhere. With other people's, it's like everything is meaningful, because it's not... transparent. Or something like that :D
     
    Last edited: Mar 6, 2021
    • Like Like x 1
  12. colB

    colB NI Product Owner

    Messages:
    3,969
    I seriously doubt that. I think the thing is that everyone's knowledge is a very spiky graph - like the standard deviation is huge or something... I guess the trick is to find interests or work where more of our knowledge and abilities are applicable...
    Totally get that. Although in working with Reaktor, I've learned that If I don't have the knowledge to fully understand something with mathematical precision, I can sometimes still solve it using more practical engineering approach of testing and measuring iterations to hone in on a useful result...
    Lol, with other peoples stuff, the goal is usually clear. With my own stuff, I have so many goals, and its very difficult to have the discipline to pick one and stick to it until the project is done. So I collect projects. I have many 'in progress' projects at the moment :)
    EDIT: I guess also that other people have different knowledge, so their stuff will have problems that you know the answers to.
     
    Last edited: Mar 6, 2021
    • Like Like x 3
  13. Laureano Lopez

    Laureano Lopez NI Product Owner

    Messages:
    416
    The thing with having to really understand happens to me a lot in music. I never had many toys, so now that I'm a bit more enabled financially, I don't know what to do with them. I'm used to play with the simple, little things that I know well. Like, I'd rather use two mono or ping-pong delays in a row with some filtering and panning than a fancy multitap that swirls by itself out of the box. In college there were people who had this, for me, strange ability for copying surfaces without knowing a bit of their internals. Some guy once presented a piece that sounded just like late Xenakis, and made the bold claim that it had nothing to do with maths. Same with the whole PD troupe. It was baffling for me, but I kind of get it now. When I work with someone similar to me, it's a neverending pit of speculation -we have to take some distance to get anything done. There's this girl, who I produced an album for, that's the complete opposite. She doesn't get words -not for lack of smarts, they just don't mean anything to her. She needs impressions and a sense of purpose. I have to make brief pictures for her, in gestures and allegories. But I always know what to do with her music -it just comes with a weird clarity. The making is very much in my own maniacal, symmetry demanding terms, but there's a drive that takes me from start to finish. I very rarely find that drive by myself :oops:
    That. On the other hand, my stuff has problems that I barely understand! :D
     
  14. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    its a good thing to be aware of ones tendencies/limitations as long as they're understood as the vehicle with which to navigates the world and not a millstone around one's neck. i think finding people with opposing predilections is one of the best ways to circumvent that. i know for me, my ability to 'play' means getting so sucked up into trying to play engineer in my way that making music becomes an afterthought, even in projects in service of a problem encountered in the course of making music. some of my more obsessive projects are completely divorced from any thought of practical application at all, the 'bodge' not a means to an end but an end in itself. i'd love to have the temperament for the life choices that go along with being able to casually say 'an album i produced'. i think there's some truth to 'the grass is always greener'

    i gotta agree as far as i understand it might apply to synthesizer technique. i have a little volca keys, and twisting knobs deliberately and compositionally or aiming for some little trick >> trying to coax some sound that lies outside one's wildest imagination

    the only utility i've found for truly chaotic sounds is as fodder for the 'cut up method', spending hours finding the best little bits and using those to build something that sounds compositional
     
    • Like Like x 1
  15. colB

    colB NI Product Owner

    Messages:
    3,969
    That's my point. Problems caused by gaps in knowledge can be fixed easily by people with different knowledge (assuming it fills those gaps). You can't easily fix problems caused by gaps in your own knowledge - you need to increase you knowledge first...
     
    • Like Like x 1
  16. Kubrak

    Kubrak NI Product Owner

    Messages:
    1,056
    And first of all, one has to comprehend there is a problem to be solved..... Most people are just happy with what they have/created... Just few seek for perfection and try to get as close as possible.
    My experience is that its is handy to be at least average (or even subaverage) in as many areas as possible. And be good/superior in some. Basic knowledge gives you general understanding of things (how it aproximately works, what are limits/problems/advantages) and helps foresee problems or at least find out there are problems. Then one may ask for help someone who knows or learn that stuff to the level that is enought to solve the problem....
     
    • Like Like x 1
  17. Laureano Lopez

    Laureano Lopez NI Product Owner

    Messages:
    416
    I go through that all the time. I used to worry about it, but I've found that I enjoy it, and it's less stressing that trying to come up with music when there's none. When I was in college (like, 12 years ago) I wrote score after score after score. Now I may do like... two, three tracks a year, just for myself. Between gigs, there's more programming and math than music. I had different expectations back then, and a different, more... desperate view of life, that channeled to music much more. When I really want to do some music but I don't have a single idea, I browse through stuff until I find a track that I can hear in a completely different setting. Then I arrange it. Again, other people's stuff...
    It doesn't happen that often, I'd love to be able to call it a real business (?). But yup, the grass is alright. Not the greenest, has some spots... I've seen it worse.
    In my current view, perfection is a delusion. I can take it as real and impose it on things and on myself, dragging us altogether. Or I can take it as fiction, derive a game from it and play. If it's not fun, I have to change it. I've had some great time seeking "perfection", and some awful time. It can't take me away from my walks, my cat, a dinner every night. That's how I need to see it now :)
     
    • Like Like x 1
  18. Kubrak

    Kubrak NI Product Owner

    Messages:
    1,056
    Well, I did not mean it literary and in all areas. That would be deadfull. I meant it more, concerning the work or creation. And more "perfection" than absolute perfection. Your sine Reaktor library comes to my mind as good example. ;-)
     
    • Like Like x 1
  19. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    thats definitely the more in line with my wheelhouse. i think gaps in knowledge can even be good. there was a lot of stuff i would daydream about and try to interpolate the missing pieces, and then later when i did end up learning the thing, it was tempered by the effort of having tried to figure it out like a detective before, and all the creative ideas that popped up when reading something just above my ability to comprehend
     
    • Like Like x 1
  20. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875

    you're right, this expression is nothing more than same angsty urgency that plagues every man in their 20s, and i am far from 20. we should be so lucky to enjoy dual orthogonal interests that are overlapping disciplines, and are also engaging enough for one to steal time from another. probably the only right time to make music is whenever it feels right to

    i think part of the problem is a lack of being spurred on by an awareness of some music out in the world that holds my fascination. i'll never forget the eras that discovering velvet underground and LCD soundsystem kicked off for me. the last person to really impress me to the point it felt revelatory was Kate Bush. there's plenty of good music in the world but only so much that can hold that kind singular fascination for me. its hard to find. anyway,

    whatever, im feeling optimistic about reaktor anyhow. spent a good chunk of yesterday convinced i was deluding myself with this midi project, only for an outcome of actually getting it to work and produce output for the first time, and working much better off the bat than i would have expected. here its playing with radiohead on opposite channels
     

    Attached Files:

    • Like Like x 1