Some changes
This commit is contained in:
parent
57455b84ab
commit
766bb1a985
103 changed files with 37820 additions and 2394 deletions
|
@ -348,7 +348,7 @@ begin
|
|||
for i := 0 to 360 do
|
||||
begin
|
||||
coords := CircleCoordinates(CoilRadius*2, i+180);
|
||||
writeln(OutFile,'CoilRadius*2= ',CoilRadius*2:0:5,' X=', coords.X:0:3, ' Y=', coords.Y:0:5);
|
||||
// writeln(OutFile,'CoilRadius*2= ',CoilRadius*2:0:5,' X=', coords.X:0:3, ' Y=', coords.Y:0:5);
|
||||
angle := CalculateAngle(coords.Y, CurrentZ);
|
||||
|
||||
// writeln(OutFile, ';G1 X', coords.X:0:3, ' Y', angle:0:5,' Z', CurrentZ:0:5);
|
||||
|
@ -375,49 +375,68 @@ begin
|
|||
end
|
||||
else if (StatorParams.RayShape = 'rect') then
|
||||
begin
|
||||
writeln(OutFile, ';Rect? ');
|
||||
while (LayerNumber < MaxLayers) do
|
||||
begin
|
||||
writeln(OutFile, ';Layer ', LayerNumber);
|
||||
//Ñ÷èòàåì äëèíó êàòóøêè è êîëè÷åñòâî âèòêîâ
|
||||
RequiredSpacing:=StatorParams.PathClearance*2+(LayerNumber-1)*StatorParams.WireDiameter*2+StatorParams.NeedleDiameter;
|
||||
|
||||
writeln(OutFile, ';RayWidth ', StatorParams.RayWidth:0:5);
|
||||
writeln(OutFile, ';RequiredSpacing ', RequiredSpacing:0:5);
|
||||
writeln(OutFile, ';AngleBetweenRays ', AngleBetweenRays:0:5);
|
||||
|
||||
MaxDepth:=DepthCheck(StatorParams.RayWidth, RequiredSpacing, AngleBetweenRays);
|
||||
writeln(OutFile, ';MaxDepth ', MaxDepth:0:5);
|
||||
writeln(OutFile);
|
||||
If (MaxDepth < (StatorParams.BaseRadius)) then CoilLength:=StatorParams.RayLength else if (MaxDepth > (StatorParams.RayLength+StatorParams.BaseRadius)) then break else
|
||||
CoilLength:=StatorParams.RayLength+StatorParams.BaseRadius-MaxDepth;
|
||||
writeln(OutFile, ';CoilLength ', CoilLength:0:5);
|
||||
CurrentCoilTurns := ceil(CoilLength/StatorParams.WireDiameter);
|
||||
// CurrentCoilTurns := ceil(CoilLength/StatorParams.WireDiameter);
|
||||
CurrentCoilTurns := round(CoilLength/StatorParams.WireDiameter);
|
||||
writeln(OutFile, ';CurrentCoilTurns ', CurrentCoilTurns);
|
||||
// CurrentCoilTurns := round(CoilLength/StatorParams.WireDiameter);
|
||||
|
||||
CoilTurnsSum := CoilTurnsSum+CurrentCoilTurns;
|
||||
writeln(OutFile, ';CoilTurnsSum ', CoilTurnsSum);
|
||||
writeln(OutFile);
|
||||
writeln(OutFile, ';We make ',CurrentCoilTurns, ' turns on ', LayerNumber, ' layer.' );
|
||||
|
||||
writeln(OutFile,';CoilWidth = ',CoilWidth:0:5);
|
||||
|
||||
|
||||
for j := 0 to CurrentCoilTurns do
|
||||
begin
|
||||
|
||||
writeln(OutFile,';CoilWidth = ',CoilWidth:0:5);
|
||||
angle := CalculateAngle(CoilWidth/2, CurrentZ);
|
||||
writeln(OutFile,';Coil¹ = ',j);
|
||||
writeln(OutFile,'M117 ',j);
|
||||
//angle := CalculateAngle(CoilWidth/2, CurrentZ);
|
||||
angle := AngleBetweenRays/2;
|
||||
//Divide the path into 100 points
|
||||
(* for k := 1 to 100 do
|
||||
begin
|
||||
end; *)
|
||||
|
||||
writeln(OutFile, 'G1 X', -1*CoilHeight/2:0:3, ' Y', angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5); // Top Left Corner
|
||||
if MoveForward then CurrentZ:=CurrentZ+StatorParams.WireDiameter/4 else CurrentZ:=CurrentZ-StatorParams.WireDiameter/4;
|
||||
writeln(OutFile, 'M0');
|
||||
//writeln(OutFile, 'M0');
|
||||
|
||||
// angle := CalculateAngle(CoilWidth/2, CurrentZ);
|
||||
writeln(OutFile, 'G1 X', CoilHeight/2:0:3, ' Y', angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5); // Top Right Corner
|
||||
if MoveForward then CurrentZ:=CurrentZ+StatorParams.WireDiameter/4 else CurrentZ:=CurrentZ-StatorParams.WireDiameter/4;
|
||||
writeln(OutFile, 'M0');
|
||||
//writeln(OutFile, 'M0');
|
||||
|
||||
angle := CalculateAngle(-1*CoilWidth/2, CurrentZ);
|
||||
writeln(OutFile, 'G1 X', CoilHeight/2:0:3, ' Y', angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5); // Bottom Right Corner
|
||||
// angle := CalculateAngle(-1*CoilWidth/2, CurrentZ);
|
||||
writeln(OutFile, 'G1 X', CoilHeight/2:0:3, ' Y', -angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5); // Bottom Right Corner
|
||||
if MoveForward then CurrentZ:=CurrentZ+StatorParams.WireDiameter/4 else CurrentZ:=CurrentZ-StatorParams.WireDiameter/4;
|
||||
writeln(OutFile, 'M0');
|
||||
//writeln(OutFile, 'M0');
|
||||
|
||||
// angle := CalculateAngle(CoilWidth/2, CurrentZ);
|
||||
writeln(OutFile, 'G1 X', -1*CoilHeight/2:0:3, ' Y', angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5); // Bottom Left Corner
|
||||
writeln(OutFile, 'G1 X', -1*CoilHeight/2:0:3, ' Y', -angle:0:5,' Z', NormalizeZ(CurrentZ, angle):0:5); // Bottom Left Corner
|
||||
if MoveForward then CurrentZ:=CurrentZ+StatorParams.WireDiameter/4 else CurrentZ:=CurrentZ-StatorParams.WireDiameter/4;
|
||||
writeln(OutFile, 'M0');
|
||||
//writeln(OutFile, 'M0');
|
||||
end;
|
||||
|
||||
|
||||
writeln(OutFile, 'M0');
|
||||
// writeln(OutFile, 'G91');
|
||||
// writeln(OutFile, 'G1 Y50');
|
||||
// writeln(OutFile, 'G90');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue