From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rotary Encoder loop

Hi,

 

I got the attached pic from the link here,http://www.jgorasia.com/Files/Fall09/robotics/Gorasia%20Actuation%20and%20Control%20Lab%20F09%20FINA...

 

In the Encoder loop,i would like to know what will the code for false case to find ticks/count and also for DCS1 Index position.

0 Kudos
Message 1 of 8
(3,363 Views)

Top case (DCSI index position): nothing.

main case:

Nothing happened (encoder did not click), so value of all 4 shift registers stays the same

Message 2 of 8
(3,321 Views)

Thanks,i used that logic in my code,i see that the value output of that mentioned in the link with my value output has mismatch.

Could u let me know on this.

Download All
0 Kudos
Message 3 of 8
(3,299 Views)

Perfect example how aligning and avoiding spagetting wires prevents errors. 

"Value in all shift registers should stay the same" - it means output of left shift register node should go directly into right shift register node (except encoder position that can be reset, but when Reset=False, it is connected). On original diagram it would result in 4 straight horizontal wires.

On your diagram top and bottom node values are lost - they are not connected anywhere. 2-nd goes into 3-d and 3-d - into 2-nd

Also, clean boolean traces, that part also might have errors.

0 Kudos
Message 4 of 8
(3,280 Views)

//

(except encoder position that can be reset, but when Reset=False, it is connected). On original diagram it would result in 4 straight horizontal wires.//

These 2 lines are contradicting for me.If 4 lines then encoder pos must also be connected but you said that is wrong.

 

0 Kudos
Message 5 of 8
(3,263 Views)

Sorry, they are not completely horizontal. They save shift register values

0 Kudos
Message 6 of 8
(3,252 Views)

Thank You,i will try this and let you know incase of any issues.

 

I have 4 single cycle timed loops each for PWM and Duty cycle(Pos & Velocity).I would like to know if this is correct as the output(p) and output(v/a) are always 0.Also it is advisable to use 4SCTL in one project??

Download All
0 Kudos
Message 7 of 8
(3,239 Views)

pls find other 2 attachments here

Download All
0 Kudos
Message 8 of 8
(3,238 Views)