Siemens
Siemens

Digital Industries, Motion Control, Machine Tool Systems

BSPLINE auf 840D, Angabe des Knotenvektors

Beitrag 24.06.2003, 18:26 Uhr
koenig.carsten
koenig.carsten
Level 1 = Community-Lehrling
*
Gruppe: Mitglied
Mitglied seit: 28.01.2003
Beiträge: 9
Hallo zusammen,
ich versuche NURBS-Bahnen (Befehl BSPLINE) mit unserer Sinumerik 840D zu fahren.
Die Doku von Siemens lässt für mich jedoch einige Fragen offen.
Speziell die Angabe des Knotenvektor wird mir nicht ganz klar:
"Knotenabstand PL: Der Abstand zweier Knoten wird mit PL=... programmiert. Wertebereich: wie Wegmaß."
Hat jemand schon mal mit NURBS gearbeitet, bei denen die Knotenabstände nicht gleich waren, und somit nicht angegeben werden mussten?
Was ich nicht verstehe: coangry.gif
Wenn ich z.B. eine Kurve 3. Grades durch 5 Kontrollpunkte beschreibe hat mein Knotenvektor 9 Elemente. Welche Abstände gebe ich denn dann den Kontrollpunkten mit dem "PL=..." mit?
Hat jemand vielleicht ein Nachvollziehbares Beispiel (CL- und NC-Datei) für mich?

...hoffe mal das Thema ist nicht zu exotisch wink.gif
   
Beitrag 26.06.2003, 09:31 Uhr
Wolfgang Speth
Wolfgang Speth
Level 1 = Community-Lehrling
*
Gruppe: Mitglied
Mitglied seit: 26.06.2003
Beiträge: 2
Die Nutzung des B-Splines ist eigentlich ganz einfach: Stützpunkte programmieren,
BSPLINE davorschreiben statt G1 und fertig. Die Steuerung berechnet dann intern
geeignete Knoten. Die explizite Programmierung von Knoten und Gewichten ist in
erster Linie gedacht für die automatische Erzeugung eines NC-Programms durch
ein geeignetes CAD/CAM-System. Manuell dürfte man sich hier eher schwer tun,
weil man die Einflüsse dieser Parameter nicht interaktiv sehen kann.

Wer es trotzdem probieren möchte: Eine fertige Antwort habe ich nur auf Englisch.
Ich hoffe, das ist in Ordnung.

A general B-Spline is defined by degree n, control points, knots and weights.
B-Spline-Interpolation is switched on by the G-Code BSPLINE, which is in the
same group as G1, G2, G3 and POLY.

1.------------
The degree n is programmed with the keyword SD. It must be programmed before
the spline is active. It is not possible to change the degree during spline
interpolation. Possible values are 2 and 3. If no degree is specified with SD,
the default value 3 is assumed.

Example with degree 2:
G1 ...
... ; Linear part
BSPLINE SD=2
... ; Spline part
G1

2.-------------
The control points are programmed like any other position. Examples:
X10 Y20 Z30
X=R1 Y=SIN(N*T)
X=IC(1) Y=AC(50)

There is no restriction concerning the number of control points. Other
machine codes may be programmed together with the control points. Example:
BSPLINE
...
X10 Y20 Z30 M3 S1000
...

You may even program a restricted number of blocks without control points
in between spline blocks:
BSPLINE
...
N100 X10 Y20 Z30
N110 M3 S1000
N120 X20 Y25 Z15
...
Of course, motion stops in N110, but the spline is computed coherently in the
same way as without N110.

The first control point is the last position before spline interpolation begins.
Example:
G1 X10 Y10 Z10 ; First control point
BSPLINE X20 Y20 Z30 ; Second control point
X30 Y25 ; Third control point
...
X100 Y90 Z10 ; Last control point
G1 X200


3.--------------
Every control point may have a weight, which is programmed with PW:
BSPLINE
...
X10 Y20 Z30 PW=0.8
...
If no weight is programmed, PW=1 is assumed.
The weights should be near 1 in order to avoid badly parametrized curves.

4.--------------
The most difficult point to understand is the role of the knots. You should
make a principal decision: Either program all knots or program none.

If no knots are programmed, the controller computes appropriate knots for
itself. Of course, you loose this degree of freedom in controlling the curve
shape.

In order to program the knots by yourself, you must understand the relationship
between knots and control points. First of all, the number of knots exceeds the
number of control points by (n+1). The first (n+1) knots are all equal to zero.
You can't program these knots, because they are generated automatically by the
controller. Similarly, the last (n+1) knots are all equal. The last n of these
are again generated automatically and can't be programmed.

The intermediate knots are defined incrementally. i.e. the differences of
consecutive knots are programmed with PL. A special situation arises with
multiple knots which are defined with PL=0. Since no position jump may occur,
the number of identical knots may not exceed the degree of the spline. That
means, with SD=3 at most two consecutive blocks may have PL=0. With SD=2, two
consecutive blocks with PL=0 are not allowed. Since knot multiplicitly is
already (n+1) at the boundary of the spline, PL=0 is not possible near start
and end of spline. The following examples try to clarify these points:

Degree 3:
N0 G1 ...
...
N10 BSPLINE SD=3 X16.535 Y-16.769 Z95. ; first 4 knots generated automatically.
N20 PL=0.10 X21.392 Y-18.854 ; 5th knot. PL=0 not possible!
N30 PL=0.05 X26.942 Y-21.238 ; 6th knot. PL arbitrary.
...
N100 PL=.10 X39.971 Y-28.441 Z92.743 ; PL arbitrary
N110 PL=.15 X35.962 Y-26.72 Z94.165 ; PL=0 not possible!
N120 X33.909 Y-25.838 Z94.559 ; last 3 knots generated automatically.
N130 G01 X32.988 Y-25.272 Z94.744


