summaryrefslogtreecommitdiffhomepage
path: root/digital/asserv/tools/step.py
blob: b9f798ef2c1ac2766bc76cdc8ce202cfd6ffb3c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import Gnuplot

import asserv
from utils.init_proto import init_proto

def step (name, offset, kp, ki, kd, plots, **param):
    p = { name + 'kp': kp, name + 'ki': ki, name + 'kd': kd}
    p.update (param)
    a = init_proto (None, asserv.Proto, init = p)
    a.stats (*plots)
    a.consign (name, offset)
    #a.speed (name, 16)
    array = a.get_stats (225)
    a.close ()

    g = Gnuplot.Gnuplot (persist = True)
    g ('set data style lines')
    g.plot (*[array[:, i] for i in xrange (len (plots))])

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)