self steering parachute

Hi,

I am developing a self-steering parachute the main concept of the system is to pull the left and right toggles of the parachute using servos (0-180) to make the parachute travel to the desired point(relative bearing). This means that the systems should be heading toward bearing all the time. For example, if the desired point is 180 degrees( this is input to the system) and the system is pointing at 90(compass reading ) degrees then relative bearing =180 - 90 = 90 the goal is to keep the heading equal to bearing ie zero relative bearings.

steering the parachute:

left servo pull-down will move the system to the left

right servo pull-down will move the system to the right

and if the system is pointing toward the bearing ie relative bearing equal to 0 then both servos should be pulled at the same time to have a flair (reduce the speed of parachute and loose altitude).

I have written a code that calculates the heading bearing and relative bearing. The problem is that I don’t know how to link the traveling angles(relative bearing, heading ) to the servo movement (pulling the parachute lines).

I don’t understand the relevance of you attachment to the code that you have written.

Please post the code, using code tags when you do

hi please see the attached code to get a better idea

compass_demo_servos_pwm.ino (2.5 KB)

For the sake of others here is the OP’s code

#include <Wire.h>
#include <HMC5883L.h>
#include <PWMServo.h>
////////////////////////////////////////////////////////

///////////////////////////////////////////////////////
HMC5883L compass;

PWMServo myservo ;
PWMServo myservo2 ;
//////////////////////////////////////////////////////
int calcleftactuater(double realbearing)
{
  if (realbearing > 0)
    return 255 ;
  else
    return 1.4245 * realbearing + 255;
}

int calcrightactuater(double realbearing)
{
  if (realbearing <= 0)
    return 255 ;
  else
    return -1.4245 * realbearing + 255;
}
//this is for raw magnatic data
//double calcheading(int x, int y){
// return -atan2(x,y)*180/3.14159265;
//}

void setup()
{
  Serial.begin(9600);
  myservo.attach(11);
  myservo2.attach(12);
  // Initialize Initialize HMC5883L
  Serial.println("Initialize HMC5883L");
  while (!compass.begin())
  {
    Serial.println("Could not find a valid HMC5883L sensor, check wiring!");
    delay(500);
  }
  // Set measurement range
  compass.setRange(HMC5883L_RANGE_1_3GA);
  // Set measurement mode
  compass.setMeasurementMode(HMC5883L_CONTINOUS);
  // Set data rate
  compass.setDataRate(HMC5883L_DATARATE_30HZ);
  // Set number of samples averaged
  compass.setSamples(HMC5883L_SAMPLES_8);
  // Set calibration offset. See HMC5883L_calibration.ino
  compass.setOffset(-334, -286);//-219:-223//
}
//main loop
void loop()
{
  int bearing = 0 ;//target angle my input to the compass  zero means north
  Vector norm = compass.readNormalize();
  //calculaiting heading
  float heading =  atan2(norm.YAxis, norm.XAxis);//where am pointing with respect of north
  // Convert to degrees
  float headingDegrees = heading * 180 / M_PI;
  double realbearing = bearing - headingDegrees ; //the angle between current postion and the desired point
  int leftpower = calcleftactuater (realbearing);
  //int  val = map(val, 0, 255, 0, 179);     // scale it to use it with the servo
  int rightpower = calcrightactuater (realbearing);
  //int var = map(var, 0, 255, 0, 179);
  myservo.write( leftpower);
  myservo2.write(rightpower);
  {
    //Serial.print(" parachute Heading :");  //to desplay on the serial monitor
    //Serial.println(headingDegrees );//to desplay on the serial monitor
    Serial.print(" right actuater power :");
    Serial.print( rightpower);//to desplay on the serial monitor
    Serial.print(" left actuater power :");
    Serial.println(leftpower);//to desplay on the serial monitor
  }
}

OP please note how it is posted

thanks, BTW this is my first post on the forum :)

this is my first post on the forum

So no doubt you saw this sticky post at the top of the page Read this before posting a programming question

Your steering idea works on paper but will have a lot of issues in the air. The trip down is not a steady glide slope from chute deployment to landing. There is a lot of turning away from the target or circling to lose altitude. The ground speed of a rectangular chute is dependent on wind speed and whether it is facing the wind or moving with it. Running with a 10 km/h wind you may have a ground speed of 23 km/h. Into that same wind you will be closer to 3 km/h. Guess which direction you want to be going when landing. :-) Your scheme could easily have you reach the LZ while at 1000 feet, then in an attempt to continue facing the LZ, doing a fast spin into the ground as it keeps one toggle pulled trying to turn back to target.

Steering into the wind also changes the lift. I have seen people at the drop zone literally hovering in high winds. I've made a few jumps and I wouldn't touch this idea. To work you need to constantly be factoring in air speed, ground speed, altitude, rate of decent and heading. All of that would be used to recalculate needed trajectories on a constant basis. Sure, it can be done. But I don't know if a lone microcontroller is up to that task.

Now, if you are throwing GI Joe in the air, no worries.

Alqaraan: I have written a code that calculates the heading bearing and relative bearing. The problem is that I don't know how to link the traveling angles(relative bearing, heading ) to the servo movement (pulling the parachute lines).

This is typically a task for a PID loop. But the overshooting the target problem is a complication to consider.

Flaring when on track is simply going to risk undershoot. Overshooting can be recovered from by turning. Without height-above-ground you have poor awareness, that's a sensor that would be really useful.