Negative Stepper Rescale Factor to Invert Direction?

Comments & issues
peterpolidoro
Phidgetsian
Posts: 5
Joined: Thu Mar 29, 2018 12:34 pm
Contact:

Negative Stepper Rescale Factor to Invert Direction?

Postby peterpolidoro » Wed Jan 15, 2020 9:30 am

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?

User avatar
Patrick
Lead Developer
Posts: 3119
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Negative Stepper Rescale Factor to Invert Direction?

Postby Patrick » Wed Jan 15, 2020 9:45 am

Yes, although you could also wire up the motor differently to reverse its direction.

-Patrick

peterpolidoro
Phidgetsian
Posts: 5
Joined: Thu Mar 29, 2018 12:34 pm
Contact:

Re: Negative Stepper Rescale Factor to Invert Direction?

Postby peterpolidoro » Thu Jan 16, 2020 9:33 am

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

User avatar
Patrick
Lead Developer
Posts: 3119
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Negative Stepper Rescale Factor to Invert Direction?

Postby Patrick » Thu Jan 16, 2020 11:09 am

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


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest