Carlos Quaglio Posted September 8, 2020 Report Share Posted September 8, 2020 Good afternoon! We are running an application to control an oven with recipe, ramp and landing, using a V430-J-RA22. The customer has a table where he puts the values of initial temperature, final temperature and time to leave the initial temperature and reach the final temperature. To reach the value of how much the temperature setpoint should be increased, we use the following equation: Final Temp - Start Temp / Time Ex: 250-120/90 = 1.44 ° C per minute -> that is, the setpoint must be increased by this value every minute In this way, we take this value and store it in a memory to insert in the PID control. However, this only accepts whole numbers (MI), but for decimal places after the comma we would have to use one (MF). Is there anything we can do or is this a limitation of the software? Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted September 8, 2020 MVP 2023 Report Share Posted September 8, 2020 There is rarely a need to use MF in this type of situation. Multiply both sides of your equation by 100 (or 1000 to obtain an additional decimal point of precision). Perform your calculation, then apply additional math to obtain a final temperature change to one decimal point, (times 10, which is what the I/O for the temperature probe will be working in). Link to comment Share on other sites More sharing options...
Carlos Quaglio Posted September 8, 2020 Author Report Share Posted September 8, 2020 Thanks for the quick response... Could you please show this calculation with a practical example with real numbers? Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted September 8, 2020 MVP 2023 Report Share Posted September 8, 2020 You need someone to show you how to multiply by 100? Keep in mind that this forum is staffed by volunteers, not Unitronics employees for the most part. We have day jobs and help out here when available - we cannot write your program for you. I recommend that you make your best attempt and then post your results here with specific questions if you can't get it to work. Someone here will then help guide you. Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted September 8, 2020 MVP 2023 Report Share Posted September 8, 2020 I post some tips about MF to ML conversion (with MI max value mast be below +32768). You can use it in your application for calculate Flex727 idea with x100 myltiply. And set PID setpoint with MI. Link to comment Share on other sites More sharing options...
Carlos Quaglio Posted September 8, 2020 Author Report Share Posted September 8, 2020 1 hour ago, Flex727 said: You need someone to show you how to multiply by 100? Keep in mind that this forum is staffed by volunteers, not Unitronics employees for the most part. We have day jobs and help out here when available - we cannot write your program for you. I recommend that you make your best attempt and then post your results here with specific questions if you can't get it to work. Someone here will then help guide you. Sorry @ Flex 727, if my question made you so furious ... It is according to your explanation I did not understand what value should I multiply by 100 ... only that ... Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted September 8, 2020 MVP 2023 Report Share Posted September 8, 2020 Flex and I are both known to snap at people for asking for "example code". There's a fine line between "point me in the right direction" and "do it for me so I can implement it and call it my own to my boss". It's an old programmer's attitude that's acquired, like the taste for Scotch. Anyway, what you need to become familiar with is the concept of implied decimal places. You can do amazing things with integers but you need to track your powers of 10 and know in your calculations that a number is 10 or 100 times bigger to "imply" 0.0 or 0.00 precision. When you're doing your calculations with integers, keep in mind that the maximum value for an MI is 2^15 or 32767. For this reason I do most of my cranking in ML's and then extract the final answer to an MI. Also, remember that when you multiply or divide your power of 10 adds or subtracts. The best way to learn this for yourself is to experiment with the numbers on your calculator with whole numbers only. Then just write PLC code to match. We're much more friendly and tend to help when someone bangs on something and then posts their code. Joe T. Link to comment Share on other sites More sharing options...
Carlos Quaglio Posted September 8, 2020 Author Report Share Posted September 8, 2020 15 minutes ago, Joe Tauser said: Flex and I are both known to snap at people for asking for "example code". There's a fine line between "point me in the right direction" and "do it for me so I can implement it and call it my own to my boss". It's an old programmer's attitude that's acquired, like the taste for Scotch. Anyway, what you need to become familiar with is the concept of implied decimal places. You can do amazing things with integers but you need to track your powers of 10 and know in your calculations that a number is 10 or 100 times bigger to "imply" 0.0 or 0.00 precision. When you're doing your calculations with integers, keep in mind that the maximum value for an MI is 2^15 or 32767. For this reason I do most of my cranking in ML's and then extract the final answer to an MI. Also, remember that when you multiply or divide your power of 10 adds or subtracts. The best way to learn this for yourself is to experiment with the numbers on your calculator with whole numbers only. Then just write PLC code to match. We're much more friendly and tend to help when someone bangs on something and then posts their code. Joe T. Joe thanks for the explanation. My intention was not to ask someone to do the routine for me. I believe that with your explanation I will be able to simulate something that meets my need. Thank you. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted September 8, 2020 MVP 2023 Report Share Posted September 8, 2020 2 hours ago, Joe Tauser said: Flex and I are both known to snap at people for asking for "example code". I was a bit snippy, wasn't I? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now