!   TITLE:  assy_brake.mac (G200)
!
!---------------------------------------------------------------------------
!       Rev -   02/03/2006      D. Edwards
!---------------------------------------------------------------------------
!
!   This macro creates the hub and armature plate assembly for computing
!   the radial spring rate of the armature plate.
!
!               Electroid Power-Off Brake P/N REPMFSB-5-10V-L
!
!   Parts for assembly:
!
!       bspring.mac     bspring1.parm   (spr1)     P/N: 
!       bspring.mac     bspring2.parm   (spr2)     P/N: 
!       armature.mac    armature.parm   (arm)
!       hub.mac         hub.parm        (hub)
!       
!
clear_start_new
tstart
!
!******************************* Model Assembly ***************************
!
! Select one of the following case numbers:
!
!   1 = Loading due to linear acceleration
!   2 = Loading due to angular velocity and acceleration
!   3 = Displaced armature plate to simulate contact with housing
!
case=3
!
*if,case,eq,1,then

/title, Electroid Spring Assembly - Linear Acceleration Loading

*elseif,case,eq,2,then

/title, Electroid Spring Assembly - Angular Velocity and Acceleration Loading

*elseif,case,eq,3,then

ecc=.011
/title, Electroid Spring Assembly - Armature Plate Displaced %ecc%

*endif



!---------------------------- Part Building ------------------------------
!
bspring,1,,,'bspring1.parm'
finalize_model

bspring,,,,'bspring2.parm'
finalize_model

armature_plate

!
!---------------------------- Constraints ---------------------------------
!

!---------------------------------------------------------------------------
! Attach the springs to the armature plate at the 12 and 6 o'clock positions
! when viewing the brake from the end of the motor after taking the rear cover
! off.
!
create_cs,2,'CS12_1',1,0,rholes
!
alls
nsle,s,corner
nsel,r,loc,x,d_rivet/2
nrotat,all
!
cpintf,ux
cpintf,uz


create_cs,2,'CS06_1',1,0,-rholes
!
alls
nsle,s   !,corner
nsel,r,loc,x,d_rivet/2
nrotat,all
!
cpintf,ux
cpintf,uz
!
!---------------------------------------------------------------------------


!---------------------------------------------------------------------------
! Fix all DOFs at the 3 and 9 o'clock rivets that attach to the hub
!
create_cs,2,'CS03_1',1,rholes,0

nsel,s,loc,x,d_rivet/2

nrotat,all

d,all,ux,0,,,,uz


create_cs,2,'CS09_1',1,-rholes,0

nsel,s,loc,x,d_rivet/2

nrotat,all

d,all,ux,0,,,,uz
!
!---------------------------------------------------------------------------

!---------------------------------------------------------------------------
! Displace Armature Plate for case #3
!
*if,case,eq,3,then
csys,1
nsel,s,loc,x,OD/2

csys,0
d,all,ux,ecc

*endif

alls

fini
!
!---------------------------- Solve ------------------------------
!

!*do,a_mag,0,360,15

/sol

*if,case,eq,1,then

a_mag=2.3e4
a_angle=45

avx=a_mag*cos(a_angle)
avy=a_mag*sin(a_angle)

acel,a_mag,0           ! [in/s^2] Applied acceleration (x,y,z)
acel,avx,avy

*elseif,case,eq,2,then

omega,,,1382            ! [rad/s] Angular velocity
domega,,,-4.3e4          ! [rad/s^2] Angular acceleration

*endif

solve

fini

tstop

!
!---------------------------- Post Processing ------------------------------
!
/post1


! Notes:  Parts can easily be selected by real numbers
!   1 = Spring #1
!   2 = Spring #2
!   3 = Armature Plate
!

esel,s,real,,3
plnsol,u,sum,2,1.0

/eof
esel,s,real,,1
plnsol, s,eqv, 2,1.0