From 9db8edadcb71c67526fb34cd5c11a174608e875b Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Mon, 28 Apr 2008 15:31:37 +0200 Subject: * digital/asserv/tools: - tuned arm PID. --- digital/asserv/tools/init.py | 8 ++++---- digital/asserv/tools/step.py | 15 +++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'digital/asserv') diff --git a/digital/asserv/tools/init.py b/digital/asserv/tools/init.py index 05aa8e6b..9a2c1b6c 100644 --- a/digital/asserv/tools/init.py +++ b/digital/asserv/tools/init.py @@ -5,14 +5,14 @@ host = dict ( a0p = 1, a0d = 16, E = 0x3ff, D = 0x1ff, ta = 0.5, aa = 0.5, tsm = 0x60, tss = 0x40, asm = 0x60, ass = 0x40, - a0a = 0.5, a0sm = 0x10, a0ss = 0x10, + a0a = 0.5, a0sm = 0x10, a0ss = 0x05, ) target = dict ( scale = 0.0413359788359788, f = 0xcf9, c = float (0x100adec) / (1 << 24), tkp = 1, tkd = 16, akp = 2, akd = 16, - a0p = 1, a0d = 16, - E = 0x3ff, D = 0x1ff, + a0p = 0.8, a0i = 0.05, a0d = 0.05, + E = 0x3ff, D = 0x1ff, I = 0x1fff, ta = 0.5, aa = 0.5, tsm = 0x60, tss = 0x40, asm = 0x60, ass = 0x40, - a0a = 0.5, a0sm = 0x10, a0ss = 0x10, + a0a = 0.5, a0sm = 0x10, a0ss = 0x05, ) diff --git a/digital/asserv/tools/step.py b/digital/asserv/tools/step.py index addc1ddd..5b87d5cd 100644 --- a/digital/asserv/tools/step.py +++ b/digital/asserv/tools/step.py @@ -6,14 +6,17 @@ import popen_io import serial import Gnuplot -def step (name, kp, ki, kd, plots): +def step (name, offset, kp, ki, kd, plots, **param): if sys.argv[1] == '!': io = popen_io.PopenIO (sys.argv[2:]) else: io = serial.Serial (sys.argv[1]) - a = Asserv (io, **{ name + 'kp': kp, name + 'ki': ki, name + 'kd': kd}) + p = { name + 'kp': kp, name + 'ki': ki, name + 'kd': kd} + p.update (param) + a = Asserv (io, **p) a.stats (*plots) - a.consign (name, 0x200) + a.consign (name, offset) + #a.speed (name, 16) array = a.get_stats (225) a.close () @@ -21,6 +24,6 @@ def step (name, kp, ki, kd, plots): g ('set data style lines') g.plot (*[array[:, i] for i in xrange (len (plots))]) -step ('t', 1, 0, 16, ('te', 'lw', 'rw')) -#step ('a', 1, 0, 16, ('ae', 'lw', 'rw')) -#step ('a0', 1, 0, 16, ('a0e', 'a0w')) +step ('t', 0x200, 1, 0, 16, ('te', 'lw', 'rw')) +#step ('a', 0x200, 1, 0, 16, ('ae', 'lw', 'rw')) +#step ('a0', 100, 0.8, 0.05, 0.05, ('a0e', 'a0w', 'a0i'), I = 8191) -- cgit v1.2.3