Jump to content

Increment of temperature setpoint


Recommended Posts

 

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

  • MVP 2023

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

  • MVP 2023

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

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

  • MVP 2023

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...