![]() VectorInt16 aaWorld // world-frame accel sensor measurements VectorInt16 aaReal // gravity-free accel sensor measurements VectorInt16 aa // accel sensor measurements Uint8_t fifoBuffer // FIFO storage buffer ![]() Uint16_t fifoCount // count of all bytes currently in FIFO Uint16_t packetSize // expected DMP packet size (default is 42 bytes) Uint8_t devStatus // return status after each device operation (0 = success, !0 = error) Uint8_t mpuIntStatus // holds actual interrupt status byte from MPU #define INTERRUPT_PIN 2 // use pin 2 on Arduino Uno & most boardsīool dmpReady = false // set true if DMP init was successful #if I2CDEV_IMPLEMENTATION = I2CDEV_ARDUINO_WIRE Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation To be sure that updates to the speed and Serial prints aren't the problem, I use an interval of 500 ms between updates/printing. ![]() I'm using a Nema 17 stepper motor with an A4988 driver, a 12 V 10 A power supply, and this Aukru MPU-6050. Also, the author of the example posted essentially the same code as his working solution for proportional control, so there may be something else that I'm missing that messes my motor performance up.ĭoes anyone have any suggestions for how to get the stepper motor turning fast enough while also reading data from the MPU 6050? I imagine the timing of the motor commands is messed up by the sensor reads, but I'm not sure how to avoid the problem. I'm trying to get an inverted pendulum project working (following the instructions here), and while my stepper motor moves the cart just fine when that's the only code in the Arduino sketch, as soon as I add the MPU 6050 sensor for detecting the angle of the pendulum, the cart moves much slower, far too slow to be useful for keeping the pendulum upright. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |