Compare commits

...

2 commits

Author SHA1 Message Date
Rahix c7f94c7141 succbone: Update README
All checks were successful
/ test (push) Successful in 10s
/ test (pull_request) Successful in 10s
2025-01-06 00:31:01 +00:00
hmelder 26d297dcd3 succd: Do not exit prematurely if modbus connections fails
All checks were successful
/ test (pull_request) Successful in 10s
/ test (push) Successful in 11s
2025-01-06 00:28:52 +00:00
4 changed files with 37 additions and 27 deletions

View file

@ -13,3 +13,24 @@ succbone is our "automation" system for the vacuum system of the SEM.
- Signal two different vacuum levels to the original evacuation controller - Signal two different vacuum levels to the original evacuation controller
* Rough vacuum reached * Rough vacuum reached
* High vacuum reached * High vacuum reached
- Diffusion pump temperature monitoring via three PT100 sensors
- Environmental temperature & humidity monitoring (external sensor)
### Device Overview
These are the main devices powering the succbone control system. For details,
please check the wiring diagrams in [`panel.pdf`](./panel.pdf).
- `-KEB1`: BeagleBone as main control system with addonboard for PSU & analog 0-10V readout
- `-KED1`: MikroTik RB450G router as gateway to the outside and network switch
- `-KED2`: MODBUS-TCP to MODBUS-RTU bridge
- `-KEC1`: MODBUS-RTU 8x relay output and 8x digital input board
- `-KEC2`: MODBUS-RTU 8x PT100 500°C transmitter
- `-BTA1`: MODBUS-RTU environmental temperature & humidity sensor
- `-QAA1`: Contactor for the roughing pump interlock
- `-QAA2`: Contactor for the diffusion pump interlock
### 3D-Printed Components
- [DIN-rail mount for the BeagleBone](https://www.printables.com/model/1058768-beaglebone-din-mount)
- [DIN-rail mount for the MikroTik RB450G]
- (legacy: [DIN-rail mount for relay board](https://www.printables.com/model/1019947-relay-board-din-rail-mount))
- [Cable Strain Relief Plates](https://www.printables.com/model/932070-parametric-cable-strain-relief-plate)

BIN
succbone/succbone-control-panel.jpg (Stored with Git LFS)

Binary file not shown.

View file

@ -6,7 +6,9 @@ import (
"net/http" "net/http"
"os" "os"
"os/signal" "os/signal"
"time"
"github.com/simonvetter/modbus"
"k8s.io/klog" "k8s.io/klog"
) )
@ -55,9 +57,19 @@ func main() {
} }
d.adcPirani = adc d.adcPirani = adc
err = d.modbusConnect() // Setup modbus client
d.modbusClient, err = modbus.NewClient(&modbus.ClientConfiguration{
URL: "tcp://10.250.241.20:8887",
Timeout: 1 * time.Second,
})
if err != nil { if err != nil {
klog.Exitf("Failed to connect to modbus %v", err) klog.Exitf("Failed to setup modbus client %v", err)
}
// Connect to modbus client
err = d.modbusClient.Open()
if err != nil {
klog.Warningf("Failed to connect to modbus TCP %v", err)
} }
} }

View file

@ -12,29 +12,6 @@ func modbusValuesToFloat(v uint16) float32 {
return float32(v) / 10.0 return float32(v) / 10.0
} }
func (d *daemon) modbusConnect() error {
var err error
d.mu.Lock()
defer d.mu.Unlock()
// Setup modbus client
d.modbusClient, err = modbus.NewClient(&modbus.ClientConfiguration{
URL: "tcp://10.250.241.20:8887",
Timeout: 1 * time.Second,
})
if err != nil {
return err
}
// Connect to modbus client
err = d.modbusClient.Open()
if err != nil {
return err
}
return nil
}
func (d *daemon) modbusRestart() error { func (d *daemon) modbusRestart() error {
d.modbusClient.Close() d.modbusClient.Close()
return d.modbusClient.Open() return d.modbusClient.Open()