Hal debounce signal or pin ?
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 677
- Thank you received: 117
27 Nov 2022 16:17 - 27 Nov 2022 16:34 #257742
by smc.collins
Hal debounce signal or pin ? was created by smc.collins
I am having issues with turret overshoot " I think " and I want to debounce both my pocket calculation and my strobe input.
net car-enable motion.digital-out-00 carousel.0.enable
net car-pos-req motion.analog-out-00 conv-float-s32.0.in
net car-pos-s32 < put debounce function here > conv-float-s32.0.out carousel.0.pocket-number
#Strobe input, sinals when turret is aligned with pocket to lock assign to Strobe switch
net car-rev carousel.0.strobe < add debounce function here>
so adding this to the hal file
loadrt debounce cfg=2,1
setp debounce.0.delay 1000
addf debounce.0 base-thread
setp debounce.1.delay 500
addf debounce.1 base-thread
net car-enable motion.digital-out-00 carousel.0.enable
net car-pos-req motion.analog-out-00 conv-float-s32.0.in
net car-pos-s32 debounce.1.0-in
net debounce-car-pos-s32 conv-float-s32.0.out carousel.0.pocket-number
Is this correct or am I misreading the documents ?
of should I use dbounce instead ? and if so, are they're any example of how to use it or just add it to the line ? NAMEdbounce - alternative debounce componentSYNOPSISThis component is similar to the debounce component(man debounce) but uses settable delay pins for each instanceand supports count= or names= parameters(groups are not used)FUNCTIONSdbounce.NPINSdbounce.N.in bit in
dbounce.N.out bit out
dbounce.N.delay u32 in (default: 5) net car-pos-s32 dbounce.1.delay u32
net car-pos-s32 dbounce.1.delay u32-in
net dbounce.1.out conv-float-s32.0.out carousel.0.pocket-number
do I need to add a servo thread and other functions like regular debounce ?
net car-enable motion.digital-out-00 carousel.0.enable
net car-pos-req motion.analog-out-00 conv-float-s32.0.in
net car-pos-s32 < put debounce function here > conv-float-s32.0.out carousel.0.pocket-number
#Strobe input, sinals when turret is aligned with pocket to lock assign to Strobe switch
net car-rev carousel.0.strobe < add debounce function here>
so adding this to the hal file
loadrt debounce cfg=2,1
setp debounce.0.delay 1000
addf debounce.0 base-thread
setp debounce.1.delay 500
addf debounce.1 base-thread
net car-enable motion.digital-out-00 carousel.0.enable
net car-pos-req motion.analog-out-00 conv-float-s32.0.in
net car-pos-s32 debounce.1.0-in
net debounce-car-pos-s32 conv-float-s32.0.out carousel.0.pocket-number
Is this correct or am I misreading the documents ?
of should I use dbounce instead ? and if so, are they're any example of how to use it or just add it to the line ? NAMEdbounce - alternative debounce componentSYNOPSISThis component is similar to the debounce component(man debounce) but uses settable delay pins for each instanceand supports count= or names= parameters(groups are not used)FUNCTIONSdbounce.NPINSdbounce.N.in bit in
dbounce.N.out bit out
dbounce.N.delay u32 in (default: 5) net car-pos-s32 dbounce.1.delay u32
net car-pos-s32 dbounce.1.delay u32-in
net dbounce.1.out conv-float-s32.0.out carousel.0.pocket-number
do I need to add a servo thread and other functions like regular debounce ?
Last edit: 27 Nov 2022 16:34 by smc.collins.
Please Log in or Create an account to join the conversation.
28 Nov 2022 00:55 #257808
by andypugh
Replied by andypugh on topic Hal debounce signal or pin ?
You can only debounce a bit pin. (but you can lowpass-filter the other pin types)
It certainly makes sense to debounce the strobe and the position encoding pins.
It does not make any sense to debounce (or filter) the commanded pocket number from the G-code routine. If there is noise in that signal then something has gone very wrong with the software.
It certainly makes sense to debounce the strobe and the position encoding pins.
It does not make any sense to debounce (or filter) the commanded pocket number from the G-code routine. If there is noise in that signal then something has gone very wrong with the software.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 677
- Thank you received: 117
28 Nov 2022 02:06 - 28 Nov 2022 02:08 #257812
by smc.collins
Replied by smc.collins on topic Hal debounce signal or pin ?
the issue at hand is that, I am dealing with some turret position overshoot, IE it is coasting after car-fwd finishes.The strobe pin is on a hydrualic pusher that gets pressure after the motor valve turns off.
I finally figured out my Gcode error for getting the wait, so I will be modifying that, and I think it should resolve that issue of the turret not locking.
I will probably add some debounce to my inputs for sure, but I will see what comes of my fixes to my ngc file first and hal second.
as to the noise, the bcd switch array doesn't appear to be hyper sensitivie to the cam motion up until it gets around 40 degrees of rotation from the station position, then they start flicking on around the 65 degree mark. I can adjust them to be a bit less gain happy mechanically
I finally figured out my Gcode error for getting the wait, so I will be modifying that, and I think it should resolve that issue of the turret not locking.
I will probably add some debounce to my inputs for sure, but I will see what comes of my fixes to my ngc file first and hal second.
as to the noise, the bcd switch array doesn't appear to be hyper sensitivie to the cam motion up until it gets around 40 degrees of rotation from the station position, then they start flicking on around the 65 degree mark. I can adjust them to be a bit less gain happy mechanically
Last edit: 28 Nov 2022 02:08 by smc.collins.
Please Log in or Create an account to join the conversation.
28 Nov 2022 11:00 #257834
by andypugh
Replied by andypugh on topic Hal debounce signal or pin ?
The point of the strobe is to make sure that the position bits have settled before interpreting them.
I would definitely recommend debouncing the strobe, though, to reject any electrical noise that might give a false "data good" when it really isn't.
I would definitely recommend debouncing the strobe, though, to reject any electrical noise that might give a false "data good" when it really isn't.
The following user(s) said Thank You: smc.collins
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 677
- Thank you received: 117
29 Nov 2022 18:37 #258007
by smc.collins
Replied by smc.collins on topic Hal debounce signal or pin ?
it's on my list of things to do
Please Log in or Create an account to join the conversation.
Time to create page: 0.088 seconds