You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old February 5th, 2023, 11:43 AM   #31
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,152
Quote:
Originally Posted by MaxK View Post
It would be very interesting to see also the control curve, because the nature of the noise modes in the valve position signal is not clear.
What do you mean by control curve? The green line should be the output to the valve. The valve has an inner control loop that should position the valve to 50% open when a 5 volt signal is applied. The valve takes -10 to +10 volts. There is a spool position feedback which most people don't bother with.


I wrote the code for they HYD02 and M02AS controllers over 20 years ago. The code for the HYD02 and M02AS started with the M02AE code. There where conditional compiles that would add or remove code depending on the feedback. The advantage is that the learning curve going from one controller to the next was minimal. The same commands from the PLC could control all three versions.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old February 6th, 2023, 03:43 PM   #32
kamenges
Member
United States

kamenges is offline
 
kamenges's Avatar
 
Join Date: Nov 2002
Location: Brillion, WI
Posts: 4,276
Quote:
Originally posted by Peter Nachtwey:

So the target and actual positions are not on the same scale?
That's the way to looks to me. The numbers in the box on the upper left corner of the trend show the min and max values for each trace. But like I said, the thing that really tipped me off was that each trace touches the top and bottom of the graph somewhere. That isn't likely to happen with fixed scaling and it isn't coincidental.

Keith
  Reply With Quote
Old February 6th, 2023, 04:41 PM   #33
Robb B
Lifetime Supporting Member
Canada

Robb B is offline
 
Join Date: Feb 2011
Location: BC, Canuckistan
Posts: 290
Target and actual positions were set to automatic scale, but are the same units (inches). The latest one is done with fixed scales + 10%.

I might look a little further into the feedback circuit, it could be enlightening for future diagnostics.
  Reply With Quote
Old February 6th, 2023, 07:07 PM   #34
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 3,688
Quote:
Originally Posted by Peter Nachtwey View Post
So the target and actual positions are not on the same scale? The tracking looks good when moving.
That's correct - the command position is scaled 16-101 units, and the actual position 13-103. Logix trends are set to automatically scale the Y axis by default, and in some cases that's helpful, but in cases like this the first thing you need to do is to manually set up the scaling so that you can get a meaningful trace happening.
  Reply With Quote
Old February 6th, 2023, 09:34 PM   #35
MaxK
Member
Czech_Republic

MaxK is offline
 
Join Date: Jul 2022
Location: FrozenHell
Posts: 120
Quote:
Originally Posted by Peter Nachtwey View Post
The green line should be the output to the valve.
This is the signal from the controller to the valve. Got it.

1. Any way, the "noise" is not white or normal, there are obvious "modes", i.e. there is a clear system “error” in the operation of the algorithm (calculations) - it seems to me that it would be useful to identify it.

2. If we look at the "Motion cycle manual 2023 02 02.jpg" graph (trying to remove the noise), we can see the fluctuations (1:12:14 - 1:12:19 they can be seen quite well). Fluctuations mean that at least one of the process harmonics (lag order) is not compensated by the control system. Possible solutions:
- Reduce the "order" of the process. Make the pipeline more rigid, remove backlashes, leaks, delays, etc.
- Increase the control order. In practice, it is not realizable.
- Reduce the "speed" of the process.
S-curve formula?
The "up" movement takes about 4 seconds, and the "down" movement takes about 6 seconds.
- Why?
- I do not know the intricacies of the process, but when moving "down" the fluctuations are much less
  Reply With Quote
Old February 6th, 2023, 09:55 PM   #36
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,152
Quote:
Originally Posted by MaxK View Post
This is the signal from the controller to the valve. Got it.

1. Any way, the "noise" is not white or normal, there are obvious "modes", i.e. there is a clear system “error” in the operation of the algorithm (calculations) - it seems to me that it would be useful to identify it.
The spikes are not really noise. They are due to poor feedback resolution and the derivative gain.

Quote:
2. If we look at the "Motion cycle manual 2023 02 02.jpg" graph (trying to remove the noise), we can see the fluctuations (1:12:14 - 1:12:19 they can be seen quite well). Fluctuations mean that at least one of the process harmonics (lag order) is not compensated by the control system. Possible solutions:
- Reduce the "order" of the process. Make the pipeline more rigid, remove backlashes, leaks, delays, etc.
- Increase the control order. In practice, it is not realizable.
- Reduce the "speed" of the process.
The controller has a scan time of 250 microseconds. Going slow will not help. I bet there are times when the controller doesn't even see the counts change between scans because there aren't enough encode counts per resolution.

The M02AE, HYD02 and M02AS all work of counts internally and there aren't enough that go by every scan time.

