Stepper Motor Fwd Advance Actually Goes in Reverse

145 views
Skip to first unread message

anthony

unread,
Jun 30, 2021, 9:02:29 AM6/30/21
to Raspberry Pi Film Capture
Hello,

I have gone over the wiring diagram several times to check my wiring, and all seems to be correct. However, when I click on the advance forward one frame in client software, the stepper motor turns in reverse, and in like manner if I trigger a reverse, the motor turns the film forward. Also, the motor does not make a full revolution, but rather spins only partially around. Any suggestions on what I need to do to troubleshoot this problem.

Thanks.

Manuel Ángel

unread,
Jun 30, 2021, 2:13:13 PM6/30/21
to Raspberry Pi Film Capture
Hi Anthony.

I do not know your device, specifically the mechanical coupling of the stepper motor, the motor driver or the software you are using.

If you are using Joe Herman software, it may be that the motor is coupled to the projector in a way that rotates the projector shaft in reverse.

The problem is easy to solve via software.
The motor driver has an input signal that tells the motor the direction of rotation.
I've had a look at the (Joe Herman) software.
In the server software you can find the file control.py, where the instructions for controlling the engine are. You will notice that there are instructions like the following:

GPIO.output (self.dir_pin, True)

This instruction is what determines the direction of rotation.
To reverse the direction of rotation you will have to replace these instructions with the following:

GPIO.output (self.dir_pin, False).

And conversely, the original instructions GPIO.output (self.dir_pin, False) will have to be replaced by GPIO.output (self.dir_pin, True).

To solve the problem of incomplete revolution, in the same file there is a variable steps_per_rev, that is, the number of steps required by the motor to give a complete revolution. That will depend on how you have your driver configured. Once you have determined the appropriate parameter for your device, you must give that variable that correct value.

In the control.py file it appears:

steps_per_rev = 200

In your case, the value 200 is incorrect and you must replace it with the appropriate value for your case.

I hope I have clarified the matter a bit.

Lucky.

anthony

unread,
Jun 30, 2021, 3:14:54 PM6/30/21
to Raspberry Pi Film Capture
Thanks for the reply. I am using the  Joe Herman software, and I made the changes to GPIO.output (self.dir_pin, False) occurences as suggested. Now the motor is going forward and reverse in the direction the film is suppose to go. However, I'm not sure about the steps_per_rev = 200 as that setting would seem to be the correct one as I purchase the Nema Stepper Model #17HS16-2004S1. I've attached photo of how my motor is connected to the projector.

Thanks.20210630_150736.jpg

Dominique Galland

unread,
Jun 30, 2021, 5:21:58 PM6/30/21
to Raspberry Pi Film Capture
For the direction of rotation you can change the code as Manuel explains. I also believe that you can reverse the pins of one of the two coils of the motor.
For the incomplete rotation it's more curious.
Your motor seems to have 200 steps by rev like most of them. 
If you use an A4988 controller without microstepping (MS1, MS2, MS3 pins unconnected) steps_per_rev = 200 should make a complete turn. 
In my opinion, Joe's original software is not very complete for motor control and parameterization. Maybe you can try mine or Manuels's

0J10073.600.jpg

Manuel Ángel

unread,
Jun 30, 2021, 5:38:06 PM6/30/21
to Raspberry Pi Film Capture
Well, with the information you have sent, I can tell you that your motor is 200 steps per revolution, which is usually normal.
On the other hand, the motor driver allows it to be configured to advance in microsteps, thus achieving greater precision and smoothness in the movement.

Now, the 200 steps per revolution refer to the motor shaft. If no microsteps have been established, with 200 feed pulses, the motor shaft rotates one full revolution.

This does not mean that the projector advances a full frame. You would have to study the mechanism of your projector to determine how many revolutions of the motor it needs to advance a frame and with this data modify the variable steps_per_rev.

As an example, I give you the case of my device:
My motor is also 200 steps per revolution, but to avoid undesirable noise and vibrations, I have it set to the maximum resolution of 32 microsteps per step. Therefore I need 200 * 32 = 6400 microsteps to give one full revolution to the motor shaft. The movement is very smooth and precise, although at the cost of being slower. However, with mechanical coupling, it only takes half a revolution of the motor (= 3200 microsteps) to move forward or backward one frame.

That said, if you have some patience, I can send you a copy of my software, based on Joe Herman's project, albeit much improved. I am finishing a last version in which apart from correcting errors and carrying out new functions, it is translated into English. The original version is in my native language, Spanish.

My software is highly configurable. It is ideal for using an old projector. As a notable advantage, no sensor is needed to detect the correct position of the frame to be digitized. This function is already performed mechanically by the projector itself and in my opinion the construction of the device and the software is simplified a lot.

I wish you success in building your telecine machine.

anthony

unread,
Jul 1, 2021, 12:07:51 PM7/1/21
to Raspberry Pi Film Capture
Thanks for the replies. If I can get a copy of Manuel's software, that would be great. Will also check out  https://github.com/dgalland/yart
Reply all
Reply to author
Forward
0 new messages