update gen draft
This commit is contained in:
1284
draft02-gen.dia
Normal file
1284
draft02-gen.dia
Normal file
File diff suppressed because it is too large
Load Diff
163
draft02-gen.svg
Normal file
163
draft02-gen.svg
Normal file
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd">
|
||||
<svg width="47cm" height="40cm" viewBox="76 -50 934 781" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g>
|
||||
<rect style="fill: #c2cee4" x="154.6" y="-12" width="142.4" height="77"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="154.6" y="-12" width="142.4" height="77"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="225.8" y="31.35">
|
||||
<tspan x="225.8" y="31.35">IMU DRV</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="293.4" y="61.4"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ccede2" x="374.4" y="205.1" width="145.6" height="66.9"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="374.4" y="205.1" width="145.6" height="66.9"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="447.2" y="243.4">
|
||||
<tspan x="447.2" y="243.4">CORRELATOR</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="516.4" y="268.4"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ccede2" x="582.4" y="160.1" width="120.6" height="74.9"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="582.4" y="160.1" width="120.6" height="74.9"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="642.7" y="202.4">
|
||||
<tspan x="642.7" y="202.4">AZIMUT CALC</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="699.4" y="231.4"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #c2cee4" x="643" y="38" width="124.2" height="71.1"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="643" y="38" width="124.2" height="71.1"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="705.1" y="78.4">
|
||||
<tspan x="705.1" y="78.4">GPS DRV</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="763.6" y="105.5"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="225.8,65 225.8,81.05 302.64,81.05 302.64,87.3639 "/>
|
||||
<polygon style="fill: #000000" points="302.64,94.8639 297.64,84.8639 302.64,87.3639 307.64,84.8639 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="302.64,94.8639 297.64,84.8639 302.64,87.3639 307.64,84.8639 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="582.4,197.55 551.2,197.55 551.2,238.55 529.736,238.55 "/>
|
||||
<polygon style="fill: #000000" points="522.236,238.55 532.236,233.55 529.736,238.55 532.236,243.55 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="522.236,238.55 532.236,233.55 529.736,238.55 532.236,243.55 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="705.1,109.1 705.1,134.6 630.64,134.6 630.64,150.364 "/>
|
||||
<polygon style="fill: #000000" points="630.64,157.864 625.64,147.864 630.64,150.364 635.64,147.864 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="630.64,157.864 625.64,147.864 630.64,150.364 635.64,147.864 "/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ccede2" x="467" y="315" width="132.6" height="74.9"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="467" y="315" width="132.6" height="74.9"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="533.3" y="357.3">
|
||||
<tspan x="533.3" y="357.3">POS CONV</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="596" y="386.3"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="447.2,272 447.2,293.5 520.04,293.5 520.04,305.264 "/>
|
||||
<polygon style="fill: #000000" points="520.04,312.764 515.04,302.764 520.04,305.264 525.04,302.764 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="520.04,312.764 515.04,302.764 520.04,305.264 525.04,302.764 "/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #d8e5e5" x="553.4" y="428.85" width="141.6" height="68.15"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="553.4" y="428.85" width="141.6" height="68.15"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="624.2" y="467.775">
|
||||
<tspan x="624.2" y="467.775">NAVIGATOR</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="691.4" y="493.4"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ccede2" x="252.4" y="97.1" width="125.6" height="73.9"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="252.4" y="97.1" width="125.6" height="73.9"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="315.2" y="138.9">
|
||||
<tspan x="315.2" y="138.9">LQ FILTER</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="374.4" y="167.4"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="315.2,171 315.2,188.05 432.64,188.05 432.64,195.364 "/>
|
||||
<polygon style="fill: #000000" points="432.64,202.864 427.64,192.864 432.64,195.364 437.64,192.864 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="432.64,202.864 427.64,192.864 432.64,195.364 437.64,192.864 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="533.3,389.9 533.3,409.375 610.04,409.375 610.04,419.114 "/>
|
||||
<polygon style="fill: #000000" points="610.04,426.614 605.04,416.614 610.04,419.114 615.04,416.614 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="610.04,426.614 605.04,416.614 610.04,419.114 615.04,416.614 "/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #c2cee4" x="756" y="368" width="131.6" height="80"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="756" y="368" width="131.6" height="80"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="821.8" y="412.85">
|
||||
<tspan x="821.8" y="412.85">RX DRV</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="884" y="444.4"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="756,408 725.5,408 725.5,462.925 704.736,462.925 "/>
|
||||
<polygon style="fill: #000000" points="697.236,462.925 707.236,457.925 704.736,462.925 707.236,467.925 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="697.236,462.925 707.236,457.925 704.736,462.925 707.236,467.925 "/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #ccede2" x="637.4" y="533.6" width="124.6" height="80.4"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="637.4" y="533.6" width="124.6" height="80.4"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="699.7" y="578.65">
|
||||
<tspan x="699.7" y="578.65">OUT MIXER</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="758.4" y="610.4"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="624.2,497 624.2,515.3 687.24,515.3 687.24,523.864 "/>
|
||||
<polygon style="fill: #000000" points="687.24,531.364 682.24,521.364 687.24,523.864 692.24,521.364 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="687.24,531.364 682.24,521.364 687.24,523.864 692.24,521.364 "/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #dbe6eb" x="771" y="643" width="120" height="80"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="771" y="643" width="120" height="80"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="831" y="687.85">
|
||||
<tspan x="831" y="687.85">SERVO DRV</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="887.4" y="719.4"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect style="fill: #dbe6eb" x="571" y="646" width="120" height="80"/>
|
||||
<rect style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" x="571" y="646" width="120" height="80"/>
|
||||
<text font-size="12.8" style="fill: #000000;text-anchor:middle;font-family:sans-serif;font-style:normal;font-weight:700" x="631" y="690.85">
|
||||
<tspan x="631" y="690.85">MOTOR DRV</tspan>
|
||||
</text>
|
||||
<text font-size="9.6" style="fill: #000000;text-anchor:end;font-family:sans-serif;font-style:normal;font-weight:700" x="687.4" y="722.4"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="720.467,614 720.467,628.5 819,628.5 819,633.264 "/>
|
||||
<polygon style="fill: #000000" points="819,640.764 814,630.764 819,633.264 824,630.764 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="819,640.764 814,630.764 819,633.264 824,630.764 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="678.933,614 678.933,630 619,630 619,636.264 "/>
|
||||
<polygon style="fill: #000000" points="619,643.764 614,633.764 619,636.264 624,633.764 "/>
|
||||
<polygon style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="619,643.764 614,633.764 619,636.264 624,633.764 "/>
|
||||
</g>
|
||||
<g>
|
||||
<ellipse style="fill: #ffffff" cx="1001" cy="-29" rx="8" ry="8"/>
|
||||
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="1001" cy="-29" rx="8" ry="8"/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="995.343,-23.3431 1001,-29 1006.66,-23.3431 "/>
|
||||
<path style="fill: #000000" d="M 995.343 -34.6569 C 995.343,-34.6569 997.416,-37 1001,-37 C 1004.58,-37 1006.66,-34.6569 1006.66,-34.6569 L 1001,-29 L 995.343,-34.6569z"/>
|
||||
<path style="fill: none; fill-opacity:0; stroke-width: 0.002; stroke: #000000" d="M 995.343 -34.6569 C 995.343,-34.6569 997.416,-37 1001,-37 C 1004.58,-37 1006.66,-34.6569 1006.66,-34.6569 L 1001,-29 L 995.343,-34.6569"/>
|
||||
</g>
|
||||
<g>
|
||||
<ellipse style="fill: #ffffff" cx="85.425" cy="-40.875" rx="7.725" ry="7.725"/>
|
||||
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="85.425" cy="-40.875" rx="7.725" ry="7.725"/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="79.9626,-35.4126 85.425,-40.875 90.8874,-35.4126 "/>
|
||||
<path style="fill: #000000" d="M 79.9626 -46.3374 C 79.9626,-46.3374 81.964,-48.6 85.425,-48.6 C 88.886,-48.6 90.8874,-46.3374 90.8874,-46.3374 L 85.425,-40.875 L 79.9626,-46.3374z"/>
|
||||
<path style="fill: none; fill-opacity:0; stroke-width: 0.002; stroke: #000000" d="M 79.9626 -46.3374 C 79.9626,-46.3374 81.964,-48.6 85.425,-48.6 C 88.886,-48.6 90.8874,-46.3374 90.8874,-46.3374 L 85.425,-40.875 L 79.9626,-46.3374"/>
|
||||
</g>
|
||||
<g>
|
||||
<ellipse style="fill: #ffffff" cx="103.425" cy="721.925" rx="7.925" ry="7.925"/>
|
||||
<ellipse style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" cx="103.425" cy="721.925" rx="7.925" ry="7.925"/>
|
||||
<polyline style="fill: none; fill-opacity:0; stroke-width: 2; stroke: #000000" points="97.8212,727.529 103.425,721.925 109.029,727.529 "/>
|
||||
<path style="fill: #000000" d="M 97.8212 716.321 C 97.8212,716.321 99.8744,714 103.425,714 C 106.976,714 109.029,716.321 109.029,716.321 L 103.425,721.925 L 97.8212,716.321z"/>
|
||||
<path style="fill: none; fill-opacity:0; stroke-width: 0.002; stroke: #000000" d="M 97.8212 716.321 C 97.8212,716.321 99.8744,714 103.425,714 C 106.976,714 109.029,716.321 109.029,716.321 L 103.425,721.925 L 97.8212,716.321"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 13 KiB |
60
mculoop/mixer.c
Normal file
60
mculoop/mixer.c
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2022 Oleg Borodin <borodin@unix7.org>
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <mixer.h>
|
||||
|
||||
void mixer_init(mixer_t* mix) {
|
||||
for (int i = 0; i < ICOUNT; i++) {
|
||||
mix->i[i] = NULL;
|
||||
}
|
||||
for (int i = 0; i < OCOUNT; i++) {
|
||||
mix->o[i] = NULL;
|
||||
}
|
||||
for (int i = 0; i < RCOUNT; i++) {
|
||||
mix->r[i].i = -1;
|
||||
mix->r[i].o = -1;
|
||||
mix->r[i].k = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void mixer_iset(mixer_t* mix, int n, double* i) {
|
||||
mix->i[n] = i;
|
||||
}
|
||||
|
||||
void mixer_oset(mixer_t* mix, int n, double* o) {
|
||||
mix->o[n] = o;
|
||||
}
|
||||
|
||||
void mixer_rset(mixer_t* mix, int n, int i, int o, double k) {
|
||||
mix->r[n].i = i;
|
||||
mix->r[n].o = o;
|
||||
mix->r[n].k = k;
|
||||
}
|
||||
|
||||
void mixer_apply(mixer_t* mix) {
|
||||
for (int ridx = 0; ridx < RCOUNT; ridx++) {
|
||||
int oidx = mix->r[ridx].o;
|
||||
if (oidx < 0) continue;
|
||||
if (mix->o[oidx] == NULL) continue;
|
||||
*(mix->o[oidx]) = 0.0;
|
||||
}
|
||||
|
||||
for (int ridx = 0; ridx < RCOUNT; ridx++) {
|
||||
|
||||
int iidx = mix->r[ridx].i;
|
||||
int oidx = mix->r[ridx].o;
|
||||
|
||||
if (iidx < 0) continue;
|
||||
if (oidx < 0) continue;
|
||||
|
||||
if (mix->i[iidx] == NULL) continue;
|
||||
if (mix->o[oidx] == NULL) continue;
|
||||
|
||||
*(mix->o[oidx]) += *(mix->i[iidx]) * mix->r[ridx].k;
|
||||
}
|
||||
}
|
||||
38
mculoop/mixer.h
Normal file
38
mculoop/mixer.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2022 Oleg Borodin <borodin@unix7.org>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MIXER_H_QWERTY
|
||||
#define MIXER_H_QWERTY
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#define ICOUNT 16
|
||||
#define OCOUNT 16
|
||||
#define RCOUNT 16
|
||||
|
||||
|
||||
typedef struct {
|
||||
int i;
|
||||
int o;
|
||||
double k;
|
||||
} rule_t;
|
||||
|
||||
typedef struct {
|
||||
double* i[ICOUNT];
|
||||
double* o[OCOUNT];
|
||||
|
||||
rule_t r[RCOUNT];
|
||||
} mixer_t;
|
||||
|
||||
|
||||
void mixer_init(mixer_t* mix);
|
||||
void mixer_iset(mixer_t* mix, int n, double* i);
|
||||
void mixer_oset(mixer_t* mix, int n, double* o);
|
||||
void mixer_rset(mixer_t* mix, int n, int i, int o, double k);
|
||||
void mixer_apply(mixer_t* mix);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user