Need urgent help setting up L298N V2 motor driver and DC Geared Motor using Pixhawk

Hi everyone,

My rover project is using two L298N V2 motor drivers to control 4 JGB37-520 DC Geared Motors.

I am thinking of the Skid-steering mode but I couldn’t set it up. When I tried the Motor Test, nothing happened and it said that “command was denied by autopilot”. Maybe it’s wrong in wiring, I am not very familiar with this electronics stuff. If you have time, please help me in detail with the wiring. I have already read many discussions about this L298 driver on the forum but I couldn’t find the solution.

image


image
image

This is our wiring diagram, further wiring information are below:

Using the skid-steering method, each L298N driver control 2 motors for each side of the rover (left and right).

To connect the L298N driver and Pixhawk, I wired ENA and ENB parallel and connect it to Main Output 1 on Pixhawk (Signal port - the last row). Because I think that ENA/ENB input PMW signal. I wired IN1 parallel IN3, IN2 parallel IN4 (motor A are 1-2 and motor B are 2-4). Then I connected them to the +/- port on Pixhawk (the first and second row).

I see that there is another output method called “Brushed with relay”. But I don’t really know how to wire them.

I am using the Radiolink Pixhawk with ROVER V.4.1.5 firmware via Mission Planner. If you need any more information, please tell me.

I truly appreciate it if you could help me soon. It’s near the deadlines and I have been stuck on this for a few weeks.

Have a nice day. Best wishes.

Hello, just want to ask if you have solved this problem? I have quite a similar issue

1 Like

Hi @johnmeeel,

Unfortunately, the L298N driver is not compatible with Pixhawk as they use different types of PWM signals. The Pixhawk transmits the PWM Servo signal and the L298N driver needs PWM brushed motor signal.

If you really want to use that driver. A solution is to use an intermediate board (Ex: Arduino) to convert the PWM signal. This way is kind of a struggle and needs lots of time.

Another simple solution is to use the ESC for the brushed motor. You just need to plug it in the Pixhawk and the motor, and everything will work out as usual. The ESCs are pretty cheap and I guess you can buy them easily.

Just tell me if you need more help.

1 Like

Yes, I do. Hope you can help me out on this one.

I’m trying to aim a skid steering using Pixhawk, X8R, and L298N Motor.

So question 1, if L298N driver is not compatible with Pixhawk, I’m curious as to why it worked in this video: [ArduRover] 픽스호크 자동차 2WR 세팅 L298N Brush DC Motor Control - YouTube

My professor also asked me to try and search how to work the servo motor and pixhawk’s auxiliary. He said about having it in binary (1,0 or high,low) to configure the skid steering. If both 1 then it’s forward. 1,0 or 0,1 is steer left or right, then 0,0 is stop. The wiring on the servo looks like this one:

Sorry, it’s a lot. I am new to ArduPilot but I’m willing to learn more.