Jump to content

Recommended Posts

Posted

I am using a 570 to control air temperature. I have a hot duct and cold duct in parallel with dampers 90 degrees offset on the same shaft such that when, for example, the hot duct is 100% open, the cold duct is 0% open; driven by an Oriental Motors Stepper with potentiometer positional feedback. A thermocouple provides the PV. I am using the PWM output from a V200 card to drive said stepper in a 2 wire config with one wire being enable, the other being direction.

My problem is that except for the setpoint that is manually entered of course, all the parameters are zero. I know the PID won't work with zeros in all the parameter values. What are some reasons auto tune did not write the values to the table?

I am running visilogic 9.5.0 I have also tried to find pre-written PID example routines and cannot find them under the help > example file. I also tried updating to no avail. In fact, when I click on examples, I get one folder that is "version 900" that has no PID example that I can find. Do example PID's exist? Also, is there any conversion that needs to take place between the PWM output and the stepper?

I'm worried I'm in Unitronics "No man's land" as the folk I've talked to at Unitronics support who are consistently good about answering questions seem to have the reaction of family at the Thanksgiving table when the wayward relative pregnant with an illegitimate child is metioned. I can feel the loss of eye contact on the phone. Then when I don't see examples, it makes me wonder if Unitronics just doesn't do much with PID's?

Thank you for ANY help you can offer!

rookieprogrammer being baptized in fire

Posted

Hi,

First of all, I will make sure one of our PID experts responds!

Second, there should be an example:

...\Unitronics VisiLogic_C\Examples\Version 900\Project examples\PID\V350_PID simple demo.VLP

Anything that works for the V350 will work for the V570.

Posted

Thanks, Cara. I hadn't looked in the project examples, as I think of PID as a function and not an entire project.

But here's our situation. Normally you have a controlled value (actuator, etc.) that gets modulated to control and manipulate the controlled value (temp., level, etc). So, the actuator can be closed and opened as needed. With the stepper we give it a pulse train and that controls the speed but you can't reverse a pulse train so we have to change the forward/reverse signal based on positive or negative position error. Does Unitronics have an example for that? Looking back over my notes, I think that's where Unitronics "flat lined" in regards to knowing what to do.

  • MVP 2023
Posted

Rookie,

It's not up to the manufacturer to determine how to solve every control problem. That's where the skill of the programmer comes in. Granted, Unitronics has many clever people on staff but their main job is to create and produce a product and a tool set for others to implement.

What you're looking for here is a heat/cool loop with two outputs. The standard PID function is one-sided and does not support this type of control. I ran into this problem last year when I was trying to control voltage on a test stand with a motorized variac. Two outputs were needed - voltage up, voltage down. I eventually rolled my own "PID" control by monitoring whether the PV was above or below the setpoint, calculating how far it was off and converting it to a PWM value, and then pulsing either the UP or DOWN output based on need,

Your application is very similar - take a swing at it and post your code along with questions. There are several volunteer moderators such as myself who program for a living who can help you, but the real goal is for you to understand how to solve the problem with the tools you're given. We've all been "baptized in fire".

Joe T.

  • Upvote 1
Posted

Rookie,

It's not up to the manufacturer to determine how to solve every control problem. That's where the skill of the programmer comes in. Granted, Unitronics has many clever people on staff but their main job is to create and produce a product and a tool set for others to implement.

What you're looking for here is a heat/cool loop with two outputs. The standard PID function is one-sided and does not support this type of control. I ran into this problem last year when I was trying to control voltage on a test stand with a motorized variac. Two outputs were needed - voltage up, voltage down. I eventually rolled my own "PID" control by monitoring whether the PV was above or below the setpoint, calculating how far it was off and converting it to a PWM value, and then pulsing either the UP or DOWN output based on need,

Your application is very similar - take a swing at it and post your code along with questions. There are several volunteer moderators such as myself who program for a living who can help you, but the real goal is for you to understand how to solve the problem with the tools you're given. We've all been "baptized in fire".

Joe T.

Thanks, Joe. For now, I've written a Boolean matrix that looks like I might can get by with that. It's somewhat of a "poor man's PID". Of course it never settles out. We took a swing at just what you advised with the positive and negative error calculation. And I might have to go back to that. But, at least for me, the code dynamics were getting to be pretty hairy. Trying to finish this project up, so at this point, just trying to "kill the snake" :)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.