Quote:
S-curve formula?
Yes, the PLC generates the a 3rd order s-curve. The M02AS knows nothing about s-curves. The PLC generates a position for the controller to be at every coarse update time. The controller interpolates between the coarse up date times to generate a new position and velocity every 250 microseconds.

Quote:
The "up" movement takes about 4 seconds, and the "down" movement takes about 6 seconds.
- Why?
Maybe that is all the is required. Robb B needs to do some math and tell us how many counts occur every 250 microseconds while moving.

Quote:
- I do not know the intricacies of the process, but when moving "down" the fluctuations are much less
Remember the spikes are just due to quantizing error.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old February 7th, 2023, 12:21 PM   #37
Robb B
Lifetime Supporting Member
Canada

Robb B is offline
 
Join Date: Feb 2011
Location: BC, Canuckistan
Posts: 290
Quote:
Originally Posted by Peter Nachtwey View Post
The spikes are not really noise. They are due to poor feedback resolution and the derivative gain.


The controller has a scan time of 250 microseconds. Going slow will not help. I bet there are times when the controller doesn't even see the counts change between scans because there aren't enough encode counts per resolution.

The M02AE, HYD02 and M02AS all work of counts internally and there aren't enough that go by every scan time.


Yes, the PLC generates the a 3rd order s-curve. The M02AS knows nothing about s-curves. The PLC generates a position for the controller to be at every coarse update time. The controller interpolates between the coarse up date times to generate a new position and velocity every 250 microseconds.


Maybe that is all the is required. Robb B needs to do some math and tell us how many counts occur every 250 microseconds while moving.


Remember the spikes are just due to quantizing error.
If my math is correct, at 250 microseconds there is 0.2085 Feedback counts. The position is almost meaningless or undefined in 250 microsecond intervals, it's only when longer time periods are used that any real information about position becomes available.

The "up" and "down" is horizontal movement, but it's the difference between forward and reverse. They run at slightly different speeds due to carrying a load and being empty. The load is maximum 8 railway ties, about 300 lbs each (sometimes less).
  Reply With Quote
Old February 7th, 2023, 07:54 PM   #38
MaxK
Member
Czech_Republic

MaxK is offline
 
Join Date: Jul 2022
Location: FrozenHell
Posts: 120
Quote:
Originally Posted by Robb B View Post
If my math is correct, at 250 microseconds there is 0.2085 Feedback counts.
How did you calculate it???

Quote:
Originally Posted by Robb B View Post
The "up" and "down" is horizontal movement, but it's the difference between forward and reverse. They run at slightly different speeds due to carrying a load and being empty. The load is maximum 8 railway ties, about 300 lbs each (sometimes less).
So in which direction does it move loaded and in which empty?

Quote:
Originally Posted by MaxK View Post
- Reduce the "speed" of the process.
I'm sorry, I didn't express myself correctly. By Reducing the "speed" I meant decreasing derivatives (velocity, acceleration, etc.).
  Reply With Quote
Old February 7th, 2023, 09:25 PM   #39
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,152
I 'be got a new topic for a Peter ponders pic video. Resolution.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old February 8th, 2023, 10:13 AM   #40
Robb B
Lifetime Supporting Member
Canada

Robb B is offline
 
Join Date: Feb 2011
Location: BC, Canuckistan
Posts: 290
Quote:
Originally Posted by MaxK View Post
How did you calculate it???

So in which direction does it move loaded and in which empty?

I'm sorry, I didn't express myself correctly. By Reducing the "speed" I meant decreasing derivatives (velocity, acceleration, etc.).
To calculate I used 41.7 counts per inch at a rate of 20 inches per second (maximum speed in the axis configuration), reduced to a 0.000250 second interval. Lower speeds will produce more counts per second, I think the existing encoder should be okay for the application at 22bits of resolution, but that the way it's measuring, or perhaps it's location is causing more uncertainty or inaccuracy.

It moves from low (13 inches) loaded to high (106 inches) to unload. There are different speeds programmed for loaded travel vs unloaded travel, which is probably unnecessary.
  Reply With Quote
Old February 8th, 2023, 12:40 PM   #41
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,152
Quote:
Originally Posted by Robb B View Post
To calculate I used 41.7 counts per inch at a rate of 20 inches per second (maximum speed in the axis configuration), reduced to a 0.000250 second interval. Lower speeds will produce more counts per second,
No! fewer!

41.7 cnts/inch / 20 inch/sec = 2.085 cnts/sec.


This means that most of the time, the controller doesn't see the motor turning. When it does, the derivative term provides a big spike.



Quote:

