Carousel compunent "debounce"

More
10 years 4 months ago #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 to join the conversation.

More
10 years 4 months ago #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

Please Log in to join the conversation.

More
10 years 4 months ago #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 to join the conversation.

More
10 years 4 months ago #75724 by andypugh

thewho wrote: 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 to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum