This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TIDA-010948: Questions about implementation

Part Number: TIDA-010948

Tool/software:

Hi, 

1) Are the position commands hard coded in the C code of the AM243 or is there a way to send the commands through a host ? 

2) LUT are used - can you elaborate why ? I used to see them when FIR filters were used but in this case you are using sync filters

Thanks

Geoffrey 

  • Hello Geoffrey,

             Please find my answers:

    1)  the position data is transmitting via Ethernet protocol SORTEG, and the timing is pre-configured in PRU FW. So, kind of hard coded. SORTE_G master will send request to SORTE_G Device at pre-defined timeslot and then received the 6-axis position data during every PWM cycle. e.g. 16kHz

    2) LUT is used for storing the inverse of time because PRU doesn't have division command. What you mean sync filters?

    Regards,

    Chen

  • Hi Geoffrey,

    Please find my answer below.

    2) The encoder software utilizes three Look-Up Tables (LUTs).

    The first LUT contains directional information, indicating clockwise as 0 and counterclockwise as 1, with 'F' representing an invalid state. The direction is determined by combining the previous and current states of A and B signals to form an index value, which is then used to retrieve the corresponding direction from the LUT.

    The second LUT stores a calculation for time conversion: (1/T) * (2^32), where T represents a range of time in nanoseconds. This essentially inverts time in Q format with 32-bit fraction and useful in calculating motor velocity.

    Motor RPM is calculated using the formula: ((number of A and B edges within a 62.5µs window / 4000) * (1/x) * 60). The variable 'x' denotes the time between the first and last edge, which is variable based on motor speed. Since there's no direct ASM instruction to compute the inverse, LUT is utilized for this purpose. In this formula, 4000 represents the total number of edges in the encoder, with a pre-calculated constant value (1/4000) being used directly in the code. Two values from the LUT are accessed and interpolated to estimate intermediate calculations when necessary.

    To determine velocity above 240 RPM, the above method is used. Conversely, for lower RPMs, a switch occurs between different sections of the code that uses the third LUT with pre-calculated RPM values. Again, two values from the LUT are accessed and interpolated to estimate intermediate calculations when necessary.