I think the existing encoder should be okay for the application at 22bits of resolution, but that the way it's measuring, or perhaps it's location is causing more uncertainty or inaccuracy.
Now I am confused again. are there 2^22 counts per turn or just 22 counts per turn? How do you get 22 counts per turn when an SSI encoder usually has some number n raised to the 2 counts per turn? 8 bit encoders are common and will produce 2^8 bits per revolution or 256 bits. So are 10 and 13 bit SSI encoders.



Quote:

It moves from low (13 inches) loaded to high (106 inches) to unload. There are different speeds programmed for loaded travel vs unloaded travel, which is probably unnecessary.
It may be necessary, the load changes the open loop gain or maximum speed of the system.


There is a lot that doesn't make sense.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old February 8th, 2023, 01:14 PM   #42
Robb B
Lifetime Supporting Member
Canada

Robb B is offline
 
Join Date: Feb 2011
Location: BC, Canuckistan
Posts: 290
Quote:
Originally Posted by Peter Nachtwey View Post
No! fewer!

41.7 cnts/inch / 20 inch/sec = 2.085 cnts/sec.


This means that most of the time, the controller doesn't see the motor turning. When it does, the derivative term provides a big spike.




Now I am confused again. are there 2^22 counts per turn or just 22 counts per turn? How do you get 22 counts per turn when an SSI encoder usually has some number n raised to the 2 counts per turn? 8 bit encoders are common and will produce 2^8 bits per revolution or 256 bits. So are 10 and 13 bit SSI encoders.




It may be necessary, the load changes the open loop gain or maximum speed of the system.


There is a lot that doesn't make sense.
I must have misplaced my decimal. There's a lot I'm learning, my ignorance surely causes confusion. I don't know about counts per turn, I got 22 bits from the feedback tab of the motion axis. 22bits at 208Khz with an absolute feedback offset of 10006.984 inches.
  Reply With Quote
Old February 8th, 2023, 03:34 PM   #43
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 8,152
I am still confused. If an SSI encoder has 22 bits then it gets 2^22 counts per revolution. Next we need to know how many inches travel per revolution. From this we calculate the number of counts per inch. If the machine moves at 20 inches per second, we can calculate the number of counts per second and the number of counts per 250 microseconds.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old February 8th, 2023, 07:33 PM   #44
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 6,409
[Edit: fixed some typos]

Quote:
Originally Posted by Peter Nachtwey View Post
41.7 cnts/inch / 20 inch/sec = 2.085 cnts/sec.
Oh dear, Peter ...

Do at least perform a modicum of unit analysis and get the units right.
Code:
     count
41.7 -----
     inch            cnt s
-----------  = 2.085 ------
      inch           inch2
20    ----
       s
Which is of course the kind of complete nonsense we get when we don't pay attention to units.

OP had at least the number correct originally:
Code:
     count            inch                s              count
41.7 -----   *     20 ----  =  0.000250 -----  =  0.2085 -----
     inch              s                cycle            cycle
OP did get the slope wrong though: lowering the linear speed (20.47 inch/s, above) will produce fewer counts per second.
__________________
_
Brian T. Carcich
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
iii) Measurement is hard.
iv) I solemnly swear that I am up to no good
v) I probably have the highest ratio of forum posts to actual applications in the field (∞).
vi) Hakuna matata.

Last edited by drbitboy; February 8th, 2023 at 07:36 PM.
  Reply With Quote
Old February 8th, 2023, 08:25 PM   #45
MaxK
Member
Czech_Republic

MaxK is offline
 
Join Date: Jul 2022
Location: FrozenHell
Posts: 120
Quote:
Originally Posted by Robb B View Post
20 inches per second (maximum speed in the axis configuration)
it seemed to me that on the chart "Motion cycle manual 2023 02 02.jpg" the speed reaches 25 inches per second. doesn't matter

Quote:
Originally Posted by Robb B View Post
Lower speeds will produce more counts per second
Excuse me?
According to your logic, at speed = 0, the accuracy will be infinite
(encoder resolution) * (speed)
speed = 20 inch/second
counts per second = 41,7 counts/inch * 20 inch/second = 834 counts/second
speed = 0 inch/second
counts per second = 41,7 counts/inch * 0 inch/second = 0 counts/second

Quote:
Originally Posted by Robb B View Post
It moves from low (13 inches) loaded to high (106 inches) to unload.
In other words loaded stacker moves faster then unloaded. Correct?
At the moment then stacker almost immediately stops it lost load. Correct?
You questioned why it is oscillations. Correct?

Try do decrease all target position curve derivates as low as possible

Quote:
Originally Posted by Robb B View Post
22bits at 208Khz with an absolute feedback offset of 10006.984 inches.
10006.984 inches * 41,7 counts/inch = 417291,2328 counts

2^22 = 4194304

10 times difference. Are you sure you didn't make a mistake with the orders (decimal point) anywhere?
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:51 PM.


.