Rotary Quadrature Encoder – Improvements
Posted: Thu Jan 04, 2018 1:21 pm
If you consider the question below should not have been posted here, then please move it here:
viewforum.php?f=65
1) Would be possible to make next improvement to the Rotary Quadrature Encoder component?
The actual software denouncing is based on time delay.
Besides that the user must do a hardware debouncing, to use additional hardware components to clean up the signal, if wants to not miss a count.
There are better ways to do a software denouncing. Let’s call it digital filtering.
It would be very helpful if the user can implement his own custom software debouncing /digital filtering to the Rotary Quadrature Encoder component.
Right now between pins/inputs of the Rotary Quadrature Encoder component and its counter there is no visible connection/exposure to the user.
What I would like to see/have is next: the Rotary Quadrature Encoder component should let you see and set the 2 pins (as it is now) and then to have also 2 variable for a custom macro where the user can write his own custom software debouncing /digital filtering.
The custom software debouncing should be placed between the 2 hardware input pins and the 2 variables as output from custom software debouncing going to be used for counting register.
The user should be able to choose between existing options as no debouncing or delay debouncing or custom debouncing self-written macro.
That will help a lot, because simple delay debouncing many times is not good enough.
The idea is to let the user to come in-between 2 input pins and the counter register.
If no software debouncing is used, then the 2 input pins are connected directly to the 2 variables and the user can only see that, but has no access to modify something.
If delay debouncing is used, then the 2 input pins are connected to the delay macro and the 2 variables are output from delay macro going to counter register and the user can only modify the delay time as it is now implemented.
If custom debouncing is used, then the 2 input pins are connected to the custom debouncing macro and the 2 variables are output from the custom debouncing macro going to counter register and the user must implement his own code.
The counter register should count based on those 2 variables/bits instead of the hardware pins as it is now.
Depending by PIC and CPU frequency used, that additional macro debouncing macro may introduce delay with improper result, because usual we need to read the encoder and count as fast as possible, but that should be up to the users, their choice. It is enough a short notice/warning about that.
The improvement will help because are many situations when the user/application requires very low number of hardware components, no hardware debouncing. Even is not really recommended, there are enough such situations when each additional component/penny counts and then only software debouncing, better than simple delay, is possible and in fact enough.
The improvement should not be so hard, it is only necessary to add the 2 variables/bits and point to a custom delay macro.
2) If you have no time to do it, then would be possible to post the source code of the Rotary Quadrature Encoder? Then we will try to do it.
viewforum.php?f=65
1) Would be possible to make next improvement to the Rotary Quadrature Encoder component?
The actual software denouncing is based on time delay.
Besides that the user must do a hardware debouncing, to use additional hardware components to clean up the signal, if wants to not miss a count.
There are better ways to do a software denouncing. Let’s call it digital filtering.
It would be very helpful if the user can implement his own custom software debouncing /digital filtering to the Rotary Quadrature Encoder component.
Right now between pins/inputs of the Rotary Quadrature Encoder component and its counter there is no visible connection/exposure to the user.
What I would like to see/have is next: the Rotary Quadrature Encoder component should let you see and set the 2 pins (as it is now) and then to have also 2 variable for a custom macro where the user can write his own custom software debouncing /digital filtering.
The custom software debouncing should be placed between the 2 hardware input pins and the 2 variables as output from custom software debouncing going to be used for counting register.
The user should be able to choose between existing options as no debouncing or delay debouncing or custom debouncing self-written macro.
That will help a lot, because simple delay debouncing many times is not good enough.
The idea is to let the user to come in-between 2 input pins and the counter register.
If no software debouncing is used, then the 2 input pins are connected directly to the 2 variables and the user can only see that, but has no access to modify something.
If delay debouncing is used, then the 2 input pins are connected to the delay macro and the 2 variables are output from delay macro going to counter register and the user can only modify the delay time as it is now implemented.
If custom debouncing is used, then the 2 input pins are connected to the custom debouncing macro and the 2 variables are output from the custom debouncing macro going to counter register and the user must implement his own code.
The counter register should count based on those 2 variables/bits instead of the hardware pins as it is now.
Depending by PIC and CPU frequency used, that additional macro debouncing macro may introduce delay with improper result, because usual we need to read the encoder and count as fast as possible, but that should be up to the users, their choice. It is enough a short notice/warning about that.
The improvement will help because are many situations when the user/application requires very low number of hardware components, no hardware debouncing. Even is not really recommended, there are enough such situations when each additional component/penny counts and then only software debouncing, better than simple delay, is possible and in fact enough.
The improvement should not be so hard, it is only necessary to add the 2 variables/bits and point to a custom delay macro.
2) If you have no time to do it, then would be possible to post the source code of the Rotary Quadrature Encoder? Then we will try to do it.