 // Hardware specific parameters
 // Potentiometer
 #define POT_RANGE_DEG      300 // 300 is the value for standard potentiometer
-#define POT_USED_RANGE_DEG  60 // To 
-#define POT_OFFSET        0.05 // Distance from rotation axis to lever arm
-#define NEUTRAL_ANGLE_DEG  225
+#define POT_USED_RANGE_DEG  60 // To normalize and saturate rotation
+#define POT_OFFSET        0.05 // Distance from rotation axis to lever arm (in m)
+#define NEUTRAL_ANGLE_DEG  225 // Zero of the potentiometer
 // Linear encoder
-#define LINEAR_RESOLUTION 0.005
-#define LINEAR_USED_RANGE 0.05
+#define LINEAR_RESOLUTION 0.005// Resolution of the linear encoder
+#define LINEAR_USED_RANGE 0.05 // To normalize and saturate translation motion
 
 void setup()
 {

// Linear encoder
#define LINEAR_RESOLUTION 0.005
#define LINEAR_USED_RANGE 0.05
void computeFeedback()
{
  
  // Feedbacks are normalized between -1 and 1
  
  // Potentiomete angle
  float rawAngle_deg = analogRead(POT_PIN)/1024.0*POT_RANGE_DEG;
  Input1 = (rawAngle_deg - NEUTRAL_ANGLE_DEG)/POT_USED_RANGE_DEG;
  
  // Linear encoder position
  Input2 = halfSteps*LINEAR_RESOLUTION/2/LINEAR_USED_RANGE;
  // Correct for lever arm (potentiometer not on axis)
  Input2+= (rawAngle_deg - NEUTRAL_ANGLE_DEG)* POT_OFFSET*3.14/180;
  
  // Line tension
  Input3 = analogRead(LINE_TENSION_PIN)/512 - 1;


void sendFeedback()
{
  // All the feedback values are normalized in the range 0-1023 (10 bits resolution)
  if (isFeedbackRequested)
  {
    Serial.print((power1+127)*4);
    Serial.print(", ");
    Serial.print((power2+127)*4);
    Serial.print(", ");
    Serial.print((Input1+1)/2*1023);
    Serial.print(", ");
    Serial.print((Input2+1)/2*1023);
    Serial.print(", ");
    Serial.print((Input3+1)/2*1023);
    Serial.println("");
    isFeedbackRequested = false;
  }
