I have a sneaking suspicion that Adafruit discontinued the flora 9dof because either they are switching over to the cheaper LSM9DS1. Its essentially the exact same chip, but its a slightly smaller package and not quite as accurate as far as I can tell from googling. They have discontinued their flagship lsm9ds0 breakout in favor of the cheaper chip. I guess I can

1. Use existing boards from work
2. Try to use the cheaper chip
3. Switch to an MPU9250

I want to use a "generic" 9dof, not some "two chip accelerometer" or some niche component so that those who want to follow along or make their own versions can use easy to obtain/understand code.

Here's some new models.

I need to add a body section. Nothing more than a tenon joint, should be easy.



Here's the engine block




***EDIT***

Here's the final build to print. I'll add a nose cone later:



****EDIT****
Now, do I put fins on the bottom like I normally would? If so they should be larger, right?

*****EDIT*****
I'll print the body, housing, and engine block tonight and the coming days. I have to get my wisdom teeth cut out tomorrow, so don't expect updates for a few days.
Hi,

Maybe this link could help ?
https://www.ebay.fr/itm/Adafruit-FLORA-9-DOF-Accelerometer-Gyroscope-Magnetometer-LSM9DS0-v1-0-2020/272280940482?hash=item3f65356fc2:g:kHgAAOSwZMZa1zAm
Ah, thanks, but it seems it doesn't offer delivery to the US. I'm afraid I'll have to find a similar board.
Xcuse me, i didnt know you were in the US.

Maybe you can send a email to the seller to ask him
to do an exception for you and discuss about a price.
Good news! I found a working Flora 9DoF at work today and soldered that up. Later versions will most likely use an MPU9250. But here we go:



I'm using four servos on the pwm pins of the teensy. I'll be using PWMServo (I think) and no multithreading is needed yet.

I need to do a quick redesign of the rocket housing and engine block, and hopefully I'll be that much closer to launch!

Launch day is scheduled to be October 28th, 2018
Well, I think I have all the circuitry ready to assemble tomorrow. I have:

1. Teensy 3.6
2. SD Card
3. LSM9DS0 9DoF
4. 4x 3.7g servos
5. Mini Charge Booster https://www.adafruit.com/product/3661

6. 150mAh LiPo Battery https://www.adafruit.com/product/1317


I am currently printing out the updated housing and I will start the fin designs tonight.
Any input is appreciated!
Well, I did a quick solder job and the stabilization works!


I actually broke off an smd when I was trying to fit the teensy through the slot, but I fixed it with a wire. The next revision of the housing will need a way to have it come apart in two to aid in assembly. For a final version, I really would want everything soldered directly for strong connections. If I try to bend wires up into the body, something shorts out and I don't know what it is. I may have to rebuild this quickly with new parts.

Should I go for it or remake it?
It sounds like you just need strain relief on your solder joints, and possibly some way to plug and unplug components from each other. If you want to go really overkill, you could design your own PCB that has everything you need on it for your project on one board. Then you could have plugs for the servos. That would be really robust but for this project, probably overkill. If you did decide to go that route though, I might be able to help out. I don't know a lot about the teensy but it would be fun to learn!
Botboy3000 wrote:
It sounds like you just need strain relief on your solder joints, and possibly some way to plug and unplug components from each other. If you want to go really overkill, you could design your own PCB that has everything you need on it for your project on one board. Then you could have plugs for the servos. That would be really robust but for this project, probably overkill. If you did decide to go that route though, I might be able to help out. I don't know a lot about the teensy but it would be fun to learn!


Are you offering to etch a power/pin distribution board for the servos/booster?
theprogrammingcube wrote:
Are you offering to etch a power/pin distribution board for the servos/booster?


Ha, no I know nothing about pcb etching Razz I'd be offering to design a board that would plug into the teensy and basically replace all your wires that aren't the ones coming off the servos.
I think I'm going to switch out the teensy for a circuit python board next iteration (will be much smaller). I'm using the teensy mostly for the 3.3v i2c lines at this point. I think I may switch over to the feather because all the power circuitry is in there and its also 3.3v tolerant (and also has bluetooth). The biggest problem right now is the servo solder job, its pretty atrocious.

If you wanted to design a 40mm x 20mm board that includes a place for a flora lsm9ds0 and the mini charge booster, that'd be great!
theprogrammingcube wrote:
If you wanted to design a 40mm x 20mm board that includes a place for a flora lsm9ds0 and the mini charge booster, that'd be great!


I'd need to know your circuit, but I could probably squeeze in some time to do that soon
Sure! I need to draft it up but that shouldn't be too difficult to do. I think I could even add ports for the servos
I think I'm going to redo this assembly. I'm going to try and set up the feather development environment at home this evening. Failing that, I'll rush order another teensy 3.6 and solder servo extensions to it and have a proper ground/power rail from the charge booster to the servos.

***EDIT***

In preparation for revising the housing, I have soldered up a much better "brain". It uses the nRF52 feather (with battery circuitry all there), an MPU9250 9DoF, and a small buck booster I found here at work. The only thing I need to do now is solder the power rails to the booster and add servo connections.




****EDIT****
Because I'm redesigning the housing, I'm going to add in the GPS unit. It should help with the weight.
The project is now up on github. Its not fleshed out well right now (just the code), but I'll get around to it.

https://github.com/ProgrammingCube/GuidedRocket.git
That looks beautiful! honestly, I thought there were more wires than that. You can almost definitely get away without a custom pcb if everything looks like that. Nice work!
Well, here's the "final" soldered hardware:




This weekend will be spent working on the PID system using my trusty arduino uno bench system and "finalizing" the design for the 3d print.

***EDIT***

