I am trying to connect an XBox controller through Mission Planner to the Pixhawk. I would like to see it doing something on the bench before moving it to a rover.
Ardurover 4.2.1
Mission Planner 1.3.77
Pixhawk 2.4.8 not connected to anything else but the PC via USB
I have an Xbox controller connected as a joystick. One joystick is set to affect Ch 3 (Ry) and Ch 4 (Rx)
The joystick is enabled.
Under Radio Calibration I can see that moving the joystick affects the Throttle (ch3) and Yaw (ch4)
I have turned off ARMING_CHECK and BRD_SAFETYENABLE
I then arm the pixhawk
HUD reports “ARMED”, “Unhealthy AHRS” and “GPS: No Fix”
SERVO3_FUNCTION is set to 70 (throttle) I have also tried it as 1 (pass through)
Using an oscilloscope, I see a single square wave on MAIN OUT 3. It doesn’t vary when I move the joystick.
The servorail does not get powered by USB or the power module. It needs a seperate power supply, like a BEC for example.
Servos can draw a lot of power and both USB and the power module could be damaged if they provided power to the servorail.
You’re right there is not enough there to power a servo.
How do I set the channel to PWM?
SERVO3_MAX, _MIN, _TRIM are set to Units = “PWM”
SERVO3_FUNCTION is currently set to 70 (Throttle)
According to the docs;
Throttle
Typical servo output for motor power control for vehicles. Multiple outputs can be used for multi-engine vehicles. Primary power control output for normal fixed-wing planes, single rotor helicopter, and rovers.
I should see some sort of change on the oscilloscope.
The servorail does not get powered by USB or the power module. It needs a seperate power supply, like a BEC for example.
Servos can draw a lot of power and both USB and the power module could be damaged if they provided power to the servorail.
@count74 Thanks, but I think it is more fundamental than that. I have attached a companion computer and I did a data stream request using MAV_DATA_STREAM_RC_CHANNELS. The only thing I am getting back is a HEARTBEAT.
It seems something is stopping the RC channels that I am using from being used within the Pixhawk.
I have attached the last log
Looking through the log I can see a variation coming in on the RCIN messages, but RCOU appears frozen.
Auto Analysis reported:
Size (kb) 123.72265625
No of lines 2396
Duration 0:00:00
Vehicletype ArduRover
Firmware Version VDD_5V_PERIPH_nO
Firmware Hash fbf719b2
Hardware Type
Free Mem 0
Skipped Lines 161
Test: Autotune = NA -
Test: Brownout = UNKNOWN - No CTUN log data
Test: Compass = GOOD - mag_field interference within limits (0.85%)
Max mag field length (570.56) > recommended (550.00)
Test: Dupe Log Data = GOOD -
Test: Empty = GOOD -
Test: Event/Failsafe = GOOD -
Test: GPS = UNKNOWN - No GPS log data
Test: IMU Mismatch = NA -
Test: Motor Balance = NA -
Test: NaNs = FAIL - Found NaN in STER.LatAcc
Found NaN in THR.Speed
Test: OpticalFlow = FAIL - ‘FLOW_FXSCALER’ not found
Test: Parameters = GOOD -
Test: PM = NA -
Test: Pitch/Roll = NA -
Test: Thrust = NA -
Test: VCC = UNKNOWN - No CURR log data
The output for throttle will not move without arming the vehicle and pressing the safety button. Both can be disabled for testing. Set ARMING_REQUIRE and BRD_SAFETYENABLE to 0.
Reading the documentation might also help:
For anyone coming across this topic. I was able to get it to work by moving to channel 8 & 9.
The solution seems to be that connecting a joystick across predefined channels interferes with its ability to output on the MAIN OUT. I am sure there is a good reason for this, I am too new at it to know the reason why.