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

Control word disable voltage #249

Open
jbbjarnason opened this issue Nov 19, 2024 · 1 comment
Open

Control word disable voltage #249

jbbjarnason opened this issue Nov 19, 2024 · 1 comment

Comments

@jbbjarnason
Copy link
Contributor

fyi, I am pretty certain that DISABLE_VOLTAGE should be ENABLE_VOLTAGE

from ds402.rs

        /// Switch on
        const SWITCH_ON = 1 << 0;
        /// Disable Voltage
        const ENABLE_VOLTAGE = 1 << 1; // <----------------------------
        /// Quick Stop
        const QUICK_STOP = 1 << 2;
        /// Enable Operation
        const ENABLE_OP = 1 << 3;
        /// Operation mode specific
        const OP_SPECIFIC_1 = 1 << 4;
        /// Operation mode specific
        const OP_SPECIFIC_2 = 1 << 5;
        /// Operation mode specific
        const OP_SPECIFIC_3 = 1 << 6;
        /// Reset Fault (only effective for faults)
        const RESET_FAULT = 1 << 7;
        /// Pause/halt
        const PAUSE = 1 << 8;

        /// Shutdown state.
        const STATE_SHUTDOWN = Self::QUICK_STOP.bits() | Self::DISABLE_VOLTAGE.bits();
        /// Switched on state.
        const STATE_SWITCH_ON = Self::QUICK_STOP.bits() | Self::DISABLE_VOLTAGE.bits() | Self::SWITCH_ON.bits();
        /// Voltage disabled state.
        const STATE_DISABLE_VOLTAGE = 0;
        /// Quick stop state.
        const STATE_QUICK_STOP = Self::DISABLE_VOLTAGE.bits();
        /// Operation disabled state.
        const STATE_DISABLE_OP = Self::QUICK_STOP.bits() | Self::DISABLE_VOLTAGE.bits() | Self::SWITCH_ON.bits();
        /// Operation enabled state.
        const STATE_ENABLE_OP = Self::ENABLE_OP.bits() | Self::QUICK_STOP.bits() | Self::DISABLE_VOLTAGE.bits() | Self::SWITCH_ON.bits();
        /// Fault reset state.
        const STATE_FAULT_RESET = Self::RESET_FAULT.bits();
@jamwaffles
Copy link
Collaborator

You're very probably correct, although I wouldn't spend much time fixing the builtin DS402 implementation - it hasn't seen much love recently and was only ever a prototype. I think I made a mistake in releasing it with EtherCrab.

That said, I'll soon be focussing on a better reimplementation that's better built and better thought out, so stay tuned (ish - unsure what the timeline is) for that.

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

2 participants