Negative Stepper Rescale Factor to Invert Direction?

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

Negative Stepper Rescale Factor to Invert Direction?

Post 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?
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Negative Stepper Rescale Factor to Invert Direction?

Post by Patrick »

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

-Patrick
peterpolidoro
Phidgetsian
Posts: 6
Joined: Thu Mar 29, 2018 12:34 pm
Contact:

Re: Negative Stepper Rescale Factor to Invert Direction?

Post 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
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Negative Stepper Rescale Factor to Invert Direction?

Post 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
Post Reply

Who is online

Users browsing this forum: Leonardsoito and 2 guests