By Brian Kostecka and Michael Jackson
The rhythmic, sweeping motion of legacy pant-tilt-zoom (PTZ) security cameras (Figure 1) meant they weren’t foolproof – an intruder could easily sneak past one after first observing the direction in which it was pointing. Furthermore, overworked security personnel, responsible for simultaneously monitoring multiple camera streams, could easily miss scene changes in a single feed. Modern-day PTZ cameras (Figure 1) are packed with sensors and intelligent image processors capable of autonomously tracking objects in real-time and can automatically alert security personnel to scene changes. However, the motion control systems used in older cameras are no longer fit for purpose and can’t support this functionality. This blog series looks at some of the key design challenges in present-day autonomous tracking PTZ cameras and presents ways in which Trinamic motor control solutions can address them, starting with the requirement for smooth and accurate movement.
Figure 1 A PTZ security camera
Legacy Stepper Motor control algorithms make video streams jerky
A PTZ camera must be able to move horizontally (pan), and vertically (tilt), and to change its field of view (zoom). These planes of motion allow them to survey a much wider area compared to fixed cameras but require three separate motors, each of which must deliver:
Traditionally, stepper motors (Figure 2), driven using a ‘constant off time’ algorithm enabled a camera to move. However, this type of algorithm results in a noticeable torque ripple in the current waveform and creates audible motor noise. Modern stepper motors use micro-stepping, with up to 256 micro steps for every single full step, meaning 51,200 micro-steps for every revolution. This enables much smoother, quieter, and more precise camera movement but running a stepper motor with this level of resolution is difficult for an MCU. For example, to spin a motor at a speed of 10 revolutions per second, the required PWM output step frequency is 512000 Hertz, and finding a microcontroller to do this for several motors is difficult.
Figure 2 Internals of a stepper motor
ADI Trinamic’s Spreadcyle algorithm delivers smooth and precise motion
Analog Devices’ Trinamic team focuses on motion control solutions and has developed a broad range of advanced technologies to control the movement of stepper (and other) motors, including hardware-based motor drivers and motion controllers. They provide a dedicated hardware ramp generator that can be used to produce step frequencies up to 4 MHz. This approach offloads the step profile generation from the main camera microcontroller, allowing it to focus on other tasks like managing the video feed.
In the past, it was common to generate motion using a trapezoidal profile. The motor would constantly accelerate to a defined velocity and maintained it until it reached a constant deceleration phase. The starting and stopping motion caused by this sudden acceleration and deceleration could be seen in the camera’s video feed. To overcome the problem of jerking caused by a trapezoidal algorithm, Trinamic hardware-based motion controllers use a more advanced algorithm called SixPoint ramping. This introduces two acceleration segments and two deceleration segments to the profile. Adding the secondary acceleration (A1) and deceleration (D1) segments (Figure 3) allows for lower acceleration and deceleration at the beginning and end of camera travel, improving the quality of the video feed by allowing the camera’s motor to start and stop moving more smoothly.
Figure 3 Trapezoidal vs. SixPoint Ramping
The main function of a motor driver is to generate the current required to make it spin. The driving MOSFETs must be switched on and off with sufficient precision to ensure the electrical position of the driver is aligned with the mechanical position of the motor. This precise switching ensures that a camera moves in the commanded direction and velocity. If switching is performed incorrectly, the resulting mismatch between the electrical and mechanical positions leads to wasted energy, unwanted noise, and jerky motion. Extreme mismatch (90 degrees or more) can even cause the motor to stall.
ADI Trinamic’s SpreadCycle stepper motor control algorithm uses hysteresis around a target value to deliver a precise drive current, ensuring a smooth zero crossing for the current sine wave at a full step transition. This is important as the full step has a higher torque than microsteps and if not performed correctly, can result in jerky movement. SpreadCycle eliminates jerking at full-step transitions and is ideal for cameras that are required to capture the movements of high-speed intruders!
The next blog in this series addresses the problems of vibration and audible noise in PTZ camera motors. In the meantime, please visit here to learn more about Analog Device’s Trinamic motor control solutions.