jeffpc,
@jeffpc@mastodon.radio avatar

The project detour number...I lost count...is progressing quite nicely. The goal is to line up the edges. Instead of the brain-dead-simple (too high? -1 too low? +1) logic, I need to write a PID controller (or something like it) to avoid this sort of amusing to watch hunting.

Screen recording of Siglent oscilloscope. 100ns/ 1V/ Shows channel one 1Hz positive edge (and the source of trigger), and channel two a falling edge that's oscillating near the channel 1 edge.

jaseg,
@jaseg@chaos.social avatar

@jeffpc That looks like you have some delay somewhere in your control loop? Otherwise a simple bang bang control shouldn't produce overshoot like that, just an oscillation by +/-1 that can be removed with some hysteresis.

jeffpc,
@jeffpc@mastodon.radio avatar

@jaseg The uC controls a DAC which sets the OCXO's tune pin voltage. There is definitely a delay (1s) between updates, but I think the problem is that I do the +/-1 every time the phase difference is +/-. So, if it takes 5 iterations for the phase diff to change signs, I'll end up with +5/-5 depending on the direction. Which is generally too much.

Today I intend to implement a PID controller...or something approximating one. Even just a P-controller would be a step up.

jeffpc,
@jeffpc@mastodon.radio avatar

@jaseg A simple PD controller is doing better and worse at the same time.

It could be bad constants or bad fixed point math :D

jaseg,
@jaseg@chaos.social avatar

@jeffpc If the bang-bang controller is already oscillating like that, I suspect you might need an integral term to dampen that oscillation.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Electronics
  • kavyap
  • thenastyranch
  • ethstaker
  • InstantRegret
  • osvaldo12
  • DreamBathrooms
  • Durango
  • magazineikmin
  • khanakhh
  • Youngstown
  • everett
  • slotface
  • rosin
  • mdbf
  • provamag3
  • ngwrru68w68
  • tacticalgear
  • cubers
  • GTA5RPClips
  • modclub
  • Leos
  • tester
  • megavids
  • cisconetworking
  • normalnudes
  • anitta
  • JUstTest
  • lostlight
  • All magazines