My telecine software ver. 20230430 using picamera2 library

Hi @Manuel_Angel I saw the nice video posted by @Moevi.nl of his work, which uses your software.
I am new to python and do not read it well :). From what I understand from your code, it uses pigpio to define a waveform and then the library send this waveform to generate the pulses.

I have a suggestion to improve your control of the stepper, and the movement of the frame. In looking at the posted video, the start and stop of the stepper creates a bit of shaking. Using arduino and pico, I implemented a linear start and stop that makes the stepper run very smoothly.
The theory of how the stepper works is described in this Atmel paper, maybe the paper is a bit dense.

When I implemented the stepper control with a projector gate, with a claw, I also stopped mid turn -when the claw is fully engaged- and use that position to move the pickup reel, before moving the second half of the turn to complete the frame positioning. I also recall reading something in your code that there is a mode where you back one frame, before moving forward, which would create additional shaking.

In simple terms, instead of a single period for all the pulses (a single frequency), the process creates progressively from longer to shorter periods at the start, and progressively from shorter to longer periods at the stop. The other advantage is that it would allow the stepper to run slightly faster providing the torque and power allow it.

I think that can be achieved by replacing the single pulse period to create the wave, by a combination of a start pulses, mid pulses, and a stop pulses.

Without going into the complexity of the Atmel paper, you can implement a quick test to see the effects of a slow start/stop with something:

# start_pulses
for i in (50,2,-1):
    # pin ON
    pul_start.append(pigpio.pulse(1 << pulsePin, 0, int(float(tus)*float(i)/2.0)))

    # pin OFF
    pul_start.append(pigpio.pulse(0, 1 << pulsePin, int(float(tus)*float(i)/2.0)))

# mid_pulse sequence (same as you have it)
# pin ON
pul_mid.append(pigpio.pulse(1 << pulsePin, 0, tus))

# pin OFF
pul_mid.append(pigpio.pulse(0, 1 << pulsePin, tus))

# stop_pulses
for i in (2,50,1):
    # pin ON
    pul_stop.append(pigpio.pulse(1 << pulsePin, 0, int(float(tus)*float(i)/2.0)))

    # pin OFF
    pul_stop.append(pigpio.pulse(0, 1 << pulsePin, int(float(tus)*float(i)/2.0)))

And then correspondingly incorporate start_pulses, then 3102 mid_pulses, and then stop_pulses, into the wave.

The above is not linear acceleration, because the coefficients are only simple progression.
If you like the results, you can then implement the formulas for the coefficients for the start/stop pulses and increase the number of pulses on the start/stop which would allow a reduced mid period.

Let me know what you think, and I can also share the simple implementation to calculate the coefficients that I did on the PICO.

My understanding of the pigpio is limited to reading your code, so my apologies if I missed something on how to implement the variable period pulses in the start and stop.

Update: corrections to the loops and typecasting for the multiplication to be float. Sorry if my reading of python is limited, my writing is worst!

5 Likes