Here's a mockup of the mockup of the hardware:


Right now, I have a version of the code that seems it will work just fine, but it doesn't use PID tuning (it uses my existing code but maps the angle of the servos to a much smaller range).

When I tried using the arduino PID library, I made a PID object with an input of the angle tilt in degrees, a setpoint angle of 90 degrees, and Kp of 0, Ki of 10, and Kd of 0.

Code:
#include <PID_v1.h>

#include <ArduinoSort.h>
#include <Servo.h>
#include <math.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM9DS0.h>

double Setpoint;
double Input;
double Output;

double Kp=0, Ki=10, Kd=0;

PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);

Adafruit_LSM9DS0 lsm = Adafruit_LSM9DS0(1000);  // Use I2C, ID #1000

Servo canard[4];

uint8_t canard_pin[] = {3, 6, 5, 9};

float offset_x, offset_y;
float angle_x, angle_y;

void configureSensor(void)
{
  lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_2G);
  lsm.setupMag(lsm.LSM9DS0_MAGGAIN_2GAUSS);
  lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_245DPS);
}

void setup() {
  Serial.begin(9600);
  for (uint8_t i = 0; i < 4; i++)
  {
    canard[i].attach(canard_pin[i]);
    canard[i].write(90);
  }

  if(!lsm.begin())
  {
    Serial.print(F("Ooops, no LSM9DS0 detected ... Check your wiring or I2C ADDR!"));
    while(1);
  }
  configureSensor();
  offset_x = getDriftX();
  offset_y = getDriftY();

  Setpoint = 90;
  myPID.SetMode(AUTOMATIC);
  myPID.SetTunings(Kp, Ki, Kd);
}

void loop() {
  sensors_event_t accel, mag, gyro, temp;
  lsm.getEvent(&accel, &mag, &gyro, &temp);

  angle_x = atan(accel.acceleration.y/sqrt((accel.acceleration.x*accel.acceleration.x) + (accel.acceleration.z*accel.acceleration.z)));
  angle_y = atan(accel.acceleration.x/sqrt((accel.acceleration.y*accel.acceleration.y) + (accel.acceleration.z*accel.acceleration.z)));
  float x_angle = ((angle_x - offset_x) * (180 / PI) + 90);
  float y_angle = ((angle_y - offset_y) * (180 / PI) + 90);
  //Serial.print("X Angle: ");
  //Serial.println(angle_x - offset_x);

  Input = x_angle;

  myPID.Compute();

  canard[3].write(180 - Output);

  Serial.print(Input);
  Serial.print(" ");
  Serial.println(Output);
  Serial.print(" ");
  Serial.println(Setpoint);
  /*
  canard[1].write(180 - x_angle);
  canard[3].write(x_angle);
  canard[0].write(y_angle);
  canard[2].write(180 - y_angle);
  */
  //Serial.print("Y Angle: ");
  //Serial.println(angle_y - offset_y);
  //Serial.println(((angle_x - offset_x) * (180 / PI) + 90));
  //Serial.println();
  //Serial.println();
  //delay(500);
}

float getDriftX()
{
  sensors_event_t accel, mag, gyro, temp;
  lsm.getEvent(&accel, &mag, &gyro, &temp);
  float x_array[200];
  for (uint8_t i = 0; i < 200; i++)
  {
    x_array[i] = atan(accel.acceleration.y/sqrt((accel.acceleration.x*accel.acceleration.x) + (accel.acceleration.z*accel.acceleration.z)));
  }
  sortArray(x_array, 200);
  return x_array[100];
}

float getDriftY()
{
  sensors_event_t accel, mag, gyro, temp;
  lsm.getEvent(&accel, &mag, &gyro, &temp);
  //double x_array[200];
  float y_array[200];
  for (uint8_t i = 0; i < 200; i++)
  {
    y_array[i] = atan(accel.acceleration.x/sqrt((accel.acceleration.y*accel.acceleration.y) + (accel.acceleration.z*accel.acceleration.z)));
  }
  sortArray(y_array, 200);
  return y_array[100];
}


What ends up happening is that the fins will move ALL the way over to the left or right when I tilt the body. If I wiggle it back and forth, the fins will "appear" to work, but when I stop moving it, instead of pointing straight up, the fins will continue on their merry way to the side they were approaching.
Also, the servo movement is very jumpy.
So as I'm battling the Arduino Uno front with PIDs, I have a whole different issue with the feather.

https://i.imgur.com/PLefHrH.gifv

What I'm doing is writing to serial the LAST value I sent to the servos (servo.write()), which is the angle in degrees to spin to. As you can see, apparently I'm writing to the servos correctly but absolutely nothing is happening on the servos themselves. Sometimes they work, sometimes for a while, other times not at all.

I am powering the servos off of an external battery and boost circuit. What could be happening? Are they not getting enough power? Why do they work fine sometimes and not other times?

Also, sometimes the servos spin way further than they should, although there is nothing to suggest that this should happen.

Should I cut my losses and use a different board?
So, the final hardware/software is almost done. I need to rework some models this evening and start their prints. The software is finished, at least the software I'll use for the first launch. I am already thinking about version 2 of this project.

I will use a simple arduino nano, as there is no need for anything fancier. It will be able to take in the 7.2 volts from a 2 cell battery directly, and if it is anything like the uno, it can power four servos itself. The nano is also much smaller.

I will redesign the rocket housing from the ground up using more advanced modelling techniques (surface modelling vs body modelling). I will have actual hollows and locations for the different circuitry inside the rocket, so it will be much more robust and resilient.

The goal here is to get something that I can print it in a day and assemble it within minutes. As of now, I'll continue with the bluefruit feather.


Final rocket body version 1:
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement