voxl2_io direct command pwm on channel 5
-
Hi, I've been having trouble trying to set up a pitch gimbal on a voxl2 via channel 5 of the m0065 board. The control is pretty simple, I just need to update the pitch of the gimbal to a static angle once or twice during a mission. I could drive it with a tiny mcu over usb but I kind of want to avoid that as the m0065 board is already necessary in our build
Some things I already tried:
-
Adding some uOrb control messages to the voxl-px4 build (ActuatorMotors, ActuatorServos, GimbalCommand), and sending the corresponding messages to command pitch on channel 5 via microdds bridge
-
Sending a VehicleCommand message with the supposedly correct params isn't even received on the px4 side (output of a listener echo in the mavlink console). This is really weird as I've used vehicle_command to arm / mode switch vehicles before
-
The failure of those methods made me think it's something to do with the gimbal module getting left out of the voxl-px4 SLPI build, so I added it and retried the GimbalCommand and VehicleCommand messages, but to no avail
I have yet to try mavsdk but the failure of all that other stuff doesn't make me too hopeful it's going to work.
Is there a way to directly command a pwm with the voxl2_io module (Either on the slpi side or apps side)? Like "voxl2_io set -c <channel> -v <value>" or something
Thank you!
-
-
Hi @jon ,
Can you please confirm a few items:
- you are not using a modalai ESC and the voxl2_io board is controlling ESCs usign channels 1-4?
- are you able to actuate the channel 5 using QGC actuator test?
- are you able to map an RC switch to control channel 5 using your RC? is that a viable option for you?
I understand your issue, it seems there is some disconnect between the high level API to send the VehicleCommand and the low level voxl2_io driver in px4 running on DSP. If the actuator test and rc mapping is working then, the issue is going to be at a higher level, potentially the VehicleCommand message not getting through from the CPU side of px4 to the DSP. We will check on that.
Alex
-
-
I am not using a modalai ESC. I am directly connecting channel 5 of J1 on the m0065 board to the PWM pin of the servo, and providing power externally. Right now the system is not being flown (it's more of a sensor package) so channels 1-4 are unused, but I tried every method I tried with channel 5 on channel 1 and they didn't work.
-
I am able to actuate the servo on channel 5 with the QGC slider. With the command 'listener vehicle_command' in the px4 shell, I can see that the slider is sending MAV_CMD_ACTUATOR_TEST. However my commands (also sent to vehicle_command over the microdds bridge) do not seem to be interpreted.
-
That is not a viable option, I need to communicate with the VOXL2 over an existing long-range network (similar to doodle labs). I could add the uOrb inputRc message to the voxl-px4 microdds client and try to spoof an RC pwm, but I'm hesitant to believe that will work with everything I've tried already.
I think the problem is the particular VehicleCommand msg I'm sending not making it through as you said. It's just strange though because I've had no issue arming or mode switching vehicles through the same msg on other voxl2 platforms
I'll take it there's no direct way to just write a constant PWM output to the voxl2_io board on the voxl2?
Thanks!
-
-
Hi @jon,
If you can see the message that is generated by QGC, then, in theory, you should be able to send the same message. Maybe the system id of the message you are sending is incorrect or something like this.
Do you need M0065 board talking to PX4 at all? If not, then you can actually connect it to a UART port that is mapped to the VOXL2 cpu and then communicate with the M0065 (voxl2_io) board directly from linux. You would need to find an available UART port, depending on what expansion boards are already plugged into VOXL2..
Also, i am assuming you do need to run PX4, even though you are not flying?
Alex
-
@Alex-Kushleyev Hey thanks for the quick reply,
It's kind of hard to explain but eventually this system will be flown, and I'll need pretty extensive control over what's happening on the px4 side so I'm kind of using this as an exercise to understand how things work. Also trying to keep the hardware consistent with what will fly.
I do want to run voxl-px4 so I can pipe data into EKF2 and see how it responds under certain conditions. Right now we have a standard voxl2 with the ethernet expansion board, and are using the J9 uart for connecting an external sensor, and the J11 superspeed USB for datalogging. Unfortunately I believe this leaves us with no apps proc uarts available, so interacting with it on the SLPI side is the only option.
I'll mess around with other VehicleCommand messages and see if I can get something to show up on the px4 side
-
Hi @jon ,
OK got it. Actually, we already do have a passthrough mode that can accept raw data coming from linux (via voxl io server) and forward it to the UART connection for voxl2_io board, for reference, code is here : https://github.com/modalai/px4-firmware/blob/voxl-dev/src/drivers/voxl2_io/voxl2_io.cpp#L270
Let me figure out (remember) how to use it, I will update you soon.
Alex