Jump to content
I2Cdevlib Forums


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by edorphy

  1. Limon, I can't exactly answer your PI equation, that part of the project is my group members' responsibility. Our instructor has told us to use a PI controller for each motor independently. If you look at a lot of the open source quadcopter projects, they implement a PID for roll/pitch/yaw and these correction values get put into a motor control loop. The idea that our instructor wants us to implement is take the new motor values, as inputs to a motor PI loop using an RPM detection algorithm that we came up with. Basically the following is comprised of PID for r p and y. Our goal is to add a PI at the end of the set of equations below to improve reaction time of the motors. motorCommand[FRONT_LEFT] = throttle - motorAxisCommandPitch + motorAxisCommandRoll - (YAW_DIRECTION * motorAxisCommandYaw); motorCommand[FRONT_RIGHT] = throttle - motorAxisCommandPitch - motorAxisCommandRoll + (YAW_DIRECTION * motorAxisCommandYaw); motorCommand[REAR_RIGHT] = throttle + motorAxisCommandPitch - motorAxisCommandRoll - (YAW_DIRECTION * motorAxisCommandYaw); motorCommand[REAR_LEFT] = throttle + motorAxisCommandPitch + motorAxisCommandRoll + (YAW_DIRECTION * motorAxisCommandYaw); This code was adapted from aeroquad code.
  2. I'm designing a quadcopter at school and we are using an Arduino Mega, it has 6 INT pins, 2 share the I2C pins, and the other 4 are being used for RPM detection, we are implementing a PI controller for each motor as well as a roll/pitch PID controller for correction estimations. I'm currently reading raw values for gyro and accel when I want to (polling) and fusing them together using the complimentary filter to describe the YPR attitude. Unfortunately, my fusion is not as accurate as I had hoped it to be. Is there a quick and easy way to poll the DMP? I'm thinking that it is possible to poll without an interrupt with data available/ready in the FIFO. I have looked at the dmpGetQuaterian and dmpGetYPR methods but not sure if its as simple as that. I would poll the MPU every loop (its okay if it still has the last value as long as there is a value) and I will be executing a PID loop on an interval of about 100 Hz. Thanks in advance for any help provided!
  3. I tried this out and it improved my mpu data fusion tremendously, however the RMS of the accelerations can now be greater than 1 at rest. Theory says something like the following: sqrt( sq(accelX/accel_sensitivity) + sq(accelY/accel_sensitivity) + sq(accelZ/accel_sensitivity) ) while at rest the only acceleration felt by the system would be 1 G (gravity itself), therefore the above equation should be "exactly" 1. It has been one of my tests while at rest. Not sure if it would be something you would like to incorporate into your calibration algorithm. It shouldn't affect things too vastly, but thought it was worthy of mention.
  • Create New...