Skip to content

66 verify winding layout jlpy and incorporate it to main - #70

Merged
sadda merged 25 commits into
mainfrom
66-verify-winding_layout_jlpy-and-incorporate-it-to-main
Oct 21, 2026
Merged

sadda merged 25 commits into
mainfrom
66-verify-winding_layout_jlpy-and-incorporate-it-to-main

Conversation

@haitao-ZCU

Copy link
Copy Markdown
Collaborator
  • Incorporate winding_layout_JL.py to main
  • delete winding.py and compute_initpos.py
  • delete belt_offset in 3f_36s and 5f_40s
  • all tests passed, including those two Ansys test

@haitao-ZCU haitao-ZCU linked an issue Oct 16, 2026 that may be closed by this pull request
@sadda

sadda commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

@haitao-ZCU Two quick comments/questions before a proper review:

  • Please change the name of the file to something proper, for example, keep the original name windings.py.
  • You removed belt_offset from the anchors, but did not add coil_pitch. I thought they correspond to each other, and I would expect that if one is removed, the other needs to be added. Is it not like that?

@haitao-ZCU

Copy link
Copy Markdown
Collaborator Author

@sadda

  1. coil_pitch is located at line 43 in set_winds_params() in 3f_36s,
    "CoilPitch": "9", # coil pitch in slots
  2. renamed as the original winding.py
  3. all tests passed

@sadda

sadda commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

