2022-01-04, 02:06 AM
Hi,
We are using L298N motor driver to drive an actuator using Pypilot.
In Motor.ino file, We set the PWM option pwm_style = 0. When we try connecting Arduino UNO with L298N (IN1-PIN 9, IN2-PIN10), we found the motor NOT running. However, When we given +Vcc to IN1 and GND to IN2 the actuator start extending and for +Vcc to IN2 and GND to IN1 the actuator start retracting.
When we explored the motor.ino further, we found that the motor.ino file is designed such that it needs total 4 pins to connect to H-Bridge controller (2 bottom pins and 2 top pins to connect to H-Bridge motor controller)
#define hbridge_a_bottom_pin 2
#define hbridge_b_bottom_pin 3
#define hbridge_a_top_pin 9
#define hbridge_b_top_pin 10
However, L298N gives only 2 pins apart from ENA pin. (it controls 2 motors and each channel has 2 pins along with a ENA pin).
Hence, this does not match with the motor.ino program. Could you please help me to tweak the motor.ino file.
Also, I believe we should not enable the option pwm_style = 2 for this controller, as that is designed for a different motor controller (VNH2SP30)
Regards
Karthik
We are using L298N motor driver to drive an actuator using Pypilot.
In Motor.ino file, We set the PWM option pwm_style = 0. When we try connecting Arduino UNO with L298N (IN1-PIN 9, IN2-PIN10), we found the motor NOT running. However, When we given +Vcc to IN1 and GND to IN2 the actuator start extending and for +Vcc to IN2 and GND to IN1 the actuator start retracting.
When we explored the motor.ino further, we found that the motor.ino file is designed such that it needs total 4 pins to connect to H-Bridge controller (2 bottom pins and 2 top pins to connect to H-Bridge motor controller)
#define hbridge_a_bottom_pin 2
#define hbridge_b_bottom_pin 3
#define hbridge_a_top_pin 9
#define hbridge_b_top_pin 10
However, L298N gives only 2 pins apart from ENA pin. (it controls 2 motors and each channel has 2 pins along with a ENA pin).
Hence, this does not match with the motor.ino program. Could you please help me to tweak the motor.ino file.
Also, I believe we should not enable the option pwm_style = 2 for this controller, as that is designed for a different motor controller (VNH2SP30)
Regards
Karthik