Rapid overide selector switch bounce

More
6 years 2 months ago #180183 by COlger81
I am using a 3 position selector switch to select rapid override value. Values for selector switch are 25%, 50%, and 100%. On startup, the value in Gmoccapy bounces rapidly from these 3 values until i rotate selector switch. After rotating selector, it calms down and acts as it should most of the time. HAL and python file attached.

Attachment not found

Attachment not found

Please Log in to join the conversation.

More
6 years 2 months ago #180187 by cmorley
This sounds like fighting between two programs setting the override.
Each program must allow another to set the override without creating an endless loop of changes. I don't know if this is the problem just guessing.

You have chosen a unique way to set the override with a python program.
Usually for a selector switch I would use a mux component and use halui's direct-value option. using a mux16 allows for debounce as well.
This is how pncconf sets up overrides; you could create a dummy config to study the HAL files if you are interested.

It's tough to troubleshoot these kinds of problems because of the highly specific hardware HAL code makes testing impossible for others.

Chris

Please Log in to join the conversation.

More
6 years 1 month ago #180188 by COlger81
Python seemed like a simple path being that the switch is not just 3 outputs (one for each position). It's a logic setup with 2 outputs.

Please Log in to join the conversation.

More
6 years 1 month ago #180189 by newbynobi
Please try to use directly the gmoccapy Hal pin,
Documentation is here

Use this pin and report:

gmoccapy.rapid.rapid_override.direct-value = HAL_FLOAT To adjust the max velocity slider

gmoccapy.rapid.rapid_override.analog-enable = HAL_BIT Must be True, to allow analog inputs

Do never use "enable direct value" and "count-enable", like you did in your Hal file!

Norbert

Please Log in to join the conversation.

More
6 years 1 month ago #180192 by COlger81
I'm using a 3 position selector switch. Not an encoder or potentiometer...

Please Log in to join the conversation.

More
6 years 1 month ago #180193 by COlger81
I think i see what you're saying.

Thanks

Please Log in to join the conversation.

More
6 years 1 month ago #180194 by cmorley
So Norbert has confirmed that GMoccapy doesn't like other programs setting the overrides. , but has HAL pins available to do the same.

So use the GMoccapy pins to set the overrides rather then halui.
the process is similar - pin types and names may be different.

Please Log in to join the conversation.

More
6 years 1 month ago #180195 by COlger81
Yes, got it sorted now.

Thanks Guys

Please Log in to join the conversation.

More
6 years 1 month ago #180201 by tommylight
Fixed title.

Please Log in to join the conversation.

More
6 years 1 month ago #180210 by COlger81
Was i yelling again? Gotta work on that i guess.

Please Log in to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum