News:

  • October 26, 2025, 07:45:45 PM

Login with username, password and session length

Author Topic: Do-More CPU, H2-CTRIO2 closed loop control?  (Read 23993 times)

ERokc

  • Hero Member
  • *****
  • Posts: 118
Do-More CPU, H2-CTRIO2 closed loop control?
« on: November 14, 2012, 10:03:35 PM »
I think I want a closed loop control using H2-CTRIO2 and GS2 VFD. I plan to use a quadrature encoder with the CTRIO2 and a Do-More CPU of course.  I will use the CTRIO2 preset table for row positions and a drum for column points to fire for each row.  Please don't suggest a stepper motor.  They have there place but I don't want to use one here.

Let me back up and ask, will the CTRIO2 produce pulses to ramp up/down to a position having been given the count value for the position?  I believe the axis control of the CTRIO2 is what I need. My application does not need speed variation within the cycle beyond ramping up, level off and ramping down and stopping at a specified position (hopefully a variable in memory).  An emergency stop is needed if something wrong is detected and would be nice to ramp down as quick as possible, position irrelevant.

Jumping to the GS2 VFD, it takes discrete commands and has profiles within but I don't think there is a way to control where it stops.  It has serial input but again I don't know how to translate a position from the CTRIO2 to serial data.  GS2 has analog inputs with discrete direction but still the CTRIO's output is pulses.

I think a frequency to analog converter could do it. Is this the way to go or is there a better way?
Anyone know of a converter available? I could build one but it's always cheaper and much quicker to buy.

Is there a better way to control an AC motor.  It needs to reverse and soft start/stop.

Give me your thoughts, am I on the right track?

Thanks, Dave

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #1 on: November 15, 2012, 09:53:05 AM »
I think I want a closed loop control using H2-CTRIO2 and GS2 VFD. I plan to use a quadrature encoder with the CTRIO2 and a Do-More CPU of course.  I will use the CTRIO2 preset table for row positions and a drum for column points to fire for each row.  Please don't suggest a stepper motor.  They have there place but I don't want to use one here.

Don't really know, we aren't apps guys. Pulse outputs are generally used with either steppers or servos, how it would integrate with a VFD is not something that I can answer.

Let me back up and ask, will the CTRIO2 produce pulses to ramp up/down to a position having been given the count value for the position?  I believe the axis control of the CTRIO2 is what I need. My application does not need speed variation within the cycle beyond ramping up, level off and ramping down and stopping at a specified position (hopefully a variable in memory).  An emergency stop is needed if something wrong is detected and would be nice to ramp down as quick as possible, position irrelevant.

Yes, CTRIO2 axis mode will do this.

Jumping to the GS2 VFD, it takes discrete commands and has profiles within but I don't think there is a way to control where it stops.  It has serial input but again I don't know how to translate a position from the CTRIO2 to serial data.  GS2 has analog inputs with discrete direction but still the CTRIO's output is pulses.

Again, not sure how you will get from pulses to analog.

Give me your thoughts, am I on the right track?

At first blush it feels like you are shoehorning the VFD when a servo might be a better choice. But again, nobody here at Host is an apps guys. Perhaps some of the real controls guys will chime in and offer some thoughts.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #2 on: November 15, 2012, 01:41:58 PM »
It sounds like you need a servo. A VFD is not a motion controller, but, depending on the speed and precision you need, it may be able to do the job. You cannot send a position signal to a VFD and have it go there, all you can do is tell it what direction to go, and how fast you want it to run (then you have ramps etc.). This can all be done easily with the serial port. There are sample programs for doing this over at AD's forum. Bcarlton has a really good sample for an 06 with stages that can be adapted to DoMore. Hope this helps...
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

ERokc

  • Hero Member
  • *****
  • Posts: 118
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #3 on: November 15, 2012, 07:54:04 PM »
BobO, is there a register in the CTRIO2 that represents the frequency of the output and can be read by the CPU?
Where I'm headed with this is scaling it in software to represent voltage then use an analog module in the PLC.

This is for the application folks. What I like about using a three phase motor and VFD is the cost is low. I will limit the motor speed to 2X normal hoping not to need an inverter grade motor.

Dave

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #4 on: November 15, 2012, 08:26:01 PM »
Yeah. I'm guessing it is .OutputFrequency in the pulse output structure, but I'm not in front of a PC to confirm the name.

If you take the frequency and scale into an analog, I'm sure that it will kinda work. The question is how fast it will respond and whether the resulting slop is tolerable. Axis closed loop mode is not designed to handle wide disparities between target and actual position, but it will try real hard to get there.

Another possibility would be to run a PID loop on the target position and the encoder...encoder is PV and pulse output position is the SP. Scale the output into the analog driving the VFD...but trust me, I have no clue whether that would work. Like the previous example, I'm sure it would kinda work, the question is how fast and whether the slop was tolerable.

But I guess if you wanna get by on the cheap, you must be willing to compromise performance.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ERokc

  • Hero Member
  • *****
  • Posts: 118
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #5 on: November 15, 2012, 11:39:29 PM »
BobO, you must love your job to be working this late.  Did you refrain from working on vacation?
I love my job too.  The PLC part of my project gets attention at night.

After my last post I went looking for the answer to my question, found it!  I use the full name to help me learn this stuff, $CTRIO_000_Out0.OutputVelocity.  It's pulses per second.

I'm still learning the syntax of ladder logic and have not started learning Stage programming.  What would scaling code look like to read the velocity, multiply by a factor then add or subtract an offset?

You answered another question I have about CTRIO adjusting to error in position as it ramps down.  My app is NOT like a CNC mill that uses ball screws for +- 0.0002" accuracy with wide variations in speed, direction and load.  It is much simpler.  With the exception of needing to back out of a jam condition it will run one direction, conveyor style, and position accuracy is something like +- 1/16". The load variation should be slight. My encoder resolution is considerably better than required at 0.001" per pulse.  My target speed is 12"/sec which is 12kHz pulse rate.  That's what directed me to CTRIO, then I learned about preset tables, I can use that!

A question while I'm thinking about it, is $Main being scanned when $Programs are running?

Tell me more about PID. I know what PID is having used temperature controls that use PID.  I don't know how they are implemented in the Ladder Logic or Stage programming.  Do you mean the PID is used with the CTRIO axis control?  Can you give me an example?  I understand much better when I see examples.

I will know if this works only after putting it together and seeing what it does.  I am never discouraged when something doesn't work on the first try. One of my virtues is patience and not giving up easy.

Thanks for your help. Dave

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3601
  • Darth Ladder
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #6 on: November 16, 2012, 12:45:39 AM »
Actually, positioning using induction motors is very common in lower bandwidth high-hp applications like automated warehousing or automated rigid cranes and so on.  When done properly, you'd never know looking at one of these applications except for the bandwidth that you're not looking at a servo app.

Now, "done properly" tends to mean vector grade drives running in torque mode with encoder feedback and not chintzing out on motor hp, but it does work and it works very well.

I've actually taken a motor elevating a load, and just let it hang there stalled without the brake engaged to see how it would do and it would hold position withing an encoder count or so for hours.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #7 on: November 16, 2012, 10:22:47 AM »
What would scaling code look like to read the velocity, multiply by a factor then add or subtract an offset?

Use the SCALE instruction.

A question while I'm thinking about it, is $Main being scanned when $Programs are running?

Everything is scanned every scan. Some things won't execute if disabled or not due, but yes, $Main runs all the time.

Tell me more about PID. I know what PID is having used temperature controls that use PID.  I don't know how they are implemented in the Ladder Logic or Stage programming.  Do you mean the PID is used with the CTRIO axis control?  Can you give me an example?  I understand much better when I see examples.

That one was a long shot. If you don't have specific experience with PID, I would not go there. The built-in closed loop behavior should be fine. It implements simple proportional control (defined by the Scale Factor) with a bit of real time fudge. The real time adjustments will clean up small amounts of slop on the fly, but even if it can't completely fix it, it will reverse to the target if needed. So you will hit your spot eventually, to within the specified encoder deadband. The only fear is that your control of the VFD isn't tight enough and you will end up oscillating.

"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #8 on: November 16, 2012, 10:28:56 AM »
...I'm guessing it is .OutputFrequency in the pulse output structure, but I'm not in front of a PC to confirm the name...

It's actually .OutputVelocity. erokc, there is an FAQ showing all the CTRIO structure members here: http://www.hosteng.com/FAQFiles/Do-more.htm#FAQ0028
There are two types of people in the world; those that can extrapolate from incomplete data sets.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #9 on: November 16, 2012, 10:30:32 AM »
After my last post I went looking for the answer to my question, found it!  I use the full name to help me learn this stuff, $CTRIO_000_Out0.OutputVelocity.  It's pulses per second.

He had found it, Greg.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #10 on: November 16, 2012, 11:09:38 AM »
He had found it, Greg.

Yeah, totally missed that.  ;D Ha! But the FAQ is useful.  8) Which reminds me, I need to make that available from the CTRIO FAQ page as well. Oops.  :-\
There are two types of people in the world; those that can extrapolate from incomplete data sets.

ERokc

  • Hero Member
  • *****
  • Posts: 118
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #11 on: November 16, 2012, 09:46:43 PM »
I feel confident enough to give it a try.  BobO, confirm for me, if the motor position stops within the dead band that satisfies the move?  I would start with my tolerance of +- 1/16" or 63 counts.  Don't know if dead band is entered plus/minus but will find out.  As for your suggested SCALE instruction, of course! I previously printed the Do-More instruction set, I need to use it!

Controls Guy, explain bandwidth.  Would that relate to the range of motor speed?  Unlike your example my application will start with 3/4 hp, I'm expecting 1/2 will do it.  I can set the VFD for 1/2 hp or less current and see where it fails to drive the machine.

Greg, I bookmarked the FAQ you mentioned. I am so new at this EVERYTHING is helpful.  I am impressed with Designers HELP.  Host has put a ton of information in it.  The technical writers are good.  Easy to understand and complete without extra unnecessary detail. I don't have to re-read statements, I get it the first time!

The machine is not ready for the drive so I'm having to wait for the trial.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6127
  • Yes Pinky, Do-more will control the world!
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #12 on: November 18, 2012, 01:53:42 PM »
BobO, confirm for me, if the motor position stops within the dead band that satisfies the move?

In closed loop, the output is computed off of the distance to target. Each time it needs to compute the next portion of the move it checks to see if the position is within the deadband and the frequency is at the minimum. If both conditions are true, the move is complete. If not, it computes the next movement that will get closer to the goal of not moving and within the deadband. So the short answer is 'yes'.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #13 on: November 18, 2012, 03:26:28 PM »
For crude positioning using a VFD I always start with the square root of the distance left to travel. That times an empirically determined constant gives me a nice smooth deceleration.  To determine the constant I adjust between 'too fast, overshooting' and 'too slow, stalling before the end'. It gives acceptable performance with minimal math.
An output is a PLC's way of getting its inputs to change.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3601
  • Darth Ladder
Re: Do-More CPU, H2-CTRIO2 closed loop control?
« Reply #14 on: November 19, 2012, 07:02:46 PM »
Controls Guy, explain bandwidth.  Would that relate to the range of motor speed?  Unlike your example my application will start with 3/4 hp, I'm expecting 1/2 will do it.  I can set the VFD for 1/2 hp or less current and see where it fails to drive the machine.

The technical definition is if you were to feed the positioner a sinusoidal command, what is the maximum frequency command that it can follow to a certain degree of compliance.

In practice you can relate it to the ratio of positioning tolerance to top-end velocity.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.