OIS (Optical Image Stabilization) is a smartphone image testing device. It reduces camera shake by detecting camera movement and applying compensating offsets to the lens or sensor. This minimizes image instability caused by camera shake, reduces image blur, allows for faster shutter speeds, and ultimately leads to significant image quality improvements.
Sine and cosine motion: Simulating sine and cosine functions, making the position, velocity, and acceleration of the shaft exhibit sine and cosine variations. This helps reduce shock and vibration in equipment and improves stability.
It is widely used in industries such as 3C electronics, for example, in OIS testing equipment for mobile phone cameras, to simulate shaking at different angles and frequencies to achieve image stabilization testing.
01. Leadshine Solution
Leadshine control card/controller (both pulse bus supported) + Leadshine L7L direct drive servo driver + DDR motor.
On the OIS testing equipment for mobile phone cameras, vibrations at different angles and frequencies are simulated to achieve image stabilization testing.
02. Cosine wave motion
1. Parameter settings
2. Motion Curve
Position-time curve of single-axis cosine oscillating motion
Velocity-time curve of single-axis cosine oscillating motion
3. Application Scenarios
Compared to sinusoidal motion, the change in axial velocity is gradual and without abrupt changes.
03. Sine Wave Motion
1. Parameter settings
2. Motion curve
Position-time curve of single-axis sinusoidal oscillating motion
Velocity-time curve of single-axis sinusoidal oscillating motion
3. Application Scenarios
The starting point of the oscillating motion is in the middle position.
04. Functional source code examples
The control card and controller are used in the same way; you only need to change the beginning of the Leadsai API command to "LTSMC.smc".
Brief instructions for use:
① Set sine and cosine motion modes
② Set the number of sine and cosine motion periods
③ Initiate sine and cosine motion
④ Stop sine and cosine motion
05. Detailed Explanation of Leadshine API Commands
1.short dmc_sine_oscillate_set_mode(WORD ConnectNo, WORD Axis, WORD mode)
Function: Set sine and cosine oscillation mode
Parameter: ConnectNo specifies the connection number (0-254), default value is 0.
Axis specifies the axis number, ranging from 0 to the actual axis number - 1.
Mode: 0: Position and time are represented by a sine curve; 1: Position and time are represented by a cosine curve.
Return value: Error code
2.short dmc_sine_oscillate_set_mode(WORD ConnectNo, WORD Axis, WORD *mode)
Function: Read sine and cosine oscillation patterns
Parameter: ConnectNo specifies the connection number (0-254), default value is 0.
Axis specifies the axis number, ranging from 0 to the actual axis number - 1.
Mode: 0: Position and time are represented by a sine curve; 1: Position and time are represented by a cosine curve.
Return value: Error code
3.short dmc_sine_oscillate_set_cycle_num (WORD ConnectNo, WORD Axis, WORD cycle_num)
Function: Set the number of cycles for sine and cosine motion.
Parameter: ConnectNo specifies the connection number (0-254), default value is 0.
Axis specifies the axis number, ranging from 0 to the actual axis number - 1.
cycle_num indicates the number of cycles, where 0 indicates an unlimited number of cycles.
Return value: Error code
4.short dmc_sine_oscillate_get_cycle_num (WORD ConnectNo, WORD Axis, WORD *cycle_num)
Function: Read the number of cycles of sine and cosine motion.
Parameter: ConnectNo specifies the connection number (0-254), default value is 0.
Axis specifies the axis number, ranging from 0 to the actual axis number - 1.
`cycle_num` represents the number of cycles; a value of 0 indicates the number of cycles in unlimited motion.
Return value: Error code
5.short dmc_sine_oscillate_unit (WORD ConnectNo, WORD Axis, double Amplitude, double Frequency)
Function: Initiate sine and cosine curve motion
Parameter: ConnectNo specifies the connection number (0-254), default value is 0.
Axis specifies the axis number, ranging from 0 to the actual axis number - 1.
Amplitude, unit: unit
Frequency refers to the number of times a complete sine or cosine curve oscillates per second.
Return value: Error code
6.short dmc_sine_oscillate_stop (WORD ConnectNo, WORD Axis)
Function: Stop sine and cosine curve motion
Parameter: ConnectNo specifies the connection number (0-254), default value is 0.
Axis specifies the axis number, ranging from 0 to the actual number of axes - 1.
Return value: Error code
Notice:
1. When using `smc_sine_oscillate_stop` to stop, the current cycle will be completed, and the movement will stop at the starting point.
2. Using smc_emg_stop will trigger an emergency stop, immediately stopping at the current position.
If you require information related to the above features, please leave a comment or contact us via private message. Thank you for your attention!
END