How to decrease the delay in either MAV.setMountControl or Script.SendRC commands in order to move the Strom32 Gimbal motors faster?

Hi,

So, I recently discovered how to control my strom32 gimbal controller via a python script ran in Mission Planner. My code functions correctly and moves the gimbal to the desired angle. However, as of now the gimbal position doesn’t change until almost a whole 2 seconds after the MAV.setMountControl or Script.SendRC commands are executed in the python script running in Mission Planner. This is a huge problem for me because I am using my video camera’s video feed to target a releasable payload.

If anyone knows of a way to decrease this delay by as much as possible, please let me know!

Hardware Setup:
Mission Planner ArduPlane:

Using MAV.setMountControl: Pixhawk 2 -> Serial Port 2 -> UART Port on Strom32
Usage in Mission Planner Python script:
MAV.setMountControl( PitchValue, RollValue, YawValue, False)
MAV.setDigicamControl(1)

Using servo pins with Script.SendRC: Pixhawk 2 -> Selected Servo Pin # -> Strom32 RC2 Port
Usage in Mission Planner Python script: Script.SendRC(8,parmValue,True)

P.S.: I only want to control the Pitch of my gimbal via Mission Planner, while using the gimbal’s sensor for roll.

Thank you!

Script.SendRC(8,parmValue,True)

the true part is send the message now, you don’t have to update all the other channels if you don’t need them

I would test via usb just to see if its because of the telemetry radios or something similar.

Thanks for the suggestion @Michael_Oborne .Note: Originally I had a Raspberry Pi connected via USB receiving and sending mavlink messages to the Pixhawk. The Pi sent commands to update a servo pin signal which in return would update the pitch of my gimbal. However, the 2 sec delay still existed after the servo command was executed.

Thank you!

just to rule out the trivial: this is not due to excessive values for the speed and accel limits in the RcInputs tab, right?

you also can do a number of experiments to better figure out where the problem sits. E.g. you can connect the STorM32 directly to the PC and to MissionPlanner, and run the script. In the .zip folder you’ll find scripts (which need adaption) for a number of options.

Thank you so much for your suggestions! @olliw42

Do you know if values for the speed and accel limits in the RcInputs tab are Active even if I’m connected to the Pixhawk via Mavlink Emit Heartbeat and RC Pitch in the RcInputs Tab of Olliw’s Tool is set to off?

If so, I’ll adjust those values. Any suggestion on what the max Rc Pitch Speed Limit and Accel Limit?

Also, I’m using one of the scrips you mentioned. The one I’m using is one of the Python ones that uses MAV.setMountControl( PitchValue, RollValue, YawValue, False) and
MAV.setDigicamControl(1). My code currently holds one Pitch position by putting these commands in a while True loop, and the loop also calls a function that does some logic. Based on that logic, after each loop it will command the gimbal a new Pitch angle with the same Mav.setMountControl and Mav.setDigicamControl commands. The commands execute then after a 2 second delay the gimbal reacts to set the new Pitch angle requested.

(My current hardware setup by the way):

Hardware Setup:

Mission Planner ArduPlane:
Using MAV.setMountControl: Pixhawk 2 -> Serial Port 2 -> UART Port on Strom32

Usage in Mission Planner Python script:
MAV.setMountControl( PitchValue, RollValue, YawValue, False)
MAV.setDigicamControl(1)

Thank you!

Do you know if values for the speed and accel limits in the RcInputs tab are Active even if I’m connected to the Pixhawk via Mavlink Emit Heartbeat and RC Pitch in the RcInputs Tab of Olliw’s Tool is set to off?

http://www.olliw.eu/storm32bgc-wiki/Inputs_and_Functions#Rc_Input_Processing