I'm struggling to build a autonomous rover for college degree

Logic equations there are not valid: connecting Pixhawk1 PWM signals to L298N module INx’s doesn’t work since when its level is the same as corresponding other INx it would brake the motor.

So connect Pixhawk1 PWM (on MAIN’s) signals to L298N module EN1/EN2 signals, and Pixhawk1 DIR (AUX’s) signals to L298N module IN1/IN3. If you use the other four Pixhawk1 AUX’s for encoders there will not be available pins, so connect IN1/IN3 (Pixhawk1 DIR’s) to two external TTL inverters and connect the outputs to IN2/IN4. I have tried it and it works. So:

  • PWM’sEN1/EN2.
  • DIR’sIN1/IN3.
  • DIR’s inverted externally (TTL glue) → IN2/IN4.