The scanner has four SBCs:
- USER handles the touchscreen, WiFi, CineMaster, and communication with the other boards.
- CAPS controls the capstan motor, film transport, camera, the 3 wet gate motors, and REEL.
- REEL controls the two reel motors and film tension.
- UTIL controls the camera and lens motors, and the 5 fans.
Film tension and transport
There is a clear difference between Pause and Stop.
Pause stops the capstan but keeps the film loaded and tensioned. This allows the scanner to start again without creating a slack loop.
Stop releases the tension. The reels unwind until the film is slack, then the motors are disabled.
Each reel has a dancer arm with an encoder. The encoder position is used to control tension. The UI provides a target value from 0 to 184. A low value means the film is slack, while values near the limits indicate too much or too little tension.
During Pause, REEL moves the reels until both dancer arms reach the selected target. If the film becomes slack, REEL takes up the slack again. If it is too tight, the reel pays film out. When both arms are close to the target, the motors stop and the film is marked as tensioned.
The PID/ADRC control loop used while the film is moving is not used during Pause. During Pause, the reels simply make small corrections to keep the dancer arms at the setpoint.
De-tensioning uses a target of 0. The reels pay out film until the arms reach the slack position, then the motors are disabled and the tensioned flag is cleared.
Capture and shuttle cannot start unless REEL reports that the film is tensioned.
Tension while moving
The capstan controls film speed. The reels do not control FPS. Instead, they continuously adjust their speed to keep the dancer arms at the selected tension.
Each reel has its own PID/ADRC controller. It reads the dancer position and adjusts motor speed, with the maximum RPM limited according to the current film speed.
In forward motion, the right reel is the take-up reel and the left reel is the supply reel. In reverse, their roles are swapped and both motors reverse direction. The controllers also change their correction direction.
The scanner does not need to de-tension before reversing. CAPS slows the capstan, REEL changes direction and retunes its controllers, and the film then runs in the opposite direction while maintaining tension.
Capture and shuttle
Capture uses slower reel speeds and fine microstepping for smoother and quieter operation. Once the target speed is reached, the tension control is softened to reduce film flutter.
Shuttle uses higher reel speeds and coarser microstepping. The reels still follow the capstan and maintain tension.
If an arm reaches the maximum-tension limit, or tension drops below the minimum limit, REEL stops the reels and reports a fault. A loss of tension can, for example, indicate a broken film splice.
CAPS and REEL communication
CAPS is the I2C master and REEL is the slave on their dedicated bus. REEL does not call CAPS; it waits for commands and provides status when CAPS reads it.
CAPS mainly sends drive commands:
- Pause: tension and hold the film.
- Stop: de-tension and disable the motors.
- Forward/reverse/shuttle: follow the capstan while maintaining tension.
Before starting, CAPS checks the REEL tensioned flag. If the film is not tensioned, movement is refused.
CAPS also sends the actual film speed. A speed of 0 means the capstan is accelerating, so REEL uses firmer tension control. Once the target FPS is reached, REEL softens the control.
While running, CAPS checks REEL for motor faults. A reel motor fault causes an emergency stop of the capstan to prevent the film being pulled against a failed reel.
USER role
USER is the main controller between the operator, CineMaster, and the sbc boards.
CineMaster connects to USER over WiFi using TCP. Only commands and status information are sent over WiFi; video uses a separate connection.
In normal use, USER receives the operator or CineMaster command and sends it to the correct board.
For example, when Pause is pressed, USER tells CAPS to pause. CAPS stops the capstan and tells REEL to tension the film. Once REEL reports tensioned, the scanner is ready to run.
When Forward is pressed, CAPS checks the tension, starts the capstan, and tells REEL to follow it. When Stop is pressed, CAPS slows the capstan and tells REEL to de-tension.
In simple terms, USER coordinates the system, CAPS controls film transport, and REEL controls the reels and tension.
PID/ADRC controllers.
The system uses one PID (OR ADRC) controller per reel motor. The Controllers are recalculating at an interval of 5ms, the two absolute encoders are polled at an interval of 4ms. Due to the physical characteristics of the system—including spring tension, the weight of the dancer assembly, film-reel mass and diameter (which changes throughout the run), film speed and acceleration, reel motor target speed. Acceleration and deadband, tension deadband, effects on magnetic sound flutter — the system has been difficult to tune. At lot of trial and error has been required.
The system is currently using a single PID parameter set that has been tuned to provide stable and reliable performance across all of these scenarios:
#define Scan_Kp 0.55f
#define Scan_Ki 0.7f
#define Scan_Kd 0.1f
The PID implementation supports switching between different parameter sets depending on the operating conditions. However, this functionality is not currently being used, as extensive testing and tuning have shown that a single parameter set provides satisfactory performance across the required operating range.
An ADRC (Active Disturbance Rejection Control) implementation has also been developed as an alternative to the PID controller. While ADRC performs reasonably well, it has not achieved the same level of performance as the PID implementation, but it was much easier to tune. I am also more confident in the PID solution, given the amount of testing and tuning that has been performed on it.
The current ADRC parameters are:
#define ADRC_b0 250.0f
#define ADRC_wc 9.0f
#define ADRC_wo 15.0f