Controlling px4 witj pwm

Hi, I’m beginner to PX4 autopilot.

I’m trying to find a way to control each motor of the multicopter.

But, currently, all I could find is controlling the multicopter through changing velocity.

So, I’d like to ask if there’s a way to control each motor.

Thanks!

+I apologies if I wrote in the wrong category. I wasn’t rly sure about which category to write this question in.

That’s not so easy because there are generally other control paths working. Can you describe what you actually want to achieve high level?

I’m currently trying to train a drone agent with reinforcement learning, and to do so, I have to create an offline (rule-based) dataset. I’ve already succeeded in training it using high-level information such as using position.

But since my goal is to train it with low-level data, I’ve tried using angular velocity first. But the problem is since PID is applied, I could not get the exact angular velocity value given to the drone (before PID is applied) when creating an offline dataset. Also, since there’s no API to get throttle value, I could not create an offline dataset using angular velocity. So that’s why I was trying to use pwm to train my drone.

The way how I create my offline dataset is:

  1. Using ‘MoveToPosition’ API, move drone from initial position to a random goal.
  2. Collect the data that I want to train the drone with (e.g. position, pwm, etc.) using the API, while drone is conducting the movement commanded by MoveToPosition API.
    (This is the step where I said that I could not get the throttle value)
  3. Repeat this process until I collect sufficient amount of data.

Thanks!

I would consider rate inputs rather than setting the motors individually. The reason is that you need to have a high rate / low latency control signal to the motors and I doubt that will work properly.

Oh I see… Thanks for the reply. I’ll have to change it to rate inputs :slight_smile: