Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ptibibi opened this issue Oct 28, 2024 · 3 comments
Open

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

Ptibibi opened this issue Oct 28, 2024 · 3 comments

Comments

@Ptibibi
Copy link
Contributor

Ptibibi commented Oct 28, 2024

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
Copy link
Contributor Author

Ptibibi commented Oct 28, 2024

Appears to have been introduced during the global rework #82

@Ptibibi
Copy link
Contributor Author

Ptibibi commented Oct 28, 2024

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
Copy link
Contributor Author

Ptibibi commented Oct 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant