ODrive/Teensy Control: BLDC and Stepper Motor Glitches

I have a project I’m working on where I’m using the ODrive S1 to control a BLDC Hub Motor, and a GeckoDrive G251 to control a stepper motor at the same time. They are being controlled by a Teensy 4.1.

I’m posting about this problem in the ODrive forum to see if anyone has had a similar experience to the following scenario:

  1. ODrive is controlling a Hub motor and the GeckoDrive (or really any other stepper motor driver) is controlling a stepper motor.
  2. The Hub motor is working great (thanks ODrive), and flawlessly can move back and forth without any problems).
  3. The stepper motor is having momentary glitches, where I’m telling it to move between -90 to 90 degrees using a sine wave function in a closed loop control. It’s getting feedback from an absolute encoder.
  4. What’s strange is that if I remove the setup functions from the code for the ODrive (so the light stays blue because it never starting talking to the Teensy), the stepper motor behaves quite well and I see no glitching. When I allow it to start sending UART commands back and forth it seems to glitch like normal. However, I did not comment out the commands telling the ODrive to move in the Main loop (so it still tries to talk to the ODrive even though it’s not setup).

Does anyone have experience with this specific issue, or seen a similar system with glitching/sporadic stepper motor movements?

Happy to answer any questions. My gut is telling me this is a software issue (I’m not using a true state machine), but curious as to what others think.

Hmm, could you show your wiring? A pic and/or a quick wiring diagram would be very helpful. This could definitely be a ground loop issue. Posting code as well would be great!