Hal debounce signal or pin ?

More
3 years 11 months ago #257742 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 ?

 

Please Log in to join the conversation.

More
3 years 11 months ago #257808 by andypugh
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.

Please Log in to join the conversation.

More
3 years 11 months ago #257812 by smc.collins
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

Please Log in to join the conversation.

More
3 years 11 months ago #257834 by andypugh
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.

Please Log in to join the conversation.

More
3 years 11 months ago #258007 by smc.collins
it's on my list of things to do

Please Log in to join the conversation.

Time to create page: 1.233 seconds
Powered by Kunena Forum