KinkyMakers / OSSM-hardware

OSSM pcb and hardware enclosure design
CERN Open Hardware Licence Version 2 - Strongly Reciprocal
259 stars 48 forks source link

StrokeEngine integration: Wrong arg type given at setSpeed function #132

Open Ptibibi opened 1 month ago

Ptibibi commented 1 month ago

https://github.com/KinkyMakers/OSSM-hardware/blob/master/Software/src/ossm/OSSM.StrokeEngine.cpp#L39

Stroker.setSpeed(ossm->setting.speed * 3, true);

in setSpeed, "speed" arg it must be "Strokes per Minute" https://github.com/KinkyMakers/OSSM-hardware/blob/master/Software/lib/StrokeEngine/src/StrokeEngine.h#L124C20-L124C38

But actually, is it a percent of speedKnob https://github.com/KinkyMakers/OSSM-hardware/blob/master/Software/src/ossm/OSSM.PlayControls.cpp#L74

This reduces the speed adjustment range to less than 20 percent of the remote command.

Ptibibi commented 1 month ago

Appears to have been introduced during the global rework https://github.com/KinkyMakers/OSSM-hardware/pull/82

Ptibibi commented 1 month ago

I'm going to try this fix tonight (no homing management)

// Stroker.setSpeed(ossm->setting.speed * 3, true); // Convert speedKnob percent consigne to stroke/min with settings from config float speedMmPerSecond = (Config::Driver::maxSpeedMmPerSecond * ossm->setting.speed) / 100.0; float strokePerSecond = speedMmPerSecond / Config::Driver::maxStrokeSteps; float strokePerMin = strokePerSecond * 60.0; Stroker.setSpeed(strokePerMin, true);

Ptibibi commented 1 month ago

PR available: StrokeEngine: fix: drive StrokeEngine by speed #134