diff --git a/quad/sw/modular_quad_pid/src/computation_graph.c b/quad/sw/modular_quad_pid/src/computation_graph.c
index b4ff9ed9c10b3956ed2f586c7e3fab989e5f550d..df690a41c9b95ed05623ea8b90e813e09e387026 120000
--- a/quad/sw/modular_quad_pid/src/computation_graph.c
+++ b/quad/sw/modular_quad_pid/src/computation_graph.c
@@ -1 +1 @@
-computation_graph/src/computation_graph.c
\ No newline at end of file
+/local/ucart/MicroCART_17-18/quad/computation_graph/src/computation_graph.c
\ No newline at end of file
diff --git a/quad/sw/modular_quad_pid/src/computation_graph.h b/quad/sw/modular_quad_pid/src/computation_graph.h
index b8b749d0f0e89c67392f7d4d610cddf7e44bb374..aa22c46fb4337487b08179c2369006b41cff9be8 120000
--- a/quad/sw/modular_quad_pid/src/computation_graph.h
+++ b/quad/sw/modular_quad_pid/src/computation_graph.h
@@ -1 +1 @@
-computation_graph/src/computation_graph.h
\ No newline at end of file
+/local/ucart/MicroCART_17-18/quad/computation_graph/src/computation_graph.h
\ No newline at end of file
diff --git a/quad/sw/modular_quad_pid/src/control_algorithm.c b/quad/sw/modular_quad_pid/src/control_algorithm.c
index 757cc8a9b628a10fd5a547bdb9ed6730766f28a7..0e52083f08ba42f1fc1002fd60b86d81a310ec17 100644
--- a/quad/sw/modular_quad_pid/src/control_algorithm.c
+++ b/quad/sw/modular_quad_pid/src/control_algorithm.c
@@ -21,43 +21,43 @@
     ps->graph = graph;
 
     // Create all the PID blocks
-    ps->roll_pid = graph_add_node_pid("Roll PID");
-    ps->pitch_pid = graph_add_node_pid("Pitch PID");
-    ps->yaw_pid = graph_add_node_pid("Yaw PID");
-    ps->roll_r_pid = graph_add_node_pid("Roll Rate PID");
-    ps->pitch_r_pid = graph_add_node_pid("Pitch Rate PID");
-    ps->yaw_r_pid = graph_add_node_pid("Yaw Rate PID");
-    ps->x_pos_pid = graph_add_node_pid("X pos PID PID");
-    ps->y_pos_pid = graph_add_node_pid("Y pos PID");
-    ps->alt_pid = graph_add_node_pid("Altitude");
+    ps->roll_pid = graph_add_node_pid(graph, "Roll PID");
+    ps->pitch_pid = graph_add_node_pid(graph, "Pitch PID");
+    ps->yaw_pid = graph_add_node_pid(graph, "Yaw PID");
+    ps->roll_r_pid = graph_add_node_pid(graph, "Roll Rate PID");
+    ps->pitch_r_pid = graph_add_node_pid(graph, "Pitch Rate PID");
+    ps->yaw_r_pid = graph_add_node_pid(graph, "Yaw Rate PID");
+    ps->x_pos_pid = graph_add_node_pid(graph, "X pos PID PID");
+    ps->y_pos_pid = graph_add_node_pid(graph, "Y pos PID");
+    ps->alt_pid = graph_add_node_pid(graph, "Altitude");
 
     // Create blocks for sensor inputs
-    ps->cur_pitch = graph_add_node_const("Pitch");
-    ps->cur_roll = graph_add_node_const("Roll");
-    ps->cur_yaw = graph_add_node_const("Yaw");
+    ps->cur_pitch = graph_add_node_const(graph, "Pitch");
+    ps->cur_roll = graph_add_node_const(graph, "Roll");
+    ps->cur_yaw = graph_add_node_const(graph, "Yaw");
 	// Yaw angular velocity PID
     // theta_dot is the angular velocity about the y-axis
     // phi_dot is the angular velocity about the x-axis
 	// psi_dot is the angular velocity about the z-axis
 	// These are calculated from using the gimbal equations
-    ps->theta = graph_add_node_const("Theta");
-    ps->phi = graph_add_node_const("Phi");
-    ps->psi = graph_add_node_const("Psi");
+    ps->theta = graph_add_node_const(graph, "Theta");
+    ps->phi = graph_add_node_const(graph, "Phi");
+    ps->psi = graph_add_node_const(graph, "Psi");
 
     // Create blocks for RC controller
-    ps->rc_pitch = graph_add_node_const("RC Pitch");
-    ps->rc_roll = graph_add_node_const("RC Roll");
-    ps->rc_yaw = graph_add_node_const("RC Yaw");
-    ps->rc_throttle = graph_add_node_const("RC Throttle");
+    ps->rc_pitch = graph_add_node_const(graph, "RC Pitch");
+    ps->rc_roll = graph_add_node_const(graph, "RC Roll");
+    ps->rc_yaw = graph_add_node_const(graph, "RC Yaw");
+    ps->rc_throttle = graph_add_node_const(graph, "RC Throttle");
 
-    ps->dt = graph_add_node_const("dT");
+    ps->dt = graph_add_node_const(graph, "dT");
 
     // Connect pitch PID chain
     graph_set_source(graph, ps->pitch_r_pid, PID_SETPOINT, ps->pitch_pid, PID_CORRECTION);
     graph_set_source(graph, ps->pitch_r_pid, PID_CUR_POINT, ps->theta, CONST_VAL);
     graph_set_source(graph, ps->pitch_r_pid, PID_DT, ps->dt, CONST_VAL);
     graph_set_source(graph, ps->pitch_pid, PID_SETPOINT, ps->rc_pitch, CONST_VAL);
-    graph_set_source(graph, ps->pitch_pid, PID_CUR_POINT, ps->pitch, CONST_VAL);
+    graph_set_source(graph, ps->pitch_pid, PID_CUR_POINT, ps->pitch_pid, CONST_VAL);
     graph_set_source(graph, ps->pitch_pid, PID_DT, ps->dt, CONST_VAL);
 
      // Connect roll PID chain
@@ -65,7 +65,7 @@
     graph_set_source(graph, ps->roll_r_pid, PID_CUR_POINT, ps->phi, CONST_VAL);
     graph_set_source(graph, ps->roll_r_pid, PID_DT, ps->dt, CONST_VAL);
     graph_set_source(graph, ps->roll_pid, PID_SETPOINT, ps->rc_roll, CONST_VAL);
-    graph_set_source(graph, ps->roll_pid, PID_CUR_POINT, ps->roll, CONST_VAL);
+    graph_set_source(graph, ps->roll_pid, PID_CUR_POINT, ps->roll_pid, CONST_VAL);
     graph_set_source(graph, ps->roll_pid, PID_DT, ps->dt, CONST_VAL);
 
     // Connect yaw PID chain
@@ -219,9 +219,9 @@
 
     graph_set_param_val(graph, parameter_struct->cur_pitch, CONST_SET, sensor_struct->pitch_angle_filtered);
     graph_set_param_val(graph, parameter_struct->cur_roll, CONST_SET, sensor_struct->roll_angle_filtered);
-    graph_set_param_val(graph, parameter_struct->cur_theta, CONST_SET, sensor_struct->theta_dot);
-    graph_set_param_val(graph, parameter_struct->cur_phi, CONST_SET, sensor_struct->phi_dot);
-    graph_set_param_val(graph, parameter_struct->cur_psi, CONST_SET, sensor_struct->psi_dot);
+    graph_set_param_val(graph, parameter_struct->theta, CONST_SET, sensor_struct->theta_dot);
+    graph_set_param_val(graph, parameter_struct->phi, CONST_SET, sensor_struct->phi_dot);
+    graph_set_param_val(graph, parameter_struct->psi, CONST_SET, sensor_struct->psi_dot);
 
     graph_set_param_val(graph, parameter_struct->rc_pitch, CONST_SET, user_input_struct->pitch_angle_manual_setpoint);
     graph_set_param_val(graph, parameter_struct->rc_roll, CONST_SET, user_input_struct->roll_angle_manual_setpoint);
diff --git a/quad/sw/modular_quad_pid/src/graph_blocks/node_bounds.h b/quad/sw/modular_quad_pid/src/graph_blocks/node_bounds.h
index 15415488f46e61d425931d9b363c9fc6479d750a..7c8b7e92cea2278b4384b137fabb32bf901c6b29 100644
--- a/quad/sw/modular_quad_pid/src/graph_blocks/node_bounds.h
+++ b/quad/sw/modular_quad_pid/src/graph_blocks/node_bounds.h
@@ -1,6 +1,6 @@
 #ifndef __NODE_BOUNDS_H__
 #define __NODE_BOUNDS_H__
-#include "computation_graph.h"
+#include "../computation_graph.h"
 
 int graph_add_node_bounds(struct computation_graph *graph, const char* name);
 
diff --git a/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.c b/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.c
deleted file mode 120000
index 0e47b26d1b909f68d792a4d8326da82893ffb76a..0000000000000000000000000000000000000000
--- a/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.c
+++ /dev/null
@@ -1 +0,0 @@
-computation_graph/src/node_constant.c
\ No newline at end of file
diff --git a/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.c b/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.c
new file mode 100644
index 0000000000000000000000000000000000000000..47ab571d5636d45c7e27ff3d47c45f3e7f305e38
--- /dev/null
+++ b/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.c
@@ -0,0 +1,25 @@
+#include "node_constant.h"
+#include <stdlib.h>
+
+static void output_const(void *state, const double *params, const double *inputs, double *outputs) {
+    outputs[CONST_VAL] = params[CONST_SET];
+}
+static void reset(void *state) {}
+
+static const char* const in_names[0] = {};
+static const char* const out_names[1] = {"Constant"};
+static const char* const param_names[1] = {"Constant"};
+const struct graph_node_type node_const_type = {
+        .input_names = in_names,
+        .output_names = out_names,
+        .param_names = param_names,
+        .n_inputs = 0,
+        .n_outputs = 1,
+        .n_params = 1,
+        .execute = output_const,
+        .reset = reset
+};
+
+int graph_add_node_const(struct computation_graph *graph, const char* name) {
+    return graph_add_node(graph, name, &node_const_type, NULL);
+}
diff --git a/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.h b/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.h
deleted file mode 120000
index a231d9af0f982561c18f45fe9838f5e2862a7610..0000000000000000000000000000000000000000
--- a/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.h
+++ /dev/null
@@ -1 +0,0 @@
-computation_graph/src/node_constant.h
\ No newline at end of file
diff --git a/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.h b/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.h
new file mode 100644
index 0000000000000000000000000000000000000000..91cd6d055b6bbf64340df4282ac9f9539301f0a5
--- /dev/null
+++ b/quad/sw/modular_quad_pid/src/graph_blocks/node_constant.h
@@ -0,0 +1,16 @@
+#ifndef __NODE_CONSTANT_H__
+#define __NODE_CONSTANT_H__
+#include "../computation_graph.h"
+
+int graph_add_node_const(struct computation_graph *graph, const char* name);
+
+extern const struct graph_node_type node_const_type;
+
+enum graph_node_const_params {
+    CONST_SET
+};
+
+enum graph_node_const_outputs {
+    CONST_VAL
+};
+#endif //__NODE_CONSTANT_H__
diff --git a/quad/sw/modular_quad_pid/src/graph_blocks/node_pid.c b/quad/sw/modular_quad_pid/src/graph_blocks/node_pid.c
index 745cf0dad11b68a7611885db034d76aeb0bccf66..416480c0472567ccd8db0204dae2ce9892e462b2 100644
--- a/quad/sw/modular_quad_pid/src/graph_blocks/node_pid.c
+++ b/quad/sw/modular_quad_pid/src/graph_blocks/node_pid.c
@@ -1,5 +1,9 @@
 #include "node_pid.h"
 #include <stdlib.h>
