Skip to content

Commit

Permalink
- removes pid.reset() on setPid(p,i,d) again
Browse files Browse the repository at this point in the history
- updates Santoker Cube p-i-d values
- updates Ikawa proto
- improves IMF RM control setup
  • Loading branch information
MAKOMO committed Jan 30, 2025
1 parent c0082f2 commit 112e23d
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 66 deletions.
3 changes: 2 additions & 1 deletion src/artisanlib/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -2740,6 +2740,7 @@ def updateAmbientTemp(self) -> None:
# 10.0 => 90
# 1.1 => 1
# 1.0 => 0
# 0.5 => 0
# 0 => 0
# -1.0 => 0
# -1.1 => -1
Expand Down Expand Up @@ -12377,7 +12378,7 @@ def calc_meter_read(_start:float, _end:float) -> float:
if _end >= _start: # No rollover
return _end - _start
# Rollover occurred
return (rollover_threshold - _start + _end)
return rollover_threshold - _start + _end

# Read meters
self.meterreads = self.meterreads_default.copy() # init to zero in case of an exception
Expand Down
3 changes: 1 addition & 2 deletions src/artisanlib/ikawa.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def extractProfileIkawaURL(url:QUrl, aw:'ApplicationWindow') -> 'ProfileData':


res['title'] = ikawa_profile.name
res['beans'] = ikawa_profile.coffee_name
# res['beans'] = ikawa_profile.coffee_name # NOTE: as this is often not set and if set the received data is garbage, we deactivate this for now
res['mode'] = 'C'

timeindex = [0,0,0,0,0,0,len(timex)-1,0]
Expand Down Expand Up @@ -148,7 +148,6 @@ def extractProfileIkawaURL(url:QUrl, aw:'ApplicationWindow') -> 'ProfileData':
res['specialeventsStrings'] = specialeventsStrings

res['etypes'] = aw.qmc.etypesdefault

return res


Expand Down
4 changes: 2 additions & 2 deletions src/artisanlib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ def __init__(self, parent:Optional[QWidget] = None, *, locale:str, WebEngineSupp
self.block_quantification_sampling_ticks:List[int] = [0,0,0,0]
# by default we block quantification for sampling_ticks_to_block_quantifiction sampling intervals after
# a button/slider event
self.sampling_seconds_to_block_quantifiction:Final[int] = 15
self.sampling_seconds_to_block_quantifiction:Final[int] = 45
self.sampling_ticks_to_block_quantifiction:int = self.blockTicks()

self.extraeventsactionslastvalue:List[Optional[int]] = [None,None,None,None] # the last value to be used for relative +- button action as base
Expand Down Expand Up @@ -4165,7 +4165,7 @@ def __init__(self, parent:Optional[QWidget] = None, *, locale:str, WebEngineSupp
self.updateMessageLogSignal.connect(self.updateMessageLog)
self.updateSerialLogSignal.connect(self.updateSerialLog)
self.updateErrorLogSignal.connect(self.updateErrorLog)
self.establishQuantifiedEventSignal.connect(self.establishQuantifiedEventSlot)
self.establishQuantifiedEventSignal.connect(self.establishQuantifiedEventSlot, type=Qt.ConnectionType.QueuedConnection) # type: ignore
self.updateExtraEventButtonsVisibilitySignal.connect(self.update_extraeventbuttons_visibility)
self.realignButtonsSignal.connect(self.realignbuttons)
self.loadAlarmsSignal.connect(self.loadAlarms, type=Qt.ConnectionType.QueuedConnection) # type: ignore
Expand Down
1 change: 0 additions & 1 deletion src/artisanlib/pid.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def setPID(self, p:float, i:float, d:float) -> None:
finally:
if self.pidSemaphore.available() < 1:
self.pidSemaphore.release(1)
self.reset()

def setLimits(self, outMin:int, outMax:int) -> None:
try:
Expand Down
9 changes: 5 additions & 4 deletions src/artisanlib/pid_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0) ->
pidSetPID.clicked.connect(self.pidConf)
pidSetPID.setFocusPolicy(Qt.FocusPolicy.NoFocus)


pidGrid = QGridLayout()
pidGrid.addWidget(pidKpLabel,0,0)
pidGrid.addWidget(self.pidKp,0,1)
Expand All @@ -118,8 +117,9 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0) ->

pidCycleBox = QHBoxLayout()
pidCycleBox.addStretch()
pidCycleBox.addWidget(pidCycleLabel)
pidCycleBox.addWidget(self.pidCycle)
if pid_controller != 4:
pidCycleBox.addWidget(pidCycleLabel)
pidCycleBox.addWidget(self.pidCycle)
pidCycleBox.addStretch()

pidSetBox = QHBoxLayout()
Expand Down Expand Up @@ -184,7 +184,8 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0) ->
pidVBox.addLayout(pidSetBox)
pidVBox.setAlignment(pidSetBox,Qt.AlignmentFlag.AlignRight)

pidGridVBox.addLayout(pidGrid)
if pid_controller != 4:
pidGridVBox.addLayout(pidGrid)
pidGridBox = QHBoxLayout()
pidGridBox.addLayout(pidGridVBox)
pidGridBox.addLayout(pidVBox)
Expand Down
101 changes: 51 additions & 50 deletions src/includes/Machines/IMF/RM_control.aset

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/includes/Machines/Santoker/Cube_Bluetooth.aset
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ dutyMin=-100
dutySteps=1
invertControl=false
pOnE=true
pidKd=0.9
pidKi=0.08
pidKp=3
pidKp=1.0
pidKi=0.06
pidKd=5
pidNegativeTarget=0
pidPositiveTarget=4
pidSource=1
Expand Down
16 changes: 13 additions & 3 deletions src/proto/IkawaCmd_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 112e23d

Please sign in to comment.