I am utilizing the TC3 Ramp function block FB_CTRL_RAMP_GENERATOR to control the temperature. The parameters are set as follows: CTRL_RAMP_GENERATOR_PARAMS.tTaskCycleTime and CTRL_RAMP_GENERATOR_PARAMS.tCrtlCycleTime are both set to T#10s. Additionally, the velocity for positive change (VeloPos) is calculated based on the target and initial temperature, ramp time, and a rate of 60 units per second. The velocity for negative change (VeloNeg) is set to 0 units per second. To initiate the ramp control, the function block is called with the parameters for starting temperature, target temperature, and other settings. In this specific case, the starting temperature is 25 degrees and the target temperature is 30 degrees. Upon running the program, the bValueReached flag becomes true even before reaching the target temperature. The issue may be related to the configuration of VeloPos and VeloNeg.
It is unclear how bValueReached is set to true, but upon closer inspection, it appears that the formulaCode: VeloPos = (fTargetTemp - fInitTemp) / (60.0 * fRampTime) is calculating the velocity (ramp rate) in units per minute instead of units per second as required by the function block. This could potentially result in a lower ramp rate than expected. However, this does not clarify why bValueReached is set to TRUE before fRampOut reaches fTargetTemp. The documentation indicates that the ramp is started by a rising edge of the bEnable input parameter, but in this case, bEnable is constantly True with no rising edge detected.
drbitboy raised a concern about the unexpected behavior of bValueReached becoming true while analyzing the formulaCode: VeloPos that calculates the velocity (ramp rate) in units per minute instead of units per second. This discrepancy might result in a lower ramp rate than intended, although it does not clarify why bValueReached is triggered before fRampOut reaches fTargetTemp. The documentation mentions that a rising edge of the bEnable input initiates the ramp, but the bEnable input is always set to True, indicating no rising edge. In the actual code, a Start button is implemented for users to initiate the program and set bEnable to True. The question arises whether this action qualifies as a rising edge, or if the Ramp function requires bEnable to alternate between True and False continuously.
In my current code, I have implemented a Start button for users to activate. By tapping this button, the program will begin and set the bEnable value to true. Is this considered a rising edge? Does the bEnable function in the Ramp function need to continuously switch between true and false? When using the CTRL_RAMP_GENERATOR(bEnable := True, ...), it is uncertain whether the instruction will experience a rising edge on the initial scan cycle, but subsequent scan cycles will not occur. To better understand the behavior of this ramp instruction, it is recommended to create a test program containing only this instruction and a few variable tags. Empirically determine the ramp behavior by assigning a Boolean tag like bEnable and controlling it with a pulse function (e.g. five seconds 1, five seconds 0). Adjust the velocity parameter to observe the effects of the bEnable pulse being longer or shorter than the ramp duration. It is vital to recognize that the PLC and the ramp instruction operate based on precise instructions, regardless of your intentions or expectations. It is essential to grasp that the PLC will strictly adhere to the commands given. The only thing worse than the PLC not functioning as desired is when it follows instructions exactly. Therefore, to effectively utilize the PLC, one must have a thorough understanding of how it will behave in response to specific commands.
From your description, it seems like the issue may be originating from how you're defining VeloPos and VeloNeg. While you've calculated VeloPos based on your target and initial temperatures, as well as ramp time, your VeloNeg is set to 0 units per second. This might be the cause of bValueReached flag activating prematurely. What happens, I theorize, is that your system doesn't slow down as it approaches the target temperature and overshoots into the true flag for bValueReached ahead of schedule. Consider introducing a more refined deceleration regime to prevent overshooting.
Based on your description, it seems you might be having issues with your VeloPos calculation. If your VeloPos is ostensibly intended to calibrate the rate at which your temperature increases, it might be too high. This could cause your system to register the target temperature as reached sooner than reality. The discrepancy between VeloPos and VeloNeg could be another contributing factor. Try to experiment by reducing the VeloPos or increasing VeloNeg and check if the bValueReached flag still becomes true prematurely. Adjusting these parameters might help your system have a more accurate ramp time.
It sounds like you've got your setup mostly in order, but I have a hunch your issue might stem from your VeloNeg parameter being set to 0. This essentially means that your system doesn't allow for a decrease in temperature, which might confuse the controls if your temperature happens to overshoot for any reason (a common occurrence in such systems). It might be falsely triggering the bValueReached flag. I suggest giving VeloNeg a non-zero value to allow for correction, then see if the issue persists. Remember, both heating and cooling processes need to be properly accounted for, even if your main goal is to raise the temperature.
It sounds like you're on the right track with your TC3 Ramp function block, but if the bValueReached flag is turning true before hitting the target temperature, it might be worth checking the logic that updates the current temperature value. Ensure that the ramp rate calculations for VeloPos and VeloNeg are correctly reflected in the timing and that your conditions for setting the bValueReached flag are aligned with the actual temperature changes occurring. You might also want to verify if the task cycle is being invoked correctly and consistently during the ramp process. A small delay in reading or updating the temperature could potentially lead to this issue as well.
It sounds like youβre on the right track with using the TC3 Ramp function block, but if the `bValueReached` flag is triggering prematurely, it might be worth double-checking how `VeloPos` and `VeloNeg` are defined in relation to your task cycle settings. Since you're aiming for a positive change, having `VeloNeg` set to 0 could disrupt the ramping effect if the function block misinterprets your target conditions. Try debugging the calculation of `VeloPos` to ensure it aligns with both the ramp time and your interaction with the cycle times; maybe consider adding a small delay or logic to confirm that the temperature hasn't just temporarily hovered around the target before setting the flag to true.
β Work Order Management
β Asset Tracking
β Preventive Maintenance
β Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: Answer: The issue may be related to the configuration of the positive change velocity (VeloPos) and negative change velocity (VeloNeg) parameters within the function block.
Answer: Answer: In this case, both CTRL_RAMP_GENERATOR_PARAMS.tTaskCycleTime and CTRL_RAMP_GENERATOR_PARAMS.tCrtlCycleTime are set to T10s.
Answer: Answer: The VeloPos is calculated based on the target and initial temperature, ramp time, and a rate of 60 units per second, while the VeloNeg is set to 0 units per second.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.