ptz

測試KB-100(即PTZ Keyboard)
了解peclo-d protocol

[KB-100]

更新記錄

item note
20161021 第一版

目錄


PTZ

  • A pan–tilt–zoom camera (PTZ camera) is a camera that is capable of remote directional and zoom control.
  • PTZ攝影機的鏡頭, 可以進行左右轉動(Pan) / 上下傾斜(Tilt) / 放大(Zoom)等不同的功能
  • 如同專業攝影師可以調整Camera 鏡頭的受光度(iris) / focus /角度等
  • 直接使用RS485串接,由PTZ Keyboard控制PTZ Camera動作
    圖片來源: PTZ Camera System Installation[ptz]

PTZ Keyboard可以通過下例protocl跟PTZ Camera通訊
Support: Pelco D, Pelco P, Lilin, EverFocus ,Dynacolor, Hunda and Samsung (以BK-100為例子)

Pelco-D通訊協定

The D protocle

[pelco-d]

The format for a message

byte1 byte2 byte3 byte4 byte5 byte6 byte7
Synch Addr Cmd1 Cmd2 Data1 Data2 ChkSum
1
<0xff> <Addr> <Cmd1> <Cmd2> <Data1> <Data2> <ChkSum>

Sync: 通訊開始,同步訊息(0xff)
Addr: 可以設定camer number(0-255)
Data1: pan speed (0x00- 0x3f), ~0xff turbo speed
Data2: tilt speed (0x00 - 0x3f)
ChkSum: byte2+byte3+byte4+byte5+byte6

THE STANDARD COMMAND SET

standard command

[bit] 7 6 5 4 3 2 1 0
cmd1 Sense:0 0 0 manual scan camera off Iris Close Iris Open Focus Near
Sense:1 0 0 auto scan camera on
cmd2 Focus Far Zoom Wide Zoom Tele Down Up Left Right 0

cmd1.{manual_scan, camer_on, auto_scan, camera_on, iris_close, iris_open, focus_near}
cmd2.{focus_far, zoom_wide(out), zoom_tele(in), down, up, left, right}

Extended CMD

除了上面指令外還有 extended cmd
注意:當cmd2.bit0為1時,此時為extended cmd

cmd1 cmd2 data1 data2
go to preset 00 07 00 設定的點(即按下的數子)
(按下數子,再按preset)

回應cmd只有4個byte => 在目前的應用不會遇(因為只有接KB-100)

1
<0xff> <rec-addr> <alarm-infomation> <chksum>

  • Extended CMD List
[Extended CMD]

KB-100 測試

  • menu on

    1
    ff 05 00 03 00 5f 67 (?)
  • menu off

    1
    ff 05 00 00 01 00 06 (?)
  • menu up (設定menu,之後按2)

    1
    2
    ff 05 00 08 00 01 0e (cmd2.up, 如何由協定知道 這是menu?)
    ff 05 00 00 00 00 05
  • go to preset (按下數子,再按preset)
    ex. 設定70

    1
    ff 05 00 07 00 46 52
  • zoom in (將手把順時鐘轉)

    1
    2
    ff 05 00 20 00 00 25  (cmd2.zoom_tele)
    ff 05 00 00 00 00 05
  • zoom out (將手把逆時鐘轉)

    1
    2
    ff 05 00 40 00 00 45 (cmd2.zoom_wide)
    ff 05 00 00 00 00 05
  • auto foucs off

    1
    ff 05 00 2b 00 02 32

參考