How does QGC know how to steer my tank?

I’ve built a two wheeled land vehicle that steers just like a tank with only two Motors using differential steering. How am I able to tell Q Ground Control how to steer my vehicle when doing autopilot missions? For instance, add power to the right motor to turn left. Add power to the left motor to turn right.

You’ll need to create a custom mixer with yaw (turning) mixed with throttle. https://dev.px4.io/en/concept/mixing.html

I was able to do that in my transmitter and it works just fine. Yaw either adds power to the right or left motor and decreases the other, depending on the direction I’m turning. But I guess I’m still confused about how qgc knows that that’s the method I’m using to steer my vehicle. Do I have to change a few parameters? or upload a custom airframe? Or can I just adjust how the Rover airframe works? I realize this is somewhat vague but any help would be greatly appreciated. I’m a little lost at this point

Thanks

Scott

That’s fine for manual, but you’ll need to do it in the mixer as I described if you want any autonomous or assist modes to work.

Oh ok great. That makes sense. I didn’t realize that QGC had a mixing feature as well. I am very new to this as you can tell, so if I may ask another question… I can’t seem to find where on QGC I would do that mixing??

I seemed to have finally read the correct material on mixing and have a slightly better idea on how everything works. If anyone can verify that I might have done the following mixer correctly I would really appreciate it!(See below). I am using PX4 firmware on a Pixhawk mini (Specifically the Axial Racing AX10 airframe).

This file defines mixers suitable for controlling a “tank-style-steering” rover using
PX4FMU. The configuration assumes the use of 2 motors, one connected to
output 1 and the other connected to output 2 of the Pixhawk Mini. Steering comes from increasing/decreasing
thrust to each respective motor to turn the desired direction

Inputs to the mixer come from control group 0 (vehicle attitude), channels 0 (roll), and 3 (throttle/thrust)

Output 1

M: 2
O: 10000 10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000

Output 2

M: 2
O: 10000 10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 10000
S: 0 0 10000 10000 0 -10000 10000

You’re definitely on the right track (no pun intended?). You’ll want to use yaw though instead of roll.

0 - roll
1 - pitch
2 - yaw
3 - throttle

Great. I appreciate your response. Once the .txt file is saved in the correct location should on my Pixhawk SD card should I be good to go?

You may need to experiment with the directions and ranges in the mixer, but it’s more or less the right shape.

The missing piece is you need a configuration that loads that mixer. For example the configuration for the traxxas stampede is at ROMFS/px4fmu_common/init.d/50002_traxxas_stampede_2wd. You need an equivalent configuration and a line that specifies the mixer.
https://github.com/PX4/Firmware/blob/master/ROMFS/px4fmu_common/init.d/50002_traxxas_stampede_2wd#L56

If you’d like, once you get it working we can add your tank config to PX4 so it’s just a matter of clicking the right box in QGC.

That would be great! Although I was under the impression that I could name my mixer the same as the stampede’s and store it under SD card mixer files and the firmware would chose mine instead (see below)

https://dev.px4.io/en/advanced/system_startup.html

Customizing the System Startup

The best way to customize the system startup is to introduce a new airframe configuration. If only tweaks are wanted (like starting one more application or just using a different mixer) special hooks in the startup can be used.

…By default the system loads the mixer from /etc/mixers. If a file with the same name exists in /fs/microsd/etc/mixers this file will be loaded instead. This allows to customize the mixer file without the need to recompile the Firmware.

Which would be simpler for a beginner such as I??

Yes that’s definitely the easier way to start.

About the mixer file… ROMFS/px4fmu_common/mixers/stampede.main.mix

I see that the stampede mixer file is a “.mix” file. When I google it why is it telling me its a “Microsoft Image Extension”. But I cant believe thats correct. Am i going in the wrong direction? and Why does it seem like people are using .txt files? and for whatever file type it is, how do I edit it and save it correctly without altering the file type.

Thanks

Mixers are just a text file that can be read by the PX4 mixer (not a widespread filetype).

The .txt files can be for placing custom configurations on the sdcard. Either to add additional things to startup, or override only particular pieces.

The mixer file location on the sd card that is mentioned above (…fs/microsd/etc/mixers) isnt on the sd card that came with my pixhawk. Am I just looking in the wrong place? How do I access the place where I store my custom mixer .txt file?

The sdcard is a method for adding your own mixer. There are a number of mixers built into PX4, but they don’t live on the sdcard.