Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c9b0b0c9d | ||
|
|
dee941b68a | ||
|
|
1b24db682a |
No files matched your search
@@ -53,11 +53,11 @@ export function createChart({
|
||||
}
|
||||
|
||||
// Build uPlot data for ALL series (including hidden ones)
|
||||
const uPlotData: uPlot.AlignedData = [timestamps as any];
|
||||
const uPlotData: uPlot.AlignedData = [timestamps as uPlot.AlignedData[0]];
|
||||
|
||||
allOriginalSeries.forEach(({ series }) => {
|
||||
const [, values] = seriesToUPlotData(series.long);
|
||||
uPlotData.push(values as any);
|
||||
uPlotData.push(values as uPlot.AlignedData[1]);
|
||||
});
|
||||
|
||||
// Add config lines data
|
||||
@@ -70,7 +70,7 @@ export function createChart({
|
||||
line.value,
|
||||
)
|
||||
: new Array(timestamps.length).fill(line.value);
|
||||
uPlotData.push(lineData as any);
|
||||
uPlotData.push(lineData as uPlot.AlignedData[number]);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -367,26 +367,13 @@ export function createChart({
|
||||
return ticks.map((ts) => {
|
||||
const date = new Date(ts);
|
||||
|
||||
if (timeRange <= 30 * 1000) {
|
||||
if (timeRange <= 5 * 60 * 1000) {
|
||||
return date.toLocaleTimeString(undefined, {
|
||||
hour12: false,
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
});
|
||||
} else if (timeRange <= 5 * 60 * 1000) {
|
||||
return date.toLocaleTimeString(undefined, {
|
||||
hour12: false,
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
});
|
||||
} else if (timeRange <= 60 * 60 * 1000) {
|
||||
return date.toLocaleTimeString(undefined, {
|
||||
hour12: false,
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
});
|
||||
} else if (timeRange <= 24 * 60 * 60 * 1000) {
|
||||
return date.toLocaleTimeString(undefined, {
|
||||
hour12: false,
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
electron
|
||||
];
|
||||
|
||||
ELECTON_SKIP_BINARY_DOWNLOAD = 1;
|
||||
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
|
||||
|
||||
hardeningDisable = [ "fortify" ];
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ impl ExtruderV2 {
|
||||
self.screw_speed_controller.set_target_screw_rpm(
|
||||
self.screw_speed_controller.target_rpm,
|
||||
AngularVelocity::new::<revolution_per_minute>(1500.0),
|
||||
self.screw_speed_controller.motor_poles,
|
||||
4,
|
||||
);
|
||||
self.screw_speed_controller.set_uses_rpm(uses_rpm);
|
||||
}
|
||||
@@ -274,7 +274,7 @@ impl ExtruderV2 {
|
||||
self.screw_speed_controller.set_target_screw_rpm(
|
||||
AngularVelocity::new::<revolution_per_minute>(rpm),
|
||||
AngularVelocity::new::<revolution_per_minute>(1500.0),
|
||||
self.screw_speed_controller.motor_poles,
|
||||
4,
|
||||
);
|
||||
self.emit_state();
|
||||
}
|
||||
|
||||
@@ -214,15 +214,12 @@ impl MachineNewTrait for ExtruderV2 {
|
||||
let target_pressure = Pressure::new::<bar>(0.0);
|
||||
let target_rpm = AngularVelocity::new::<revolution_per_minute>(0.0);
|
||||
|
||||
let motor_poles = 4;
|
||||
|
||||
let screw_speed_controller = ScrewSpeedController::new(
|
||||
inverter,
|
||||
target_pressure,
|
||||
target_rpm,
|
||||
pressure_sensor,
|
||||
FixedTransmission::new(1.0 / 34.0),
|
||||
motor_poles,
|
||||
);
|
||||
let (sender, receiver) = smol::channel::unbounded();
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ use ethercat_hal::io::analog_input::AnalogInput;
|
||||
use units::angular_velocity::revolution_per_minute;
|
||||
use units::electric_current::milliampere;
|
||||
use units::f64::*;
|
||||
use units::frequency::hertz;
|
||||
use units::frequency::{cycle_per_minute, hertz};
|
||||
use units::pressure::bar;
|
||||
|
||||
use crate::extruder1::mitsubishi_cs80::MitsubishiCS80Status;
|
||||
@@ -21,7 +21,6 @@ pub struct ScrewSpeedController {
|
||||
pub pid: ClampingTimeagnosticPidController,
|
||||
pub target_pressure: Pressure,
|
||||
pub target_rpm: AngularVelocity,
|
||||
pub motor_poles: usize,
|
||||
pub inverter: MitsubishiCS80,
|
||||
pressure_sensor: AnalogInput,
|
||||
last_update: Instant,
|
||||
@@ -43,7 +42,6 @@ impl ScrewSpeedController {
|
||||
target_rpm: AngularVelocity,
|
||||
pressure_sensor: AnalogInput,
|
||||
transmission: FixedTransmission,
|
||||
motor_poles: usize,
|
||||
) -> Self {
|
||||
let now = Instant::now();
|
||||
Self {
|
||||
@@ -64,7 +62,6 @@ impl ScrewSpeedController {
|
||||
frequency: Frequency::new::<hertz>(0.0),
|
||||
maximum_frequency: Frequency::new::<hertz>(60.0),
|
||||
minimum_frequency: Frequency::new::<hertz>(0.0),
|
||||
motor_poles,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,13 +150,10 @@ impl ScrewSpeedController {
|
||||
|
||||
pub fn get_motor_status(&self) -> MotorStatus {
|
||||
let frequency = self.inverter.motor_status.frequency;
|
||||
let motor_rpm = AngularVelocity::new::<revolution_per_minute>(
|
||||
frequency.get::<hertz>() * 120.0 / self.motor_poles as f64,
|
||||
);
|
||||
let rpm =
|
||||
AngularVelocity::new::<revolution_per_minute>(frequency.get::<cycle_per_minute>());
|
||||
|
||||
let screw_rpm = self
|
||||
.transmission
|
||||
.calculate_angular_velocity_output(motor_rpm);
|
||||
let screw_rpm = self.transmission.calculate_angular_velocity_output(rpm);
|
||||
|
||||
let mut status = self.inverter.motor_status;
|
||||
status.rpm = screw_rpm;
|
||||
|
||||
@@ -278,7 +278,7 @@ impl ExtruderV3 {
|
||||
self.screw_speed_controller.set_target_screw_rpm(
|
||||
self.screw_speed_controller.target_rpm,
|
||||
AngularVelocity::new::<revolution_per_minute>(3000.0),
|
||||
self.screw_speed_controller.motor_poles,
|
||||
2,
|
||||
);
|
||||
self.screw_speed_controller.set_uses_rpm(uses_rpm);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ impl ExtruderV3 {
|
||||
self.screw_speed_controller.set_target_screw_rpm(
|
||||
AngularVelocity::new::<revolution_per_minute>(rpm),
|
||||
AngularVelocity::new::<revolution_per_minute>(3000.0),
|
||||
self.screw_speed_controller.motor_poles,
|
||||
2,
|
||||
);
|
||||
self.emit_state();
|
||||
}
|
||||
|
||||
@@ -213,15 +213,12 @@ impl MachineNewTrait for ExtruderV3 {
|
||||
let target_pressure = Pressure::new::<bar>(0.0);
|
||||
let target_rpm = AngularVelocity::new::<revolution_per_minute>(0.0);
|
||||
|
||||
let motor_poles = 2;
|
||||
|
||||
let screw_speed_controller = ScrewSpeedController::new(
|
||||
inverter,
|
||||
target_pressure,
|
||||
target_rpm,
|
||||
pressure_sensor,
|
||||
FixedTransmission::new(1.0 / 30.0),
|
||||
motor_poles,
|
||||
);
|
||||
let (sender, receiver) = smol::channel::unbounded();
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ in {
|
||||
# - CONS: Vulnerable to Spectre, Meltdown, Foreshadow, ZombieLoad, etc.
|
||||
# Should ONLY be used in completely trusted environments
|
||||
# - Improves performance by 7-43%
|
||||
"mitigation=off"
|
||||
"mitigations=off"
|
||||
"intel_pstate=performance" # Intel CPU-specific performance mode (if applicable)
|
||||
|
||||
# Memory Management
|
||||
|
||||
@@ -30,9 +30,6 @@ docker run --rm \
|
||||
--workdir /workspace \
|
||||
nixos/nix:latest \
|
||||
sh -c "
|
||||
whoami
|
||||
ls -lh
|
||||
cd /workspace
|
||||
echo 'Enabling flakes and nix-command...'
|
||||
mkdir -p ~/.config/nix
|
||||
echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf
|
||||
|
||||
Reference in new issue
Block a user