With degree 2 it is slightly different:

N0 G1 ...
... ; first 3 knots generated automatically.
N10 BSPLINE SD=2 X16.535 Y-16.769 Z95.PL=1; 4th knot. PL=0 not possible!
N20 PL=0.10 X21.392 Y-18.854 ; 5th knot. PL arbitrary.
N30 PL=0.05 X26.942 Y-21.238 ; 6th knot. PL arbitrary.
...
N100 PL=.10 X39.971 Y-28.441 Z92.743 ; PL arbitrary.
N110 PL=.15 X35.962 Y-26.72 Z94.165 ; PL=0 not possible!
N120 X33.909 Y-25.838 Z94.559 ; last 2 knots generated automatically.
N130 G01 X32.988 Y-25.272 Z94.744
   
Beitrag 01.07.2003, 08:28 Uhr
koenig.carsten
koenig.carsten
Level 1 = Community-Lehrling
*
Gruppe: Mitglied
Mitglied seit: 28.01.2003
Beiträge: 9
Besten Dank erst mal für die Antwort.
Eigentlich suche ich die Infos ja auch, um aus CLS-Dateien den passenden Siemens-Code zu stricken. Im CLS ist ja schon alles drin - nur das matchen des Knotenvektors macht mir Probleme...und unser CAM-System verbiegt die Spline auch über die Knoten.
So richtig schlau werde ich aus dem englischen Artikel nicht. Dass die ersten und letzten (n+1) Knotenelemente jeweils gleich sind wusste ich. Aber wenn ich die weglasse im G-Code, dann habe ich einfach nicht genügend Knotenelemente, die ich an die Kontrollpunkte dranhängen kann.
Nochmal ein Beispiel:
3. Grad (n=3), 5 Kontrollpunkte.
Mein Knotenvektor hat dann 9 Elemente.
Wenn ich jetzt (n+1)=4 Knotenelemente vorne und hinten erst mal weglasse, dann bleibt 9-(2x4)=1, also ein Knotenelement übrig. Wie teile ich das auf die 5 Kontrollpunkte auf?
Die Uni-Dortmund hat eine ganz nette Java-Seite, mit der man sich den Zusammenhang zwischen Grad, Knotenzahl und Punktezahl anschaulich machen kann. Link zur B-Spline-Seite
Bin gespannt auf weitere Antworten...
   
Beitrag 04.07.2003, 09:28 Uhr
Wolfgang Speth
Wolfgang Speth
Level 1 = Community-Lehrling
*
Gruppe: Mitglied
Mitglied seit: 26.06.2003
Beiträge: 2
Ok, machen wir ein konkretes Beispiel mit Splinegrad 3 und 5 Kontrollpunkten:

N1 G1 X0 Y0 F1000 ; P1
N2 BSPLINE X10 Y20 PL=0 ; P2, t1=t2=t3=t4 =0
N3 X20 Y30 PL=0.5 ; P3, t5= t4+0.5 =0.5
N4 X30 Y20 PL=1 ; P4, t6= t5+1 =1.5
N5 X40 Y0 PL=0 ; P5, t7=t8=t9=t6=1.5
M30

Es gibt also 5 Kontrollpunkte P1 bis P5 und 9 Knoten t1 bis t9.
Der erste Kontrollpunkt ist der Startpunkt des Satzes, in dem der Spline beginnt, in diesem
Beispiel also die in N1 programmierte Position X0 Y0. Der 2. Kontrollpunkt ist die im ersten
Splinesatz N2 programmierte Endposition, also X10 Y20.

Die ersten 4 Knoten sind immer 0. Die Steuerung setzt sie automatisch in N2. Im ersten
Satz eines kubischen B-Splines muss man deshalb keinen Knoten programmieren. Ich
empfehle dort trotzdem PL=0 zu setzen, weil das Programm dann leichter lesbar ist und man
problemlos mehrere Splineabschnitte hintereinander setzen kann, wenn dazwischen
keine andere Interpolationsart aktiv ist. Zusammen mit dem entsprechenden PL=0 am
Splineende (siehe unten), entsteht dann nämlich automatisch ein 3-facher Knoten, der wie
ein Neuanfang des Splines wirkt.

In N3 wird t5 programmiert (über die Differenz zu t4).
In N4 wird t6 programmiert (über die Differenz zu t5).

Da die 4 letzten Knoten immer identisch sein müssen, werden t7, t8 und t9 im letzten
Splinesatz N5 automatisch gleich t6 gesetzt. Genau wie im ersten Satz muss man hier kein
PL programmieren, und aus den gleichen Gründen wie dort empfehle ich auch hier
PL=0 explizit zu schreiben.
Bitte beachten: Mit PL wird immer die Differenz zweier Knoten programmiert.

Man kann sich vielleicht fragen, warum das Format nicht etwas "mathematischer" gewählt
wurde, also z.B. zuerst eine Liste aller Knoten, dann eine Liste aller Kontrollpunkte anzugeben
wäre. Ich denke, dass ist einfach zu verstehen: Der Sinumerik B-Spline macht keine
Einschränkungen bei der Funktionalität. Mit BSPLINE lassen sich alle Steuerungsfunktionen
nutzen, genauso wie bei G1. Deshalb ist ein B-Spline-Satz auch syntaktisch nichts Besonderes.
In ihm können auch Hilfsfunktionsausgaben, Spindelbefehle oder G-Codes andere Gruppen
stehen.
   
1 Besucher lesen dieses Thema (Gäste: 1)
0 Mitglieder: