kurokesu / sce2-sdk Goto Github PK
View Code? Open in Web Editor NEWSCE2-M controller based motorized lenses
License: GNU General Public License v3.0
SCE2-M controller based motorized lenses
License: GNU General Public License v3.0
Hello,
I am using the L084 lens. Is it possible to control the aperture of this camera to different stops? I can control the zoom fine but the have not been able to change aperture size. My code is below, I change the zoom based on keyboard inputs and would like to control the aperture as well.
import sys
import tty
import termios
import os
import grbl_utils
import serial
import time
ser = serial.Serial('/dev/ttyACM1')
# ser.port = '/dev/ttyACM0' # Controller com port
ser.baudrate = 115200 # Baud rate when connected over CDC USB is not important
ser.timeout = 10 # max timeout to wait for command response
ser.close()
ser.open()
ser.flushInput()
ser.flushOutput()
# Read controller version strings
# ver = grbl_utils.send_command(ser, "$I", expecting_lines=3)
# grbl_utils.parse_version(ver[0])
# grbl_utils.parse_adc(ver[1])
# Switch to ABS positionig mode
grbl_utils.send_command(ser, "G90")
# Limit sensor LED ON
# In IR mode should be switched off because of beeding light to sensor
grbl_utils.send_command(ser, "M120 P1")
# IRIS open
grbl_utils.send_command(ser, "M114 P1")
# IR CUT filter
grbl_utils.send_command(ser, "G90 G1 A0.3 F1") # ON (Visible light)
#grbl_utils.send_command(ser, "G90 G1 A0.7 F1") # OFF (Full spectrum)
focus = 0.0
iris = 0.0
keys = ['q', 'w', 'a', 's']
while True:
# Read character from C++ pipe
key = sys.stdin.readline()
if not key:
break
key = key[0]
# adjust focus
if key == keys[0]:
focus -= .05
if key == keys[1]:
focus += .05
# adjust iris
if key == keys[2]:
iris -= 1
if key == keys[3]:
iris += 1
print("focus:" + str(focus) + " | iris:" + str(iris))
cmd = "G90 G1 X0.0 Y0.0 Z" + str(focus) + " F1000"
grbl_utils.send_command(ser, cmd)
grbl_utils.wait_for_idle(ser, echo=False)
# # # # home motors
grbl_utils.send_command(ser, "$HX")
grbl_utils.send_command(ser, "$HY")
grbl_utils.send_command(ser, "$HZ")
# Read GRBL status
status_txt = grbl_utils.read_status(ser)
status = grbl_utils.parse_status(status_txt, print_debug=True)
print("done")
From config.yaml
L085:
debug_keypoints: []
description: 25x 5.3-130mm 1/2.7"
filter1:
name: IR CUT
state_off: G90 G1 A1.5 F1
state_on: G90 G1 A0 F1
iris:
close: M114 P0
open: M114 P1
lens_sku: L085-MZFD-5.3Z130-DIRECT
limit_sensor:
led_off: M120 P0
led_on: M120 P1
motor:
curves:
focal_range:
x: [-19 : 11.74]
y: [5.27 : 143.98]
specs:
focal_length_max: 130
focal_length_min: 5.3
image_circle: 6.8
lpm: 250
Lens L085.
Could you give me a hint, what are -19 and 11.74 mean ? is it min and max positions of the zoom lens in millimeters ? In this case
why do we have negative values (-19 ) and what zero position means ? If I understand correct, -19 corresponds to 5.27 (which is very close to min focus distance 5.3 from specs), but what is 143.98 ? there is 130 mm max focus length in specs.
And there is the similar question about focus group, are y_axis values on the diagram in millimeters and what is zero ?
Maybe you could recommend any literature for this topic ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.