Ardillolambo
New member
Hi
Working on a paddle shifter for a manual transmission.
Using a linear actuator with encoder and an Arduino Due board.
The code is doing what I want, the linear actuator will move in the desired direction, but is not stopping consistently in the same "spot"
For some unknown reason, the position feedback from the encoder is not accurate and is inconsistent, in order to solve that issue, I decided to include on the code a "compare" with current position Vs. Previous position, if they are different write previous position to current position, but it gets lost the original motion direction (CCW vs CW) of the encoder. Is there a way that direction can be changed when the write() command is used? Please check ReadHorizontalPos() routine in the attached code.
Another thing....can't figure out why my set up() routine needs to be loaded at least three times to work properly.
Regards,
Working on a paddle shifter for a manual transmission.
Using a linear actuator with encoder and an Arduino Due board.
The code is doing what I want, the linear actuator will move in the desired direction, but is not stopping consistently in the same "spot"
For some unknown reason, the position feedback from the encoder is not accurate and is inconsistent, in order to solve that issue, I decided to include on the code a "compare" with current position Vs. Previous position, if they are different write previous position to current position, but it gets lost the original motion direction (CCW vs CW) of the encoder. Is there a way that direction can be changed when the write() command is used? Please check ReadHorizontalPos() routine in the attached code.
Another thing....can't figure out why my set up() routine needs to be loaded at least three times to work properly.
Regards,