04-04-2024 07:52 AM - edited 04-04-2024 08:29 AM
First, both A & B have the same number of pulses and the total pulses per revolution are the same for A as B. If the number of pulses per revolution is 10 then both A & B have 10 pulses. A system with the Z will fire a pulse for every 10 pulses of A or B which is the same point. It has been a while, and I am uncertain if the pulse width for Z is the same as the others.
For a 10 pulse per revolution encoder it will have 10 * 4 steps ==> 40 steps = [360 degrees/40 steps] = 9 degrees of resolution = 9 degrees per step.
You must make sure that your sample rate is quick enough to take at least two samples at each step otherwise you might actually be below the Nyquist sampling frequency without knowing it.
Your program should:
04-04-2024 08:03 AM
Do you check the code attached in the previous reply ? Does it make sense to calculate the angular Velocity.
04-05-2024 02:39 PM
I am trying to calculate the motor velocity using Incremental Encoder. I understand how its work and the method to calculate the pulses, also when it will take clockwise turn and anticlockwise turn.
Based on the above understanding I wrote a code to count the pulses of Channel A and B.
But when I am running it the value of the count is showing -1 only instead of giving the motor any RPM.
Can you please let me know where I am going wrong ? Please Ignore the comment if it does not make sense to you ?
I believe the condition of counting the pulse for A and B is not written properly.
Pls : I am using Incremental Encoder attached on the DC Motor, I am writing the code on FPGA.
04-05-2024 06:57 PM
Try the shipping example <LabVIEW>\examples\CompactRIO\FPGA Fundamentals\Counters\Quadrature Decoder\Quadrature Decoder.vi
04-07-2024 12:20 PM
I just wanted to understand, what's the wrong with this code. I am supposing that it should count the number of pulses for a specific period of time. And that I can use for calculating the Velocity.
I really want to understand it. As far my understanding is concern, I am not able to relate this code with the conceptual understanding.
If someone is really good at FPGA codding, please look this out.
04-08-2024 11:14 AM
Ran a simulation with your code [Using two booleans, non-FPGA code & a looped state machine in its place]. It looks like it should work. I would recommend that you preset your shift registers to get the initial results.
04-09-2024 10:11 AM - edited 04-09-2024 10:13 AM
Can anyone help me to understand the potential reason this cause.
Basically I am using the below code to calculate the increment count and velocity ( 2nd image of SubVI for velocity calculation, I thought the loop frequency is getting affected by it so i made it)
Basically I am trying to validate my Encoder Increment count and Velocity using Motion Manager 6 of Faulhaber. Whenever I am giving the less position count to my motor let say 400, 500, 600 my Encoder Increment count is also coming near by value and it is fluctuating. But when ever I am giving so high position to my motor let say 5000 then using the labview I am getting 4200 as a position count.
Similarly, I am trying for velocity and giving some less value let say 100 then using labview encoder code I am able to read it around 98 and near by values but when ever I am giving it. let, say 400 RPM through motion manager and reading it through the sbRIO it is coming near 300.
Pls Note : I am trying to validate my encoder reading by giving the command to the motion manager and reading those values in the SbRIO using the above code which I have shared earlier.
It would be a great help if some will let me what could be the possible reason for it.
My Point of View on it : Either the code have not all condition to count the pulses or it could be because of the frequency of calculation ( I tried this but helped me ).
Please correct me I am not making any sense.
04-09-2024 11:31 AM
If you are trying to debug your code, start simple.
04-10-2024 10:05 AM
Hello,
Can anyone help me to convert this VI for SbRIO 9627 ?
I mean can someone create the given VI usable fort FPGA.
04-10-2024 01:00 PM
1. The count is varying in thousands. let say When I am rotating the shaft by 45 degrees the count is 27413 and another 45 degrees the count is 28131.
2. When I am rotating the shaft under a second the velocity increases and then decreases to zero.
I feel, this code fails to calculate the count of my encoder, I have a myRIO in which there is Encoder inbuilt block is given in the myRIO toolkit it gives precise count. I wanted to have that level of accuracy for my application.