Page 1 of 1

Negative Stepper Rescale Factor to Invert Direction?

Posted: Wed Jan 15, 2020 9:30 am
by peterpolidoro
I do not see any range limitations on the stepper rescale factor in the documentation. Is it possible to use negative values to invert the motor direction?

Re: Negative Stepper Rescale Factor to Invert Direction?

Posted: Wed Jan 15, 2020 9:45 am
by Patrick
Yes, although you could also wire up the motor differently to reverse its direction.

-Patrick

Re: Negative Stepper Rescale Factor to Invert Direction?

Posted: Thu Jan 16, 2020 9:33 am
by peterpolidoro
Thank you. When I try using a negative value for the stepper rescale factor, however, I get errors when I try to set the velocity limit. When the rescale factor is negative, does that mean the velocity limit has to be negative when in step mode instead of positive? If so what other values need to be flipped? Perhaps using a negative rescale factor is not a good idea, maybe I should flip the wiring like you suggested instead.

I am using the Python interface on Linux and I cannot see the exact errors I am getting, because I get AttributeError: /usr/local/lib/libphidget22.so.0: undefined symbol: Phidget_getLastError

Re: Negative Stepper Rescale Factor to Invert Direction?

Posted: Thu Jan 16, 2020 11:09 am
by Patrick
You should upgrade the installed phidget22 C library, so it is in sync with the Python library, and it can display error information.

With a negative rescale factor, you will need to use negative velocity limit in step mode. The library code is simply sending a (VeolocityLimit / RescaleFactor) value to the board. This should probably have been (VelocityLimit / ABS(RescaleFactor)) to handle negative rescale factors, but it's too late to change the library behavior now.

You'll also need to us negative Acceleration for the same reason.

-Patrick