+#include <math.h>
+
+static double FLT_EPSILON = 0.0001;
+
 
 struct pid_node_state {
     double prev_error; // Previous error
@@ -39,7 +43,7 @@ static void pid_computation(void *state, const double* params, const double *inp
 
     // Accumulate the error (if Ki is less than epsilon, rougly 0,
     // then reset the accumulated error for safety)
-    if (fabs(pid->Ki) <= FLT_EPSILON) {
+    if (fabs(params[PID_KI]) <= FLT_EPSILON) {
       pid_state->acc_error = 0;
     } else {
       pid_state->acc_error += error;
@@ -49,12 +53,12 @@ static void pid_computation(void *state, const double* params, const double *inp
 
     // Compute each term's contribution
     P = params[PID_KP] * error;
-    I = params[PID_KI] * pid->acc_error * inputs[PID_DT];
+    I = params[PID_KI] * pid_state->acc_error * inputs[PID_DT];
     D = params[PID_KD] * (change_in_error / inputs[PID_DT]);
 
     pid_state->prev_error = error; // Store the current error into the state
 
-    output[PID_CORRECTION] = P + I + D; // Store the computed correction
+    outputs[PID_CORRECTION] = P + I + D; // Store the computed correction
 }
 
 // This function sets the accumulated error and previous error to 0
@@ -82,7 +86,7 @@ const struct graph_node_type node_accum_type = {
 
 int graph_add_node_pid(struct computation_graph *graph, const char* name) {
     struct pid_node_state* node_state = malloc(sizeof(struct pid_node_state));
-    if (sizeof(struct accum_state) && !node_state) {
+    if (sizeof(struct pid_node_state) && !node_state) {
         return -1; // malloc failed
     }
     return graph_add_node(graph, name, &node_accum_type, node_state);
diff --git a/quad/sw/modular_quad_pid/src/graph_blocks/node_pid.h b/quad/sw/modular_quad_pid/src/graph_blocks/node_pid.h
index ce87339b7f39adc410263b48005539f8fac47da2..75ded4af02edbc2cacbc68035f5a0970d65e38dc 100644
--- a/quad/sw/modular_quad_pid/src/graph_blocks/node_pid.h
+++ b/quad/sw/modular_quad_pid/src/graph_blocks/node_pid.h
@@ -1,6 +1,6 @@
 #ifndef __NODE_PID_H__
 #define __NODE_PID_H__
-#include "computation_graph.h"
+#include "../computation_graph.h"
 
 int graph_add_node_pid(struct computation_graph *graph, const char* name);
 
diff --git a/quad/sw/modular_quad_pid/src/type_def.h b/quad/sw/modular_quad_pid/src/type_def.h
index acc5815903d4b63695013cab39c3bc84382700b9..c8af65906ef2403bd0a0fb79101e3344b5f6114f 100644
--- a/quad/sw/modular_quad_pid/src/type_def.h
+++ b/quad/sw/modular_quad_pid/src/type_def.h
@@ -1,24 +1,4 @@
-int roll_pid =
-int pitch_pid =
-int yaw_pid = g
-int roll_r_pid
-int pitch_r_pid
-int yaw_r_pid =
-int x_pos_pid =
-int y_pos_pid =
-int alt_pid = g
-// Create block
-int cur_pitch =
-int cur_roll =
-int cur_yaw = g
-int theta = gra
-int phi = graph
-int psi = graph
-// Create block
-int rc_pitch =
-int rc_roll = g
-int rc_yaw = gr
-int rc_throttle/*
+/*
  * struct_def.h
  *
  *  Created on: Mar 2, 2016