I designed a control algorithm in PAC Control Basic for the B3000 Ethernet I/O brain that would be responsible for controlling the motors to the marginators. In terms of basic functionality, everything is working perfectly:
However, when I run the chart and monitor the variables, I notice that the ‘Encoder Count #’ values are not being updated, especially when I move from the Quadrature Counter points to the Encoder Count variables. This is problematic since I am trying to calculate the percentage load on each marginator given the encoder counts.
In the watch window, I can see that the external values (XVAL) of the Quadrature Counter points are being updated, but the internal values (IVAL) are not being updated at all. Could this be the reason why my Encoder Count variables are not being updated, especially when I move the values from the Quadrature Counter points? Also, I notice that my Encoder Count values are stuck at 1 when I have initialized them both to 0, which doesn’t make any sense to me.
Here’s what my ‘Obtain Encoder Counts’ block contains:
So, my question is what do I need to fix to ensure that my Encoder Count variables are being updated?