Commit 4705a190 authored by Peter Jansweijer's avatar Peter Jansweijer

Suboptimal, but working, SPEC7 PLL Kp,Ki

parent cb5b9ac4
Pipeline #330 failed with stages
in 9 seconds
......@@ -17,9 +17,14 @@ void helper_init(struct spll_helper_state *s, int ref_channel)
/* Phase branch PI controller */
s->pi.y_min = 5;
s->pi.y_max = (1 << DAC_BITS) - 5;
#if defined(CONFIG_WR_NODE)
#if defined(CONFIG_WR_NODE) && !defined(CONFIG_TARGET_SPEC7)
s->pi.kp = -150;//(int)(0.3 * 32.0 * 16.0); // / 2;
s->pi.ki = -2;//(int)(0.03 * 32.0 * 3.0); // / 2;
#elif defined(CONFIG_WR_NODE) && defined(CONFIG_TARGET_SPEC7)
// s->pi.kp = -800; // / 2;
// s->pi.ki = -10; // / 2;
s->pi.kp = -750; // / 2;
s->pi.ki = -2; // / 2;
#else
s->pi.kp = 150;
s->pi.ki = 2;
......@@ -32,6 +37,7 @@ void helper_init(struct spll_helper_state *s, int ref_channel)
s->ld.lock_samples = 10000;
s->ld.delock_samples = 100;
s->ref_src = ref_channel;
pp_printf("Helper PLL PI Values: Kp %i\t Ki%i\n",s->pi.kp,s->pi.ki);
}
int helper_update(struct spll_helper_state *s, int tag,
......
......@@ -39,9 +39,14 @@ void mpll_init(struct spll_main_state *s, int id_ref,
s->pi.kp = 1100; // / 2;
s->pi.ki = 30; // / 2;
}
#elif defined(CONFIG_WR_NODE)
#elif defined(CONFIG_WR_NODE) && !defined(CONFIG_TARGET_SPEC7)
s->pi.kp = -1100; // / 2;
s->pi.ki = -30; // / 2;
#elif defined(CONFIG_WR_NODE) && defined(CONFIG_TARGET_SPEC7)
// s->pi.kp = -800; // / 2;
// s->pi.ki = -10; // / 2;
s->pi.kp = -5500; // / 2;
s->pi.ki = -30; // / 2;
#else
#error "Please set CONFIG for wr switch or wr node"
#endif
......@@ -54,6 +59,7 @@ void mpll_init(struct spll_main_state *s, int id_ref,
s->id_ref = id_ref;
s->id_out = id_out;
s->dac_index = id_out - spll_n_chan_ref;
pp_printf("Main PLL PI Values: Kp %i\t Ki%i\n",s->pi.kp,s->pi.ki);
if( s->gain_sched )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment