Carousel compunent "debounce"

More
08 Jun 2016 16:03 #75691 by thewho
Hello

I use the carousel component for my turret and it's working fine for the most part.
Problem is that the encoder (binary) on the turret doesn't set all outputs at the same time. So if I want to go from say pos6 (0110) to pos1 (0001) it will stop at pos7 (0111) because bit 1 changes first when it rotates.
I've done some programming but I have never used 'switch/case' so I'm having a hard time figuring out how to edit the component to get what I want.

Anyone whit the same problem? Solutions?

Please Log in or Create an account to join the conversation.

More
08 Jun 2016 16:15 - 08 Jun 2016 16:19 #75692 by PCW
Replied by PCW on topic Carousel compunent "debounce"
This is why absolute encoders use Gray code (only 1 bit changes at a time between positions)
Is it possible to change your encoder to Gray code? This is probably the best solution

I seems like you could take the debounce component as a starting point to create a component that takes
a u32 number as input and has a u32 number as output and only updates the output number when the inputs
has been unchanged for some time period. This would probably work when moving but would fail if the tool changer stopped at a bad code
Last edit: 08 Jun 2016 16:19 by PCW.

Please Log in or Create an account to join the conversation.

More
09 Jun 2016 09:26 #75712 by thewho
I don't want to even touch the encoder because I can't find any exploded views on the turret and it uses a special "auto-locking" mechanism where the turret "disk" doesn't move in/out to lock it.

There must be a way to get the component to do what I want?.. One possibility is for me to use an Arduino as a "buffer" for the encoder signals.

Please Log in or Create an account to join the conversation.

More
09 Jun 2016 13:36 #75724 by andypugh

There must be a way to get the component to do what I want?.


Yes, but you might have to write it. If you are prepared to write Arduino code to do the job then writing a LinuxCNC HAL component wil lbe easier.

linuxcnc.org/docs/2.7/html/hal/comp.html

Please Log in or Create an account to join the conversation.

Time to create page: 0.127 seconds
Powered by Kunena Forum