Serial commands and a 21v3 motor controller

Hello,

I ordered a 21v3, and am going to try to send serial commands from an Arduino. What I am trying to do is position a linear actuator that has potentiometer feedback.

I think I understand the serial communication, but I’m not clear on how the set target commands work.

If I understand correctly, I can send a Set Target High Resolution command, and the actuator will move to the correct position, irregardless of the current position of the actuator, right?

If I was to use the Set Target Low Resolution Forward and Reverse commands I would need to query the motor controller first and then choose the forward or reverse command depending on the position of the actuator, and where I want the position to be, right?

Thanks for the help.

Hello,

The low-res and hi-res target setting commands just set target to a value as specified in the user manual. After target is set, there is no difference between the commands. “Forward” and “reverse” are arbitrary terms referring to targets above and below 2048, when you are in analog feedback mode. If you do tests when plugged in to USB, you can use the configuration utility to examine and debug the results of these commands.

As for your first question, whether the actuator actually moves to the position depends on whether you have it configured correctly and whether there is an error active. For example, if all of the PID terms are 0, it will not move at all, and if the feedback disconnect detect is enabled and feedback is out of range, it will be in an error state and also not move.

-Paul

Thanks for the help, the forward and reverse was confusing me, it makes sense now.

Cool, glad you get it. Good luck with your project and feel free to post any more questions that you have or share some pictures of your setup!

-Paul