Skip to content

1D MFM Simulation #7

@WienerSchnitzel123

Description

@WienerSchnitzel123

Hi, for my bachelorthesis I am currently working on simulating the interaction between the magnetic field of striplines and the cantilever. Therefore I want to simulate the phase shift of the cantilever. I only have a 1 dimensional forcefield in x- direction and would like to simulate the cantilever moving in x direction over the striplines. I used your NaCl file as template and adjusted the forcefield interpollation and scan area accordingly. But something is not working out. Could you help me find the issue? For pll.df I only get a result looking like an oscillation, which changes with the resolution of the "image". If I use your NaClforces.dat pll.df looks good.
I'm currently using this forcefield:
Forces_calc3xy1.txt

and this is the code I'm using:

import sys
sys.path.append('/home/ubuntu/Documents/PythonAFM/src') 
#!/usr/bin/env python
from vafmcircuits import Machine
from customs_pll import *


def main():

	machine = Machine(machine=None, name='machine', dt=5.0e-8)



	canti = machine.AddCircuit(type='Cantilever',name='canti', startingz=1,
		Q=10000, k=167.0, f0=15000, pushed=True)

	machine.AddCircuit(type='waver',name='wave',freq=15000,amp=1)

	machine.AddCircuit(type="Machine",name='amp', fcut=10000, assembly=aAMPD, 
		pushed=True)
	

	machine.AddCircuit(type='PI', name='agc', Kp=1.1, Ki=800, set=1, pushed=True)
	machine.AddCircuit(type="limiter",name='agclim', min=0,max=10, pushed=True)
	
	machine.AddCircuit(type="Machine",name='pll', fcut=1000, assembly=aPLL, 
		filters=[10000,5000,2000], gain=600.0, f0=15000, Kp=0.5, Ki=700, 
		pushed=True)
	
	machine.AddCircuit(type='opMul',name='pllinv',in2=-1, pushed=True)
	machine.AddCircuit(type='opMul',name='exc', pushed=True)

	scanner = machine.AddCircuit(type='Scanner',name='scan', Process = machine, pushed=True)


	inter = machine.AddCircuit(type='i3Dlin',name='inter', components=3, pushed=True)
	inter.Configure(steps=[0.1,1,1], npoints=[40,1,1])
	inter.Configure(pbc=[False,True,True])
	inter.Configure(ForceMultiplier=1e10)
	inter.ReadData('Forces_calc3xy1.dat')




	
    #Outputs
	out1 = machine.AddCircuit(type='output',name='output',file='testafm.out', dump=2)
	out1.Register('global.time', 'canti.zabs','amp.norm','pll.cos','pll.sin','exc.in2')
	out1.Stop()

	out2 = machine.AddCircuit(type='output',name='output2',file='testafm2.out', dump=100)
	out2.Register('global.time', 'canti.ztip','agc.out','pll.df',"canti.fz")
	

	#Imaging output
	imager = machine.AddCircuit(type='output',name='image',file='NaCl.dat', dump=0)
	imager.Register("scan.x","scan.y","pll.df")	


    #feed x and y to interpolation
	machine.Connect("scan.x" , "inter.x")
	machine.Connect("scan.y" , "inter.y")
	machine.Connect("scan.z" , "canti.holderz")
	machine.Connect("canti.zabs" , "inter.z")

	#Force
	machine.Connect("inter.F3" , "canti.fz")	
	
	machine.Connect('canti.ztip','amp.signal')
	machine.Connect('amp.amp','agc.signal')
	machine.Connect('amp.norm','pll.signal1')
	machine.Connect('pll.sin','pll.signal2')
	
	machine.Connect('agc.out','agclim.signal')
	machine.Connect('agclim.out','exc.in1')
	machine.Connect('pll.sin','pllinv.in1')
	machine.Connect('pllinv.out','exc.in2')
	
	machine.Connect('exc.out','canti.exciter')

	machine.Connect("scan.record","image.record")	
	


	

	'''
	machine.Wait(0.01)
	out1.Start()
	machine.Wait(0.001)
	out1.Stop()
	machine.Wait(0.05)
	out1.Start()
	machine.Wait(0.001)
	'''

	scanner.Place(x=-21,y=1,z=1)
	machine.Wait(0.2)	

	scanner.Move(x=1,y=0,z=0)
	machine.Wait(1)	



		

	scanner.Recorder = imager
	scanner.BlankLines = True 
	#resolution of the image [# points per line, # lines]
	scanner.Resolution = [400,64]
	scanner.ImageArea(40,1)        
	#scan
	scanner.ScanArea()
	

if __name__ == '__main__':
        main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions