Tic36v4 control analof

Hello,

I’m setting up the tc36v4 using the tic software and the C++ API. I would like to control the position of the stepper motor from the code using the readings of an analog signal to get the actual position of the stepper motor, and sending the target position afterwards. I can see that the motor can be controlled with an analog signal to set the target position, but what I want is to just read the analog signal (not to send and analog signal as a target position, which I already managed to do it ) and then perform a closed loop to command the stepper motor to a certain position, and read that position again, so that to say a closed loop setting a position by command and check the position with the analog readings. I would like to know if there is anyway to do so or there is no way to perform this control loop?

This would be the control loop:

set_target_position-> stteper motor moves-> check stepper_motor_position with analog readings->check error_position=stepper_motor_position-set_target_position

Thanks a lot for your job!

Hello.

You can connect your analog signal to the SDA/AN and read it via USB using the C++ API. However, since the default behavior of the SDA/AN pin when the Tic is in Serial/I2C/USB control mode is to act as SDA, you will need to configure it appropriately for analog input first. You can find more about the analog pin option in the “Pin configuration” section of the Tic user’s guide.

Brandon