Compare commits

..

3 commits

Author SHA1 Message Date
Stephan I. Böttcher
4269bba81a avr/leia: add 'n' → ports 2025-12-01 20:45:50 +01:00
Stephan I. Böttcher
a8d2f4c797 leia_stepper: VbiasD calibration 2025-12-01 20:28:04 +01:00
Stephan I. Böttcher
f7af6fb900 leia_stepper: fix .speed() 2025-12-01 20:23:46 +01:00
4 changed files with 38 additions and 5 deletions

1
.gitignore vendored
View file

@ -19,3 +19,4 @@ nm64file
mustang_scripts mustang_scripts
nm64/nm64 nm64/nm64
ahepam/seth ahepam/seth
leia/

2
avr

@ -1 +1 @@
Subproject commit 7ebd848bd2e58dc30c966ebf915f7ce6ff8e77df Subproject commit a7e45f235d59d5f8d815bf7daf9734e9ee0f2a2c

35
dorn.py
View file

@ -186,6 +186,25 @@ class DORN_CONFIG:
# ! change the class attribute .HK # ! change the class attribute .HK
self.HK[4] = ("HK PA", self.HK4_AHBGO, HK4_AHBGO_fmt) self.HK[4] = ("HK PA", self.HK4_AHBGO, HK4_AHBGO_fmt)
# calib 2025-11-25
Fluke_cal = 1/0.862
# SN2 dac, 14*HK3H, VbiasD
VbiasD_SN2 = [
[ 64, 0.51, 0.5 * Fluke_cal ],
[ 960, 1.85, 1.6 * Fluke_cal ],
[ 1984, 3.36, 2.9 * Fluke_cal ],
[ 4992, 7.85, 6.7 * Fluke_cal ],
[ 9984, 15.27, 13.1 * Fluke_cal ],
[ 14976, 22.56, 19.3 * Fluke_cal ],
[ 19968, 29.91, 25.6 * Fluke_cal ],
[ 20992, 31.42, 26.9 * Fluke_cal ],
[ 21440, 32.06, 27.5 * Fluke_cal ],
[ 21952, 32.83, 28.0 * Fluke_cal ],
[ 24960, 37.36, 28.6 * Fluke_cal ],
]
VbiasD_a = 0.033
VbiasD_b = 0.9918
HK3_LEIA = [[ HK3_LEIA = [[
("Tadc", (degC, {})), ("Tadc", (degC, {})),
("Vadc", 2.0), ("Vadc", 2.0),
@ -194,13 +213,13 @@ class DORN_CONFIG:
("Vss", 2.5, ("Vcc", -1.5)), ("Vss", 2.5, ("Vcc", -1.5)),
("Vcc", 2.0), ("Vcc", 2.0),
("Vbias2", -1/0.022 * 66.6/75.2), ("Vbias2", -1/0.022 * 66.6/75.2),
("VbiasD", -14.), ("VbiasD", -14 * VbiasD_b - VbiasD_a),
]] ]]
HK4_LEIA = [[ HK4_LEIA = [[
("IbiasD", 100., -1.4), ("IbiasD", 100., -1.4),
("VbiasG", 46.3, ("Vref", -45.3)), ("VbiasG", 46.3, ("Vref", -45.3)),
("Ibias2", 10470/470 * 51/1051 * 100, -65.0), ("Ibias2", 10470/470 * 51/1051 * 100, -71.0),
("Ibias1", 10470/470 * 51/1051 * 100, -52.0), ("Ibias1", 10470/470 * 51/1051 * 100, -52.0),
("Vbias1", -1/0.047 * 44.7/48.5), ("Vbias1", -1/0.047 * 44.7/48.5),
("Tpa0", (degC, {})), ("Tpa0", (degC, {})),
@ -686,3 +705,15 @@ def mem_op(addr=None, hist=None, bank=None, data=None, read=None, clear=None, ba
dorn_config(base+1, h, "mem data high") dorn_config(base+1, h, "mem data high")
dh = h dh = h
dorn_config(base, d & 0xffff, "mem data write") dorn_config(base, d & 0xffff, "mem data write")
def VbiasD(V):
a = 0.48
b = 95.97
if V < 0:
V = -V
if V>32:
raise valueError(f"VbiasD too large {V}V > 32V")
d = int(0x10000/b*(V-a) + 32)
if d<0:
d = 0
ecmd(f"v dac={d}", verb=True)

View file

@ -563,7 +563,8 @@ class leia_stepper:
period (float) in ms period (float) in ms
""" """
if period is None: if period is None:
return self.cmd('q') r = self.cmd('q')
return r, r*self.T1TICK
if isinstance(period, float): if isinstance(period, float):
period = int(period/self.T1TICK) - 1 period = int(period/self.T1TICK) - 1
if period < self.MIN_SPEED: if period < self.MIN_SPEED: