Skip to content

zenointel-sd-2n-4g: run the pan/tilt head at 833 us per microstep - #190

Merged
widgetii merged 1 commit into
masterfrom
sd2n4g-gpiostep-833
Oct 8, 2026
Merged

widgetii merged 1 commit into
masterfrom
sd2n4g-gpiostep-833

Conversation

@widgetii

@widgetii widgetii commented Oct 8, 2026

Copy link
Copy Markdown
Member

Problem

The SD-2N-4G's /etc/gpiostep.conf steps the pan/tilt head at 2000/3000 µs per microstep, about 58 and 41 steps/s. Those values came from the stock config's motor blocks. Their timer 2 (pan) and timer 3 (tilt) are hardware timer numbers, not milliseconds, and the comment presented them as "the stock firmware's motor timers (2 ms pan, 3 ms tilt)".

The stock driver's own speed table runs the same motors at up to 1200 half-steps/s (833 µs). Two firmware changes now make that safe here:

Change

pan_delay_us and tilt_delay_us become 833, and the comment says what the numbers are. Pan gets 2.4× faster, tilt 3.6×.

Hardware tested on

The device itself: GK7205V510 + MIS2009, Zenointel SD-2N-4G head. It ran the #2552 module and the #22 plugin, with these two values set in the camera's own /etc/gpiostep.conf. I did not flash an image built from this branch.

Evidence

Moves were 40 steps out and back, 3 cycles per run. Position was read back from the picture by phase correlation (about 4–5 px per step).

#2552 module, 833 us, single and 2-step-chunked moves, both axes: 12/12 runs, 0 px residual
#2552 module, 700 us: clean; 600 us: steps lost -> the motors' limit here is ~600-650 us
homing at a running delay of 833 us: 23-24 s (the slow rate's time), 3 homings within ~1.5 steps
pad moves through POST /ptz at 833 us: no lost steps over 4 runs (only the constant gearbox backlash)
measured rate through POST /ptz: ~136 steps/s pan

The 2000/3000 us delays came from the stock config's motor blocks, whose
'timer 2' (pan) and 'timer 3' (tilt) are hardware timer numbers, not
milliseconds. On this head the motors run cleanly down to ~650 us now that
gpiostep.ko ramps each move up from rest (OpenIPC/firmware#2552), and
majestic-af homes at 2000/3000 us whatever the running rate is
(OpenIPC/majestic-af#22, pinned by OpenIPC/firmware#2553). 833 us is the
stock firmware's own top speed: pan 2.4x and tilt 3.6x faster than before.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Increase SD-2N-4G pan and tilt cruising speed to 833 µs

⚙️ Configuration changes ✨ Enhancement 🕐 Less than 10 minutes

Grey Divider

AI Description

• Set both pan and tilt cruising delays to 833 µs for faster movement.
• Clarify that movement ramps up from rest and homing retains its slower rate.
Diagram

graph TD
  A["gpiostep.conf"] --> B["majestic-af actuator"] --> C["gpiostep.ko"] --> D["Pan tilt motors"]
Loading
High-Level Assessment

A device-local cruising-rate change is appropriate: it leaves the driver’s ramping behavior and the actuator’s slower homing behavior separate. Changing global driver defaults would affect other devices unnecessarily.

Files changed (1) +6 / -3

Other (1) +6 / -3
gpiostep.confSet both axes to 833 µs cruising delays +6/-3

Set both axes to 833 µs cruising delays

• Reduces pan delay from 2000 to 833 µs and tilt delay from 3000 to 833 µs. Replaces the misleading stock-timer comment with an explanation of cruising speed, driver ramping, and separate slow homing.

devices/gk7205v510_ultimate_zenointel-sd-2n-4g/general/overlay/etc/gpiostep.conf

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit a40b399 into master Oct 8, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant