I'm having some difficulties understanding. I've done a lot of research on the subject. I downloaded an example from the wiki and made some modifications.
Doubt 1: I'm trying to create a flowchart so that I can define the values of P, I and D through variables in which I can reset their values at any time (I used floating point variables. Any problem with that? Doubt 2: the way what I did in the flowchart is correct?).
Doubt 3: The flowchart uses the reading of an analog input as a setpoint, but I would like the setpoint to be defined by the value of the ADC variable, but I haven't found a way to do that. It's possible ?
I'm a little confused...
Help with PID code (does it work?)
-
- Posts: 10
- http://meble-kuchenne.info.pl
- Joined: Tue Apr 06, 2021 6:06 pm
- Has thanked: 2 times
- Been thanked: 1 time
Help with PID code (does it work?)
- Attachments
-
- DSP2.PNG (82.22 KiB) Viewed 3547 times
-
- DSP.PNG (79.68 KiB) Viewed 3547 times
-
- PID_Control.fcfx
- (16.43 KiB) Downloaded 170 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: Help with PID code (does it work?)
Hello,
Yes that looks fine. Please can you check you're using the latest components by clicking on Help -> Library Updates. This might break your DSP connections so I've reconnected things with the latest components for you here. All seems to be working in simulation so hopefully should also work ok on hardware.
Yes that looks fine. Please can you check you're using the latest components by clicking on Help -> Library Updates. This might break your DSP connections so I've reconnected things with the latest components for you here. All seems to be working in simulation so hopefully should also work ok on hardware.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 10
- Joined: Tue Apr 06, 2021 6:06 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: Help with PID code (does it work?)
Hello Ben ! Thank you very much for your help. I'll test if it works in real life. I'm really glad you cared. Thanks
-
- Posts: 10
- Joined: Tue Apr 06, 2021 6:06 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: Help with PID code (does it work?)
Hello again, Ben. I updated the library as you said. But now I can't make the component connections. I'm sending a screenshot of what it looks like for me. The checkbox for connections appears blank. Do you know what could be happening?
- Attachments
-
- Print.PNG (80.94 KiB) Viewed 3526 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: Help with PID code (does it work?)
Hello,
When you do the library updates, please change the drop down at the bottom from files in use to fuill database.
Hopefully this should solve the issue for you.
When you do the library updates, please change the drop down at the bottom from files in use to fuill database.
Hopefully this should solve the issue for you.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 10
- Joined: Tue Apr 06, 2021 6:06 pm
- Has thanked: 2 times
- Been thanked: 1 time
Re: Help with PID code (does it work?)
Hello Ben. This solved the problem. Thank you for this. But I still have a doubt: I would not like to use an analog input as a setpoint, but I would like to use the value saved in a byte variable to be my setpoint. Is this possible ?
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: Help with PID code (does it work?)
Yes that's possible just use a second Digital input to drive the setpoint and the value for this can be assigned from your control variable.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 10
- Joined: Tue Apr 06, 2021 6:06 pm
- Has thanked: 2 times
- Been thanked: 1 time