I am looking to use two motors mounted on both ends of a seesaw stand to do a simple PD test and ensure that my code for stabilizing my pixhawk in pitch is working properly. I currently have the code working, but it is controlling servos and not motors. I was wondering how I would go about controlling motors?

Would I have to change this structure here, from 0 to 3 for the correct motor control group?

struct actuator_controls_s actuators;memset(&actuators, 0, sizeof(actuators));orb_advert_t actuator_pub_ptr = orb_advertise(ORB_ID(actuator_controls_0), &actuators);

This current is the structure I use to control my servos

struct actuator_controls_s actuators;memset(&actuators, 0, sizeof(actuators));orb_advert_t actuator_pub_ptr = orb_advertise(ORB_ID(actuator_controls_3), &actuators);

Would this allow me to control the motors if I am sending value from 0 to 1?
Or could I just use the same structure that I am using for the servos, but control the motors by sending values from -1 to 1?

Also what exactly changes when I choose a different control, group? is there something fundamentally different or is it just a format to more easily understand the code?

Thank you for the help!

Best Regards,

Israel Casillas

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


Liam left a comment on Agricultural UAVs
I'm Liam from T-MOTOR. I would like to reach out to see if there is any possibility for us to work together.
We are a propulsion system manufacturer who offers motors, propellers and ESCs for all kinds of drone applications which vary from secur…"
Jun 30
Richard Cox left a comment on Australia
"Anyone in the DIYDRONES Australian subgroup based in Alice Springs, NT?
I am experimenting with Ardupilot (standard Arduplane), Pixhawk 4 FC in a 4-ch
RC "AXN Floater Jet" foamy plane..."
Jun 29
Omar Sykes left a comment on Australia
"Hi everyone, I am looking for someone who is good at drone building, repair and software in Adelaide. Please give me a call on 0477 319 219."
Jun 29