Commit 7da20d14 authored by Guido Visser's avatar Guido Visser

Tune items added to tune KpKi and show

parent 22a4bef2
/*
* This work is part of the White Rabbit project
*
* (c) 10-09-2020
* Author: Guido Visser <guidov@nikhef.nl>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
......@@ -10,52 +13,37 @@
#include <wrc.h>
#include "softpll_ng.h"
#include "shell.h"
#include "spll_common.h"
#include <TuneGuido.h>
#include "softpll_ng.h"
struct spll_main_state *s;
//struct spll_main_state *s;
static int cmd_tune(const char *args[])
{
int GuidoTemp=0,A=0,B=0;
//pp_printf("Tuning the world\n");
if (!strcasecmp(args[0], "val")){
if (!args[0])
return -EINVAL;
}else if (!strcasecmp(args[0], "kpki")){
if (!args[2])
return -EINVAL;
A=(atoi(args[1]));
Kphpsec = &A;
pp_printf("A:%i\t Aptr: %i\n",A,*Kphpsec);
B=(atoi(args[2]));
Kihpsec = &B;
pp_printf("B:%i\t Bptr: %i\n",B,*Kihpsec);
pp_printf("Entered Kp:%i\t Ki: %i\n",*Kphpsec,*Kihpsec);
spll_set_pi(*Kphpsec,*Kihpsec);
spll_set_pi_kpki(atoi(args[1]),atoi(args[2]));
}else if(!strcasecmp(args[0], "kp")){
if (!args[1])
return -EINVAL;
A=(atoi(args[1]));
Kihpsec = &A;
//pp_printf("A:%i\t Aptr: %i\n",A,*Kphpsec);
spll_set_pi_solo_kp(A);
spll_set_pi_solo_kp((atoi(args[1])));
}else if(!strcasecmp(args[0], "ki")){
if (!args[1])
return -EINVAL;
B=(atoi(args[1]));
Kihpsec = &B;
//pp_printf("A:%i\t Aptr: %i\n",B,*Kihpsec);
spll_set_pi_solo_ki(B);
spll_set_pi_solo_ki((atoi(args[1])));
}else if(!strcasecmp(args[0], "show")){
if (!args[0])
return -EINVAL;
spll_show_kpki();
}else if(!strcasecmp(args[0], "init")){
}else if(!strcasecmp(args[0], "gasopdielolly")){
if (!args[0])
return -EINVAL;
spll_init(3, 0, 0);
spll_set_pi_kpki(-3000,-5);
}else if(!strcasecmp(args[0], "picontrol")){
if (!args[1])
return -EINVAL;
......
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