Neuromorphic Control¶
Spike-domain control theory primitives. Gains are synaptic weights, integration is membrane dynamics.
SpikingPID— Population-coded PID controller. Error → rate-coded spike populations → P/I/D channels → control output. (Stagsted 2020, RSS)SpikingKalmanFilter— State estimation with spike-compatible dynamics. Predict + update cycle, Kalman gain as weight matrix.SpikingLQR— Linear Quadratic Regulator. Optimal gain computed via discrete algebraic Riccati equation.u = -K @ x. (SNN-LQR-EMSIF, Nature Scientific Reports 2025)
from sc_neurocore.control import SpikingPID, SpikingKalmanFilter, SpikingLQR
See Tutorial 79: Neuromorphic Control for usage examples.
sc_neurocore.control.controllers
¶
Spike-domain control: PID, Kalman filter, LQR.
All controllers use population-coded spike representations. Gains are synaptic weights, integration is membrane dynamics. No SNN library provides control-theory primitives.
Stagsted et al. 2020 (RSS) — spiking PID on Loihi
SNN-LQR-EMSIF (Nature Scientific Reports 2025)
SpikingPID
¶
Population-coded PID controller.
Error → rate-coded spike populations → P/I/D populations → output current. Gains are synaptic weights.
Parameters¶
Kp, Ki, Kd : float PID gains (encoded as synaptic weights). n_neurons : int Population size per channel. dt : float Timestep.
Source code in src/sc_neurocore/control/controllers.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
step(error)
¶
Compute PID output for one timestep.
Parameters¶
error : float Setpoint - measurement.
Returns¶
float — control output
Source code in src/sc_neurocore/control/controllers.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
step_spike(error, rng=None)
¶
Compute PID output as spike population.
Returns binary spike vector of shape (3 * n_neurons,) representing [P_population, I_population, D_population].
Source code in src/sc_neurocore/control/controllers.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
SpikingKalmanFilter
¶
Spike-domain Kalman filter for state estimation.
State prediction and correction using LIF-based integration. Kalman gain encoded as synaptic weight matrix.
Parameters¶
n_states : int State dimension. n_measurements : int Measurement dimension. A : ndarray State transition matrix. H : ndarray Observation matrix. Q : ndarray Process noise covariance. R : ndarray Measurement noise covariance.
Source code in src/sc_neurocore/control/controllers.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
predict()
¶
Predict step: x = A @ x, P = A @ P @ A^T + Q.
Source code in src/sc_neurocore/control/controllers.py
139 140 141 142 143 | |
update(z)
¶
Update step with measurement z.
Source code in src/sc_neurocore/control/controllers.py
145 146 147 148 149 150 151 152 | |
step(z)
¶
Predict + update in one call.
Source code in src/sc_neurocore/control/controllers.py
154 155 156 157 | |
SpikingLQR
¶
Spike-domain Linear Quadratic Regulator.
Computes optimal gain K from system matrices (A, B, Q, R). Control law: u = -K @ x. Weights derived analytically.
Parameters¶
A : ndarray (n, n) — state transition B : ndarray (n, m) — control input Q : ndarray (n, n) — state cost R : ndarray (m, m) — control cost
Source code in src/sc_neurocore/control/controllers.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
control(x)
¶
Compute optimal control: u = -K @ x.
Source code in src/sc_neurocore/control/controllers.py
206 207 208 | |