It's a bit interesting to get into.
I've been waiting two weeks now to get access to the yahoo group, but not holding my breath.
To me, the LUA scripting is the most useful. I'm looking at modeling individual turns on a ferrite inductor with 30 to 60 turns in the primary, six in the secondary, and looking at core loss, eddy current loss etc.
The scripting examples I have seen are not very clear and I don't think they are good teaching examples.
Here's how I create an object in LUA. I set my sim to millimeters and then define:
mm = 1
Inch = 25.4 -- so that I can dimension in native units like "CoreLen = (6 * Inch)" etc.
FRN and FRP are "FerriteRadiusNegative" (0 in the special case of the ferrite)
FLN and FLP are "FerriteLengthNegative" and "FerriteLengthPositive"
These describe the corners of the rectangle which will become the ferrite.
-- ASSIGN THE GROUPS -----------------------------------------------------------------------------------------------------
AirGroup = 0 -- Group 0 is air
FerriteGroup = 1 -- Group 1 is ferrite core
-- and so on.. for all your objects. Nothing special about the group numbers, could be 33 or 7.. It's just a tag.
-- Materials ---------------------------------------------------------------------------------------------------------------
FerriteMaterial = "Soft magnetic ferrite (Fe-Ni-Zn-V)" -- adjust as needed.
--FerriteMaterial = "Pure Iron" -- adjust as needed.
-- These names are pulled from the materials library
- This section just assigns "FerriteMaterial" the proper string value for use later.
----------------------------------------------------------------------------------------------------------------------------
-- Library materials used in this simulation -------------------------------------------------------------------------------
mi_getmaterial('Air')
mi_getmaterial(FerriteMaterial) -- Assigned to a library material or custom material above
--mi_modifymaterial can be used to change the BH curve etc.
----------------------------------------------------------------------------------------------------------------------------------
-- Create the ferrite core -------------------------------------------------------------------------------------------------
-- Define this first because the air size and label position is dependent on this
FerriteLen = (66 * mm)
FerriteDia = 12
FerriteRad = (FerriteDia/2)
FRN = 0 -- Ferrite Radius Negative (because the ferrite is on the axis of symmetry!)
FRP = FerriteRad -- Ferrite Radius Positive
FLN = (-1 * (FerriteLen/2)) -- Ferrite Length Negative
FLP = ( 1 * (FerriteLen/2)) -- Ferrite Length Positive
---------------------------------------------------------------------------------------------------------------------------
-- Define the ferrite core (Group 1) ---------------------------------------------------------------------------------
if (EnableFerriteCore > 0) then
print("Creating Ferrite Core") -- output to console for debug
-- Define where the label will go, insuring it's always inside the geometry.
FLAX =(FRP/2) -- Special case, because the ferrite is on the axis of symmetry
FLAY =(FLP/2) --
-- The label has to be inside the block, wherever you position the block.
-- Create the nodes for the corners
mi_addnode(FRN,FLP)
mi_addnode(FRP,FLP)
mi_addnode(FRP,FLN)
mi_addnode(FRN,FLN)
-- Select those nodes
mi_clearselected()
mi_selectnode(FRN,FLP)
mi_selectnode(FRP,FLP)
mi_selectnode(FRP,FLN)
mi_selectnode(FRN,FLN)
mi_setnodeprop('',FerriteGroup)
-- Everything needs a group number so you can manipulate as a group
-- Add the segments between the nodes
mi_addsegment (FRN,FLP,FRP,FLP) -- top
mi_addsegment (FRP,FLP,FRP,FLN) -- right
mi_addsegment (FRP,FLN,FRN,FLN) -- bottom
mi_addsegment (FRN,FLN,FRN,FLP) -- left
-- Now instead of just corner points we have corners and lines.
-- Set the segment properties
mi_clearselected()
mi_selectsegment (FRN,FLP,FRP,FLP)
mi_selectsegment (FRP,FLP,FRP,FLN)
mi_selectsegment (FRP,FLN,FRN,FLN)
mi_selectsegment (FRN,FLN,FRN,FLP)
mi_setsegmentprop('',0,0,0,FerriteGroup)
-- Now the lines are part of the group and FEMM will see this as an object
-- Create a label
mi_addblocklabel(FLAX,FLAY)
mi_clearselected()
mi_selectlabel(FLAX,FLAY)
mi_setblockprop(FerriteMaterial,AutoMeshCore,MeshSizeCore,0,0,FerriteGroup,0)
-- FerriteMaterial is a variable and could be "Air" to turn off the ferrite, or "Pure Iron" or any other material
-- in the library or that you care to define.
-- AutoMeshCore and MeshSizeCore are variables I added to control the meshing.
end -- EnableFerriteCore
mi_clearselected()
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist