Using the MPU9250 with a complex sketch running 8 motors via UART. Compatibility

Status
Not open for further replies.

laptophead

Well-known member
I developed this huge sketch for running a walking robot. 8 motors interfaced by 4 Serial ports.
Everything refreshes at 10 mS. Reading encoders, sending commands.

The time came to ad an IMU, every robot must balance dynamically, not just repeat mechanical motions.

The IMU works fine if I run it every 200mS , (see Read_Mitch_IMU();) but thats super slow. I'd want to run it at 10mS so I have time to react to imbalance ....

If I read encoders the IMU simply won't start, unless I power the motors after I start the teensy 4.1.

Even then, When I send commands to the motors, they are all berserk and erroneous if the IMU refresh is active...

What to do, Can we all get along?
Thanks

Sorry for the big sketch, but that is what is it takes.
 

Attachments

  • RS485_Command_33_IMU.zip
    25.3 KB · Views: 37
  • Screen Shot 2020-09-28 at 8.02.14 PM.jpg
    Screen Shot 2020-09-28 at 8.02.14 PM.jpg
    111.1 KB · Views: 43
Status
Not open for further replies.
Back
Top