How to run DC motor using Pxihawk 4 Controller with px4 firmware?

I want to control the Dc motor through px4 firmware by controlling the output pwm. Is there anyone who can help me to control the PWM duty cycle ratio order to increase the speed of a Dc motor? or is there any other way to control the speed of Dc motor through PWM? 

Right now i know actuator_Control trigger the out pins of the Pixhawk4 from 1 to 8 pin. But when i  subscribe and publish actuator_control[0] the pin 1 of the pixhawk4 out give a pwm out. but the problem is its duty cycle is very low and the frequency of 3.3Vp-p is 50Hz. I know if somehow i can increase the value of duty cycle ratio i will able to gain higher Speed of the Dc motor through its controller. 

But the problem is  How to control the PWM duty cycle ratio? or how to control the speed of the motor?

There is another way i have been thinking that might work but i don't know is it worth it or not? Let discuss that, i think if i somehow manipulate the throttle values the come into pixhawk and after the px4 firmware translate that from -1 to 1 as -1 is slow speed and 0 the mid and 1 is the highest speed. I might control the speed. So my purpose to ask is the what is the object in the px4 firmware which i can subscribe and publish the values according to my on choices. Right now i don't want to control these value through RC controller. I will put the code in simple_app to run through mavlink.

Please if someone knows any solution then do help me.

Views: 353

Reply to This

Replies to This Discussion

You need to use an H-bridge motor controller

Reply to Discussion


© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service