![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|||||||
![]() |
If you're really looking to learn about PLCs, you NEED our book... "Your Personal PLC Tutor - A Guide to Understanding PLCs" Easy to read and uses 'plain' language!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
![]() Join Date: Jan 2007
Location: Okeibe
Posts: 132
|
Eccentric circles problem
Hy, we have a mathematical challenge: Three ultrasonic sensors installed symmetrically (see attached) should measure the diameter of a bubble cage by checking the distance between the sensor head and the cage. But this cage is not concentric with the beam center of the three sensors.
So it should be done by special formulae. Has anyone done this exercise before? Appreciate your hints… Thanks |
|
|
|
#2 |
|
Member
![]() Join Date: Jun 2006
Location: Cambridge
Posts: 148
|
A good place to start would be looking into the equations used to find the center and radius of a circle using 3 given points. Your sensors should provide 3 points along the circle, the rest is just math...
|
|
|
|
#3 |
|
Member
![]() Join Date: Nov 2006
Location: UK
Posts: 2,916
|
What measurement will the sensors indicate ?
X or Y or something in between - it will depend on how far off centre the inner cylinder is. |
|
|
|
#4 |
|
Member
![]() Join Date: Jan 2007
Location: Okeibe
Posts: 132
|
does someone rememeber the equations used to find the center and radius of a circle using 3 given points? it has been decades since i worked with math formulae...
the sensors should indicate X value (red dashed). |
|
|
|
#5 |
|
Member
![]() Join Date: Jun 2006
Location: Cambridge
Posts: 148
|
You should endup with 2 right angle triangles and a line formed by the sensors.
The triangles can be formed by drawing a line from the point the sensors encounters the circle...to the point where the 3 sensor beams meet...this is the hypotenuse. (In your diagram this would be the grey dashed lines) Using trigonometry you can determine the X,Y co-ordinates of the 3 points on the circle. The origin of the grid (0,0) should be where the 3 sensor beams meet in the center. The hypotenuse of the triangles should be the easy to calculate: h = (distance from sensor to center) - (distance reported by sensor) Angles inside the triangle will be 60-30-90. The X would be given by X = h(sin 60) The Y would be given by Y = h(cos 60) The 3rd sensor at the top would just be Y = (total distance to center) - (distance given by sensor) X = 0 For the equations for a 3 point circle, use google to find out. They are not simple equations from a brief glance. |
|
|
|
#6 | |
|
Member
|
This is not a PLC problem! This is a and extreme challenge
Quote:
http://groups.google.com/group/sci.math.symbolic/topics The problem is easy enough to setup but my Mathcad and wxMaxima are not good enough to solve this problem. There are only three equations and three unknowns. Some of the people on the symbolics forum live for the challenge so I will post the problem there. My wxMaxima code is eq1: (x1-x0)^2+(y1-y0)^2-(r0+r1)^2; eq2: (x2-x0)^2+(y2-y0)^2-(r0+r2)^2; eq3: (x3-x0)^2+(y3-y0)^2-(r0+r3)^2; eq4: solve([eq1,eq2,eq3],[x0,y0,r0]); grind(%); where the center of the inner circle is x0,y0 and the radius is r0. x1,y1 and x2,y2 and x3,y3 are the locations of the ultrasonic sensors. r1, r2, r3 are the distances between the sensors and the inner circle. It looks easy but my wxMaxima has been working on the solution for about a half hour and so far there is no solution.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon |
|
|
|
|
#7 |
|
Member
|
The guys on sci.math.symbolic will probably shoot me.
I don't think there is a formula that will solve this. My wxMaxima is still chugging away. It is a good thing that wxMaxima uses only one of my 4 cores. Even if there is an exact solution I don't it will be short enough to be useful. I think this application must be solved by iterative means. There are minimizing techniques that can minimize error but you will not be able to use them on a PLC.
This may be a better site http://groups.google.com/group/sci.m...topics?lnk=srg
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon |
|
|
|
#8 |
|
Member
|
The conclusion is that this problem must be solved iteratively
If you look at the sci.math.symbolic forum you can see the solution is extremely long and not practical to implement in a PLC.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon |
|
|
|
#9 |
|
Member
|
wow, it's bigger and messier than i expected, then i saw link "more"...
|
|
|
|
#10 |
|
Member
|
out of curiosity can you post some of it on here? Our company group IT policy blocks all Forums. (Yes I get explicit allowance for this one!)
Cheers |
|
|
|
#11 |
|
Member
|
You asked for it!!! It exceed the 10000 character length
> I cut out my original post to get the text to fit in the 10000 character limit.
Maple 12 can quickly get a triangular form (F4+FGLM) but the system doesn't split. I obtain the following Groebner basis in lex order with y0 > x0 > r0: sys := {(x1-x0)^2+(y1-y0)^2-(r0+r1)^2,(x2-x0)^2+(y2-y0)^2-(r0+r2)^2, (x3-x0)^2+(y3-y0)^2-(r0+r3)^2}: vars := {x0,y0,r0}; G := Groebner[Basis](sys,'tord',order=plex,variables=vars): [-6*x3^2*x1^2*x2^2+2*y1^2*x1^2*y2^2-2*x1*x2^3*y3^2-2*x1^3*y3^2*x2+4*x3^2*x1 ^2*r2^2-2*r1^2*x1^2*y2^2-2*r1^2*y3^2*x1^2+2*y1^2*y3^2*x1^2-2*y3^2*y2^2*r3^2 -2*x1^3*y2^2*x2-2*y2^4*x1*x3+2*y3^2*y2^2*x3^2+2*y2^2*y3^2*x2^ 2-2*x3^2*y2^2*r3^2-2*y1^2*x2^3*x3-2*r1^4*y2*y3-2*y3^2*x2^2*r3^2-2*x1^3*y2^2 *x3+ (-8*y1*r3^2*y2+8*x3*y1^2*x2-8*y1^2*r3*r2-8*r3*x1^2*r2+8*x3^2*y2*y1-8*y1*y3* r2^2+8*y1*x2^2*y3-8*y2*x1*y3*x2-8*y3*r1^2*y2+8*x1^2*y2*y3 +8*x1*y2^2*x3-8*x1*r2^2*x3-8*x2*r1^2*x3+8*y3^2*x1*x2-8*r3^2*x1*x2-4*y3^2*x2 ^2-4*x1^2*y2^2-4*y3^2*x1^2-4*x3^2*y2^2+4*x2^2*r1^2+4*r1^2*y2^2+4*r3^2*y2^2+ 4*r3^2*x1^2+4*r3^2*x2^2+4*r2^2*x1^2-8*x3*y2*y1*x2-8*x3*y2*y3* x1+8*x3*y2*y3*x2-8*x3*y1*x1*y2+8*x3*y1*y3*x1-8*x3*y1*y3*x2+8*x1*y2*y1*x2-8* y1*x2*y3*x1-4*x3^2*y1^2-4*y1^2*x2^2+4*y1^2*r2^2+8*r1*x1*x3*r2+4*r1^2*x3^2+ 4 *y3^2*r1^2+4*y3^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1*y2* x1*x3*r2+16*y1*x1*x3*y3*r2-8*y1*x1*x3*r3*y2-8*y1*x1*y3*x2*r3-8*y1*x1*x2*y3* r2-8*y1*x2*x3*y3*r2+16*y1*x1*x2*r3*y2-8*y1*r1*x3*y3*x2-8*x1*y2*x3*y3*r2-8*x 1*y3*x2*r3*y2+16*r1*x3*y2*y3*x2-8*r1*x3*y2*y3*x1-8*y1*r1*x3* ...
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon |
|
|
|
#12 |
|
Member
|
Ouch Peter (I didn't quote you on that one for obvious reasons!)
I see what you mean, thats a complicated formula. But also about a third of the way down it some thing odd happens...... ... it turns into a pretty pattern; I am sure I can see a face in there ![]() It may be a stupid question, but could the OP mount the sensors on brackets so they are equal distances from the center??? |
|
|
|
#13 |
|
Member
|
Solving using iteration
The best way to solve this is to go back to the original 3 equations.
(x1-x0)^2+(y1-y0)^2-(r0+r1)^2 = error1; (x2-x0)^2+(y2-y0)^2-(r0+r2)^2 = error2; (x3-x0)^2+(y3-y0)^2-(r0+r3)^2 = error3; SSE=error1^2+error2^2+errorr^3 SSS=Sum of Square Error. There are minimizing/optimizing routines .... http://en.wikipedia.org/wiki/L-BFGS http://en.wikipedia.org/wiki/Levenbe...ardt_algorithm that will intelligently try different combinations of r0,x0, and y0 in an effort to minimize the error. The algorithms finds the rate of change of the SSE as a function of each dimension and finds the best change to minimize the SSE. I bet it would take only a few iterations (10-25) that would minimize the SSE close to 0. What helps is that there are good starting estimates for x0,y0 and r0. This code can easily be written ( about 1/2 hour ) using math software like Mathcad, Matlab, Maple, Mathematica or Scilab. Edit, I just saw this It doesn't really make any difference. I was hoping for a symbolic solution where x1,y1,x2,y2,x3,y3 could be anything.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon Last edited by Peter Nachtwey; March 31st, 2009 at 09:04 PM. |
|
|
|
#14 |
|
Member
![]() Join Date: Jan 2007
Location: Okeibe
Posts: 132
|
Guys, thank you for your enthusiastic support.
Note that the 3 sensors are installed (fixed) at equal distances (equilateral triangle). But the cage, which diameter is to be measured, is always moving around (plastic film). So the plc should do the calculation fast enough to measure and control the actual diameter. |
|
|
|
#15 | |
|
Member
|
This isn't a joke.
Quote:
My equations are right. If not the guys on the other forum would have let me know. The guys on the sci.math.symbolics use group are very good mathematicians and they have better math tools than I have and still they couldn't find a simple answer. I doubt you are going to enter pages of formulas in a PLC or that the PLC could do the calculations fast enough. I would look into using an embedded PC like a PC104 system.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon Last edited by Peter Nachtwey; April 1st, 2009 at 01:47 AM. Reason: Recommend PC104 |
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Topics
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AB DH485 network problem | rajsiyer | LIVE PLC Questions And Answers | 6 | February 8th, 2008 09:00 PM |
| OMRON NT31c screen problem | jugenzhu1963 | LIVE PLC Questions And Answers | 10 | November 7th, 2006 03:54 PM |
| Ab Plc5 Rio Problem. | fernandes | LIVE PLC Questions And Answers | 5 | March 7th, 2004 01:25 PM |
| N8 file problem | jimtech67 | LIVE PLC Questions And Answers | 2 | February 6th, 2003 04:58 PM |
| N8 file problem | LIVE PLC Questions And Answers | 0 | February 6th, 2003 07:36 AM | |