uniax, version 7.10.2021

- driving with a generator
- 3 phases
  1) find active range (low current, far movement until force over hysteresis)
  2) release force until well below target
  3) adjusting using pid_p. (this is in fact an integral factor)
This commit is contained in:
2021-10-08 08:53:22 +02:00
parent 2c6b42f2aa
commit 57082e276f
5 changed files with 211 additions and 84 deletions

View File

@ -56,12 +56,14 @@ import os
import json
from secop.lib import getGeneralConfig
from secop.datatypes import EnumType
from secop.params import Parameter, Property, BoolType, Command
from secop.modules import HasAccessibles
class PersistentParam(Parameter):
persistent = Property('persistence flag', BoolType(), default=True)
persistent = Property('persistence flag (auto means: save automatically on any change)',
EnumType(off=0, on=1, auto=2), default=1)
class PersistentMixin(HasAccessibles):
@ -73,8 +75,12 @@ class PersistentMixin(HasAccessibles):
self.initData = {}
for pname in self.parameters:
pobj = self.parameters[pname]
if not pobj.readonly and getattr(pobj, 'persistent', False):
if not pobj.readonly and getattr(pobj, 'persistent', 0):
self.initData[pname] = pobj.value
if pobj.persistent == 'auto':
def cb(value, m=self):
m.saveParameters()
self.valueCallbacks[pname].append(cb)
self.writeDict.update(self.loadParameters(write=False))
def loadParameters(self, write=True):