@haitao-ZCU Ok, thanks. Are we sure that the second layer of coils is added to the stator? We should check the generated designs by our plotting functions (I also asked this in #69). We have plot_barriers which plots manually (fast), but there is only the rotor. We also have save_design, which grabbed the image from Ansys (slow), but the second one was probably deleted. If the second one is missing, please add it in a separate PR and then check the image.

@haitao-ZCU

Copy link
Copy Markdown
Collaborator Author
  • build_stator_coils in synrm_3f_36s.py: use loops to create coil layer.
  • assign_phase_windings in computation: connect coil layers to their phase windings instead of one layer.
  • assign_slot_currents_to_aedt in winding.py: add coil_objects_back to assign the second layer's coils with layout.phase_back and polarity_back.
  • all tests passed
  • two layers structure is added as follows:
second_layer_coils

@sadda

sadda commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

That sounds reasonable:

  • Why is there coil_objects_back?
  • What is the comparison of the generated torque when the current is the same?

@haitao-ZCU

Copy link
Copy Markdown
Collaborator Author
  • In winding.py, the first (front) layer's vars use names: phase, polarity, coil_object. The second (back) layer's vars use the same names with a '_back' suffix: phase_back, polarity_back. So, coil_object_back follows the same naming rule.
  • Another thing worth noting is that, from line 113 in winding.py, the current implementation can only support 1 and 2 layers structure.
  • Same rotor (same barrier seed) and same current for both layer counts, mean torque are
Motor Layers=1 Layers=2
synrm_3f_36s (Id=1.5A, Iq=1.5A) 4.21 9.54
synrm_5f_40s (Id1=1.5A, Iq1=1.5A, Id3=Iq3=0) 9.12 17.91

@sadda

sadda commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

@haitao-ZCU

  • We should probably halve the number of turns per coil when we have two layers. Otherwise, we will see double torque.
  • How should it be with the spaces between coils and between the coil and the air gap? Have you verified with Honza?

@haitao-ZCU

haitao-ZCU commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author
  • When "Nc" in both machines are changed from a fixed value to a formula like "68/Layers" (line 46, synrm_3f_36s.py) and "113/Layers" (line 29, synrm_5f_40s.py), the mean torque are now as follows.
Motor Layers=1 Layers=2
synrm_3f_36s 4.213 4.214
synrm_5f_40s 9.117 9.130
  • @saxik13 current _build_stator_coils places layer i_layer at (lines 148-149, synrm_3f_36s.py) :
  • origin: DiaStatorGap/2+Hs0+Hs1+SlotLiner+{i_layer}(Hs2+Rs/2-2SlotLiner)/Layers-(Layers-1)*SpaceLayers/2
  • sizes (Hs2+Rs/2-2*SlotLiner)/Layers-(Layers-1)*SpaceLayers/2

This method has a SpaceLayers gap between the two layers. I'm not sure whether there should be a gap or not.
no gap version:

  • origin: DiaStatorGap/2+Hs0+Hs1+SlotLiner+{i_layer}(Hs2+Rs/2-2SlotLiner)/Layers
  • sizes (Hs2+Rs/2-2*SlotLiner)/Layers

or with a gap version (current implemented version):

  • origin: DiaStatorGap/2+Hs0+Hs1+SlotLiner+{i_layer}(Hs2+Rs/2-2SlotLiner)/Layers-(Layers-1)*SpaceLayers/2
  • sizes (Hs2+Rs/2-2*SlotLiner)/Layers-(Layers-1)*SpaceLayers/2

And is DiaStatorGap/2+Hs0+Hs1+SlotLiner the right distance to the air gap for the double layer structure?

1

@saxik13

saxik13 commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Yes, the gap between two layers is necessary for a properly working model, and it follows the real winding in the slot. The gap should probably be larger to avoid creasing very small mesh elements in this area. But the influence on the results should be negligible.

@haitao-ZCU

Copy link
Copy Markdown
Collaborator Author

@saxik13
Thanks for the explanations. I still have another question: with the current implementation, the position of the first layer's inner edge and the second layer's outer edge changes with (Layers-1)*SpaceLayers/2. Should both ends stay fixed at the Layers=1 position, with the gap only carved out between the layers?
2

@saxik13

saxik13 commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Yes, you are right. The position of the ends should be the same for both winding layer configurations

@haitao-ZCU

Copy link
Copy Markdown
Collaborator Author
  • fix origin and sizes in _build_stator_coils (lines 148-149, synrm_3f_36s.py) to ensure both ends (inner edge of the first layer, and outer edge of the second layer) stay fixed at the same position as Layers=1. Only the middle changes, with a full SpaceLayers gap carved out between layers.
  • change the fixed Nc to 68/Layers and 113/Layers, respectively. (line 46 in synrm_3f_36s.py, and line 29 in synrm_5f_40s.py)
  • The torque results for both machines are now as follows
Motor Layers=1 Layers=2
synrm_3f_36s 4.2130 4.2133
synrm_5f_40s 9.1171 9.1259

@haitao-ZCU

Copy link
Copy Markdown
Collaborator Author
  • fix Nc values in test files to 68/Layers and 113/Layers, respectively. (line 60, test_synrm_3f_36s.py and line 42, test_synrm_5f_40s.py)
  • all tests passed.

@sadda

sadda commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

@haitao-ZCU

  • Is it going to work with 113/Layers, which produces a non-int? If yes, are we ready to merge the PR?

@haitao-ZCU

haitao-ZCU commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Yes, when we use 113/Layers (56.5), there's no error, and we got the results.
But I think it's necessary to investigate how Ansys handles this value before merging, I want to compare Nc=56, 113/Layers (56.5 here), and 57 for the same config and report the results.

@saxik13

saxik13 commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Yes, for Ansys it is just a number by which it multiplies the input current and the resulting values

@haitao-ZCU

Copy link
Copy Markdown
Collaborator Author
  • Computation results are as follows:
PointPer Nc=56 Nc=56.5 (113/Layers) Nc=57 Linear interpolation midpoint Deviation from midpoint
101 (default) 9.1402 9.1259 9.2031 9.1717 -0.499%
1001 9.2562 9.3451 9.4337 9.3449 0.0020%
2001 9.2456 9.3343 9.4227 9.3341 0.0016%

With a larger PointPer, 56.5 lands almost exactly on the linear interpolation midpoint of 56 and 57 (within ~0.002%). This matches what @saxik13 said.

  • I also checked the Ansys project file, the following graph shows that Ansys receives 56.5. But I suggest that for a double layers structure, Nc should be an even (integer for each layer), because Ansys website states it should be an integer.

https://aedt.docs.pyansys.com/version/stable/API/_autosummary/ansys.aedt.core.maxwell.Maxwell2d.assign_coil.html

and

https://ansyshelp.ansys.com/public/Views/Secured/Electronics/v261/en/Subsystems/Maxwell/Subsystems/Maxwell%20Scripting/Content/AssignCoilGroup.htm

Nc

@sadda

sadda commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

@haitao-ZCU I would ignore it, we have more pressing issues :) Is the PR ready to be merged?

@haitao-ZCU

Copy link
Copy Markdown
Collaborator Author

@sadda
Yes, we can merge it now.

@sadda
sadda merged commit 6189757 into main Oct 21, 2026
6 checks passed
@haitao-ZCU
haitao-ZCU deleted the 66-verify-winding_layout_jlpy-and-incorporate-it-to-main branch October 23, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

verify winding_layout_JL.py and incorporate it to main

3 participants