Commit 4ddcbf61 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Merge branch 'jeroen' into corso2013

Conflicts:
	controller/block/block_rangecheck.c
parents 665342ad 9288e273
......@@ -44,13 +44,13 @@ struct controller_block_private {
float max;
};
static void calculate(struct controller_block *check)
static void rangecheck_calculate(struct controller_block *check)
{
struct controller_block_private *priv = check->private;
float in = *priv->in;
bool invalid;
invalid = in < priv->min || in > priv->max;
invalid = (in < priv->min) | (in > priv->max);
priv->invalid = invalid;
priv->valid = !invalid;
......@@ -116,15 +116,15 @@ struct controller_block * block_rangecheck_create(char *name)
check->private->min = 0.0;
if (controller_block_interm_list_init(check, interms))
goto err_inputs;
goto err_block;
if (controller_block_outterm_list_init(check, outterms))
goto err_outputs;
goto err_block;
check->calculate = calculate;
check->calculate = rangecheck_calculate;
if (controller_block_param_list_init(check, params))
goto err_params;
goto err_block;
check->param_get = param_get;
check->param_set = param_set;
......@@ -132,13 +132,7 @@ struct controller_block * block_rangecheck_create(char *name)
controller_block_add(check);
return check;
err_params:
free(check->output);
err_outputs:
free(check->input);
err_inputs:
free(check->private);
free(check->name);
free(check);
err_block:
controller_block_free(check);
return NULL;
}
......@@ -41,6 +41,7 @@ blocks {
{ "value", "azimuth_position_offset" }
{ "add", "azimuth_position_offset_sum" }
{ "gain", "azimuth_position_gain" }
{ "rangecheck", "azimuth_speed_warning" }
{ "matrix_2x2", "elevation_input_matrix" }
{ "setpoint_generator", "elevation_spg", "Elevation_Setpoint", "rad" }
......@@ -103,7 +104,8 @@ links {
{ "azimuth_speed_servo", "out", "dt_az", "speed" , true }
{ "azimuth_safety", "torque_out", "dt_az", "torque" , true }
{ "azimuth_servo_state", "enable", "dt_az", "enable" , true }
{ "false", "value", "dt_az", "ba1" , true }
{ "dt_az", "speed", "azimuth_speed_warning", "in" , true }
{ "azimuth_speed_warning", "invalid", "dt_az", "ba1" , true }
{ "false", "value", "dt_az", "ba2" , true }
{ "elevation_servo_state", "reset", "elevation_spg", "reset" , false }
......@@ -257,6 +259,9 @@ params {
(float) { 1.0, 2.0 }
}
{ "azimuth_speed_warning", "max", (double) rpm2rads(200.0) }
{ "azimuth_speed_warning", "min", (double) rpm2rads(-200.0) }
# Due to high vibrations observed at high speed it was decided to limit
# the pid controller. At low speed the value is untouched, but the
# output is limited when speed increases
......
Supports Markdown
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