CREATE TABLE "robot_record" (
recreg character varying NOT NULL,
rects timestamp without time zone NOT NULL,
botcode character varying NOT NULL,
    PRIMARY KEY (recreg)
);

First 3 rows:
recreg    rects                       botcode
--------  --------------------------  ---------
RF100725  2025-02-19 00:10:46.275346  RB2073
RF506310  2025-02-18 08:48:23.275346  RB9067
RF422033  2025-02-18 12:20:12.276376  RB2996
...


CREATE TABLE "system_controller" (
systemoverseeractuation character varying NOT NULL,
systemoverseeroperation character varying NULL,
systemoverseerrobot character varying NULL,
controller_metrics jsonb NULL,
    PRIMARY KEY (systemoverseeractuation),
    FOREIGN KEY (systemoverseeractuation) REFERENCES actuation_data(actreg),
    FOREIGN KEY (systemoverseeroperation) REFERENCES operation(operreg),
    FOREIGN KEY (systemoverseerrobot) REFERENCES robot_details(botdetreg)
);

First 3 rows:
systemoverseeractuation    systemoverseeroperation    systemoverseerrobot    controller_metrics
-------------------------  -------------------------  ---------------------  -----------------------------------------------------------------------------------------------------------------------------
RF977036                   RF977036                   RF977036               {'load_value': 75.46, 'memory_usage': 63.97, 'thermal_level': 52.38, 'cabinet_humidity': 53.91, 'cabinet_temperature': 36.09}
RF616012                   RF616012                   RF616012               {'load_value': 18.8, 'memory_usage': 43.92, 'thermal_level': 31.23, 'cabinet_humidity': 61.66, 'cabinet_temperature': 44.21}
RF997271                   RF997271                   RF997271               {'load_value': 30.27, 'memory_usage': 69.84, 'thermal_level': 33.65, 'cabinet_humidity': 59.5, 'cabinet_temperature': 39.14}
...


CREATE TABLE "robot_details" (
botdetreg character varying NOT NULL,
mfgnameval character varying NULL,
modelseriesval character varying NULL,
bottypeval character NULL,
payloadcapkg numeric NULL,
reachmmval smallint NULL,
instdateval date NULL,
fwversionval character varying NULL,
ctrltypeval character varying NULL,
    PRIMARY KEY (botdetreg),
    FOREIGN KEY (botdetreg) REFERENCES robot_record(recreg)
);

First 3 rows:
botdetreg    mfgnameval    modelseriesval    bottypeval       payloadcapkg    reachmmval  instdateval    fwversionval    ctrltypeval
-----------  ------------  ----------------  -------------  --------------  ------------  -------------  --------------  -------------
RF100725     FANUC         Series_784        Delta                       5          1592  2023-06-10     9.6.6           Controller_C2
RF506310     Yaskawa       Series_892        Collaborative               5          1160  2022-09-14     3.3.7           Controller_C4
RF422033     Yaskawa       Series_525        Cartesian                 200          2374  2022-11-19     4.6.6           Controller_B5
...


CREATE TABLE "maintenance_and_fault" (
upkeepactuation character varying NOT NULL,
upkeepoperation character varying NULL,
upkeeprobot character varying NULL,
faultcodeval character varying NULL,
issuecategoryval character varying NULL,
issuelevelval character varying NULL,
faultpredscore real NULL,
faulttypeestimation character varying NULL,
rulhours integer NULL,
upkeepduedays smallint NULL,
upkeepcostest numeric NULL,
    PRIMARY KEY (upkeepactuation),
    FOREIGN KEY (upkeepactuation) REFERENCES actuation_data(actreg),
    FOREIGN KEY (upkeepoperation) REFERENCES operation(operreg),
    FOREIGN KEY (upkeeprobot) REFERENCES robot_details(botdetreg)
);

First 3 rows:
upkeepactuation    upkeepoperation    upkeeprobot    faultcodeval    issuecategoryval    issuelevelval      faultpredscore  faulttypeestimation      rulhours    upkeepduedays    upkeepcostest
-----------------  -----------------  -------------  --------------  ------------------  ---------------  ----------------  ---------------------  ----------  ---------------  ---------------
RF100725           RF100725           RF100725       E8902                               Low                         0.021  Motor                        1601               16          7299.59
RF506310           RF506310           RF506310                       Communication       High                        0.493  Joint                        4728              161          5236.28
RF422033           RF422033           RF422033                       Electrical          Medium                      0.69   Gearbox                      4309              135          7885.93
...


CREATE TABLE "operation" (
operreg character varying NOT NULL,
operbotdetref character varying NULL,
operrecref character varying NULL,
totopshrval numeric NULL,
apptypeval character varying NULL,
opermodeval character NULL,
currprogval character varying NULL,
progcyclecount integer NULL,
cycletimesecval numeric NULL,
axiscountval smallint NULL,
    PRIMARY KEY (operreg),
    FOREIGN KEY (operbotdetref) REFERENCES robot_details(botdetreg),
    FOREIGN KEY (operrecref) REFERENCES robot_record(recreg)
);

First 3 rows:
operreg    operbotdetref    operrecref      totopshrval  apptypeval    opermodeval    currprogval      progcyclecount    cycletimesecval    axiscountval
---------  ---------------  ------------  -------------  ------------  -------------  -------------  ----------------  -----------------  --------------
RF100725   RF100725         RF100725              43138  Assembly      Programming    PRG_8419                 177681              39.29               7
RF506310   RF506310         RF506310              34903  Painting      Maintenance    PRG_9097                 498231             211.82               6
RF422033   RF422033         RF422033               9861  Palletizing   Programming    PRG_4901                 508274              80.74               5
...


CREATE TABLE "performance_and_safety" (
effectivenessactuation character varying NOT NULL,
effectivenessoperation character varying NULL,
effectivenessrobot character varying NULL,
conditionindexval numeric NULL,
effectivenessindexval numeric NULL,
qualitymeasureval real NULL,
energyusekwhval numeric NULL,
pwrfactorval real NULL,
airpressval numeric NULL,
toolchangecount integer NULL,
toolwearpct real NULL,
safety_metrics jsonb NULL,
    PRIMARY KEY (effectivenessactuation),
    FOREIGN KEY (effectivenessactuation) REFERENCES actuation_data(actreg),
    FOREIGN KEY (effectivenessoperation) REFERENCES operation(operreg),
    FOREIGN KEY (effectivenessrobot) REFERENCES robot_details(botdetreg)
);

First 3 rows:
effectivenessactuation    effectivenessoperation    effectivenessrobot      conditionindexval    effectivenessindexval    qualitymeasureval    energyusekwhval    pwrfactorval    airpressval    toolchangecount    toolwearpct  safety_metrics
------------------------  ------------------------  --------------------  -------------------  -----------------------  -------------------  -----------------  --------------  -------------  -----------------  -------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RF806459                  RF806459                  RF806459                            0.708                     0.63                0.896              97.67           0.959           5.11                864          50.31  {'overloads': 5, 'collisions': 1, 'safety_state': 'Normal', 'emergency_stops': 3, 'zone_violations': 4, 'speed_violations': 10, 'calibration_state': 'Valid               '}
RF478822                  RF478822                  RF478822                            0.794                     0.56                0.24               75.64           0.845           6.76                464          86.9   {'overloads': 4, 'collisions': None, 'safety_state': 'Normal', 'emergency_stops': None, 'zone_violations': 4, 'speed_violations': 7, 'calibration_state': 'Due                 '}
RF196869                  RF196869                  RF196869                            0.407                     0.73                0.24               52.24           0.837           6.06                954          94.66  {'overloads': 1, 'collisions': 3, 'safety_state': 'Normal', 'emergency_stops': 3, 'zone_violations': 2, 'speed_violations': 10, 'calibration_state': 'Valid               '}
...


CREATE TABLE "joint_performance" (
jperfoperref character varying NULL,
jperfrecref character varying NULL,
jperfdetref character varying NULL,
joint_metrics jsonb NULL,
    FOREIGN KEY (jperfdetref) REFERENCES robot_details(botdetreg),
    FOREIGN KEY (jperfoperref) REFERENCES operation(operreg),
    FOREIGN KEY (jperfrecref) REFERENCES robot_record(recreg)
);

First 3 rows:
jperfoperref    jperfrecref    jperfdetref    joint_metrics
--------------  -------------  -------------  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RF100725        RF100725       RF100725       {'joint1': {'angle': -37.72, 'speed': 36.7, 'torque': 12.0}, 'joint2': {'angle': 177.36, 'speed': 65.06, 'torque': 79.88}, 'joint3': {'angle': 83.27, 'speed': 174.45, 'torque': 55.91}, 'joint4': {'angle': -151.1, 'speed': 96.65, 'torque': 75.22}, 'joint5': {'angle': -162.94, 'speed': 167.12, 'torque': 2.14}, 'joint6': {'angle': -72.08, 'speed': 69.94, 'torque': 45.07}}
RF506310        RF506310       RF506310       {'joint1': {'angle': -101.41, 'speed': 149.9, 'torque': 96.26}, 'joint2': {'angle': -102.61, 'speed': 169.96, 'torque': 51.7}, 'joint3': {'angle': -99.46, 'speed': 79.3, 'torque': 55.51}, 'joint4': {'angle': 27.54, 'speed': 127.46, 'torque': 5.63}, 'joint5': {'angle': -173.82, 'speed': 80.96, 'torque': 89.02}, 'joint6': {'angle': -79.11, 'speed': 41.42, 'torque': 72.09}}
RF422033        RF422033       RF422033       {'joint1': {'angle': -148.2, 'speed': 87.8, 'torque': 47.04}, 'joint2': {'angle': 176.99, 'speed': 134.13, 'torque': 49.17}, 'joint3': {'angle': 18.72, 'speed': 22.11, 'torque': 31.22}, 'joint4': {'angle': 90.83, 'speed': 7.6, 'torque': 6.7}, 'joint5': {'angle': 17.32, 'speed': 9.0, 'torque': 21.66}, 'joint6': {'angle': -24.51, 'speed': 86.84, 'torque': 34.4}}
...


CREATE TABLE "joint_condition" (
jcondoperref character varying NULL,
jcrecref character varying NULL,
jcdetref character varying NULL,
j1tempval numeric NULL,
j2tempval real NULL,
j3tempval numeric NULL,
j4tempval real NULL,
j5tempval numeric NULL,
j6tempval real NULL,
j1vibval numeric NULL,
j2vibval real NULL,
j3vibval real NULL,
j4vibval numeric NULL,
j5vibval real NULL,
j6vibval real NULL,
j1backval numeric NULL,
j2backval numeric NULL,
j3backval real NULL,
j4backval real NULL,
j5backval numeric NULL,
j6backval real NULL,
    FOREIGN KEY (jcdetref) REFERENCES robot_details(botdetreg),
    FOREIGN KEY (jcondoperref) REFERENCES operation(operreg),
    FOREIGN KEY (jcrecref) REFERENCES robot_record(recreg)
);

First 3 rows:
jcondoperref    jcrecref    jcdetref      j1tempval    j2tempval    j3tempval    j4tempval    j5tempval    j6tempval    j1vibval    j2vibval    j3vibval    j4vibval    j5vibval    j6vibval    j1backval    j2backval    j3backval    j4backval    j5backval    j6backval
--------------  ----------  ----------  -----------  -----------  -----------  -----------  -----------  -----------  ----------  ----------  ----------  ----------  ----------  ----------  -----------  -----------  -----------  -----------  -----------  -----------
RF100725        RF100725    RF100725          20.57        39.54        42.16        34.88        70.15        64.39       1.14        1.636       1.687       3.264       2.052       6.422       0.0352        0.027       0.0946       0.056        0.0907       0.046
RF506310        RF506310    RF506310          22.06        36.77        23.04        57.44        64.65        79.03       6.271       2.268       9.437       9.296       8.948       5.126       0.0995        0.067       0.0927       0.0269       0.0183       0.0941
RF422033        RF422033    RF422033          40.14        36.75        24.8         47.02        42.92        53.8        5.295       1.125       5.297       0.86        0.146       0.779       0.0968        0.019       0.0447       0.0974       0.0116       0.0868
...


CREATE TABLE "actuation_data" (
actreg character varying NOT NULL,
actoperref character varying NULL,
actdetref character varying NULL,
actrecref character varying NULL,
tcpxval numeric NULL,
tcpyval real NULL,
tcpzval real NULL,
tcp_rxval numeric NULL,
tcp_ryval real NULL,
tcp_rzval real NULL,
tcpspeedval numeric NULL,
tcpaccelval real NULL,
pathaccmmval numeric NULL,
poserrmmval real NULL,
orienterrdegval real NULL,
payloadwval numeric NULL,
payloadival real NULL,
m1currval numeric NULL,
m2currval real NULL,
m3currval real NULL,
m4currval numeric NULL,
m5currval real NULL,
m6currval real NULL,
m1voltval numeric NULL,
m2voltval real NULL,
m3voltval real NULL,
m4voltval numeric NULL,
m5voltval real NULL,
m6voltval real NULL,
    PRIMARY KEY (actreg),
    FOREIGN KEY (actdetref) REFERENCES robot_details(botdetreg),
    FOREIGN KEY (actoperref) REFERENCES operation(operreg),
    FOREIGN KEY (actrecref) REFERENCES robot_record(recreg)
);

First 3 rows:
actreg    actoperref    actdetref    actrecref      tcpxval    tcpyval    tcpzval    tcp_rxval    tcp_ryval    tcp_rzval    tcpspeedval    tcpaccelval    pathaccmmval    poserrmmval    orienterrdegval    payloadwval    payloadival    m1currval    m2currval    m3currval    m4currval    m5currval    m6currval    m1voltval    m2voltval    m3voltval    m4voltval    m5voltval    m6voltval
--------  ------------  -----------  -----------  ---------  ---------  ---------  -----------  -----------  -----------  -------------  -------------  --------------  -------------  -----------------  -------------  -------------  -----------  -----------  -----------  -----------  -----------  -----------  -----------  -----------  -----------  -----------  -----------  -----------
RF100725  RF100725      RF100725     RF100725       -105.98    -662.19    1023.44      -156.28      -150.3         -6.26        1231.14           6.65           0.797          0.069              0.471           1.98           1.78         1.36         8.61         3.31        14.16         6.16         1.76         1.26        15.66        10.6          9.13        28.47        32.12
RF506310  RF506310      RF506310     RF506310        655        726.58    1952.1       -153.02       153.21      -130.1         1923.65           2.02           0.835          0.493              0.365           0.83           8.7          6.58         3.11        10.97        16.01        14.88        13.27        46.58        43.21        38.36        13.53        40.07        30.29
RF422033  RF422033      RF422033     RF422033        426.2      873       1618.63      -133.16       -85.31       166.64         191.04           8.43           0.07           0.355              0.234         144.85           8.85        14.97        13.39        19.18         1.31         2.38         1.81        40.66         5.33        14.07        45.05        19.58        11.39
...


CREATE TABLE "mechanical_status" (
mechactref character varying NULL,
mechoperref character varying NULL,
mechdetref character varying NULL,
brk1statval character varying NULL,
brk2statval character varying NULL,
brk3statval character varying NULL,
brk4statval character varying NULL,
brk5statval character varying NULL,
brk6statval character varying NULL,
enc1statval character varying NULL,
enc2statval character varying NULL,
enc3statval character varying NULL,
enc4statval character varying NULL,
enc5statval character varying NULL,
enc6statval character varying NULL,
gb1tempval numeric NULL,
gb2tempval real NULL,
gb3tempval real NULL,
gb4tempval numeric NULL,
gb5tempval real NULL,
gb6tempval real NULL,
gb1vibval numeric NULL,
gb2vibval real NULL,
gb3vibval real NULL,
gb4vibval numeric NULL,
gb5vibval real NULL,
gb6vibval real NULL,
    FOREIGN KEY (mechactref) REFERENCES actuation_data(actreg),
    FOREIGN KEY (mechdetref) REFERENCES robot_details(botdetreg),
    FOREIGN KEY (mechoperref) REFERENCES operation(operreg)
);

First 3 rows:
mechactref    mechoperref    mechdetref    brk1statval    brk2statval    brk3statval    brk4statval    brk5statval    brk6statval    enc1statval    enc2statval    enc3statval    enc4statval    enc5statval    enc6statval      gb1tempval    gb2tempval    gb3tempval    gb4tempval    gb5tempval    gb6tempval    gb1vibval    gb2vibval    gb3vibval    gb4vibval    gb5vibval    gb6vibval
------------  -------------  ------------  -------------  -------------  -------------  -------------  -------------  -------------  -------------  -------------  -------------  -------------  -------------  -------------  ------------  ------------  ------------  ------------  ------------  ------------  -----------  -----------  -----------  -----------  -----------  -----------
RF100725      RF100725       RF100725      Normal         Error          Normal         Warning        Warning        Normal         Warning        Error          Normal         Normal         Normal         Normal                24.92         21.86         56.76         35.39         60.72         48.18        3.273        1.912        4.821        5.302        7.001        5.74
RF506310      RF506310       RF506310      Warning        Warning        Error          Warning        Warning        Warning        Warning        Warning        Error          Error          Normal         Warning               70.89         79.14         25.94         24            60.1          41.26        9.278        5.005        1.995        9.881        0.224        4.942
RF422033      RF422033       RF422033      Normal         Warning        Normal         Normal         Warning        Error          Normal         Error          Normal         Warning        Warning        Warning               68.57         26.55         36.3          53.52         71            22.96        8.652        8.889        2.674        5.214        5.057        5.418
...
