Other Parts Discussed in Thread: BOOSTXL-DRV8305EVM, CONTROLSUITE
Hello,
I'm trying to use an absolute position encoder (AS5048A - ams.com/.../AS5048A) with a LAUNCHXL-F28069M and the BOOSTXL-DRV8305EVM to control the position of PMS motor following labs 12x - 13x of the TI Instaspin labs. I'm using an absolute encoder because my application requires precise positioning of the motor at near 0 speeds with little/no startup motion. I've built up an SPI interface to the sensor and am successfully reading in the value (a 14 bit integer indicating the absolute mechanical angle of the motor), but am having a hard time integrating it with the SpinTAC controller in a way that works.
Here's what I've tried:
I started by doing labs 2x to identify the resistance, inductance, etc of my motor. All seemed to work fine there. Running labs 3x also were successful in spinning the motor to the desired rpm.
I've plumbed the encoder signal into the `enc` module instead of the quadrature signal. To ensure a proper conversion, I set up the `enc` module using 2^14 / 4 as my number of encoder lines because it seems to be treating ENCODER_LINES * 4 - 1 as the maximum input value. Doing this I was able to make the `enc` module generate the electrical angle of my motor from my encoder signal. This seems to be working properly as it cycles from 0 to 1 14 times over 1 motor revolution, which is correct as I have a 14 pole-pair motor.
At this point it seems like I have properly set up my feedback loop. I ran lab 12a to identify the inertia of my system, and after changing the ramp time and target speed a bit, it seemed to be working. However, I'm seeing very strange behavior from the motor when I run lab 12b. Though the motor is trying to spin to a target rpm (100), it starts spinning up but then seems to stall and pulse back and forth a little bit. Then it will start spinning up again. This cycle is repeating over a period of a couple seconds between each set of pulses.
Did I miss a crucial part of the encoder integration or is there some other issue that I'm missing? Thanks for the help in advance.