Hello,I am struggling to understand how I can control the digital output pin #55 on Pixhawk.I want to switch navigation lights on my UAV via Mission Planner. I have the necessary logic to swith the leds but no idea, how to activate the pin via MP. All I read so far was with respect to camera trigger but I want simply to find a way to switch the leds on and off via MP.I have already "Googled" for some while but either i am missing the right key words or my problem was not yet discussed.I would appreciate your help very much.ThanksBest RegardsHarald
You need to be a member of diydrones to add comments!
could you PLEASE explain how you were able to control your led's with your TX with a pixhawk flight controller Alejandro said:
Hi Harald
Thanks! It worked and I can control my leds with the RC :)
The change I did, following your advice, was to disable all controls for the gimbal and parachute (which I don't use) and now AUX 5 follows RC7 (as a side note, the controls for the gimbal were blank not "disabled"... I did mark them as disabled)
sorry for late reply but I have tried to repeat the steps you have tried in my environment.
I have managed to get the AUX 5 (pin 54) to toggle following the procedure in the link you mentioned.
First you have to make sure you have the BRD_PWM_COUNT = 4 (then AUX5 and AUX6 are configured as digital output)
The next I found out is you have to check that no other function uses those pins (in my case I had defined the parachute release with CH7 which seemed to block the function of AUX5) After disabling this function it suddenly worked as expected.
It also seems to be important that you have calibrated your radio and make sure that your CH7 is between 1100 and 1900
I can measure a voltage level of 0.03V / 3.3V on AUX5 (between GND and Signal) depending on the switch position on my radio.
I have updated to the latest Firmware version (copter 3.3.3).
Hope this helps you to also get it working.
Maybe I should mention that I also tried to get access to those pins via Missionplanner and a connected Joystick.
I was able to define 1 joystick button to switch the AUX5 pin on and off.
Hi, I am a freshman of drone and plan to build a Pxhawk drone and also like to use Pixhawk to control LED navigation light and strobe light instead of an independent LED control kit, like this or many other kits.
By this discussion, I learn Relay Switch, AUX OUT 5 & 6 can be set as relay to switch on/ off the navigation light though I haven't tested it. (Someone has tested it.) I just need the navigation light to be on or off and stay steady, but I want to flash the strobe light at a fixed frequency, like on-off-on-off in 1 sec, recycling after another 1 sec.
Is there a way to make the Relay Switch AUX OUT 5&6 on/off at a programmable frequency to blink the strobe light by editing the firmware code? If not, any simple hardware solution?
the phrase Relay Switch is a little bit misleading as you cannot directly switch a relay with the pin but you need a transistor to get the necessary current for switching a relay.
The meaning is that you can program those pins as being either normal PWM outputs to drive servos or a simple binary output which delivers only a high or a low level.
You need to have free channels on your RC to switch those functions.
I am not aware that it is possible to program a kind of on/off scheme into the Pixhawk. This would have to be done by programming your your RC (I am not aware if such kind of function exists)
With respect to the strobe light I would recommend to buy one with blinking already implemented.
I think I have seen such products already.
An example of how to connect the AUX pin to drive a relay is shown earlier in this thread.
If you want to create the blinking circuit by yourself you should look for applications with e.g. NE555 where you can define the blink frequency by choosing the right components.
Thanks for your explanation! This is really a nice place! Yes, there are some blinking strobes ready to use I can find! If you need such information, I can share with you!
This could also be used to raise or lower landing gear.
It also talks about making more relay pins if you don't want PWMs.
Harry > Michael BurmeisterNovember 16, 2014 at 5:14am
Thanks Michael for your answer!
My issue is that I need to use channel 7 and 8 of my RC for different functions so my intention was to switch the navigation lights via MAVLINK from Mission Planner and currently I have no idea how to achieve this (maybe via Python script?)
it depends what kind of receiver you are using? If it provides more than 8 channels in the PPM sum signal to the Pixhawk it should be possible to route them to the respective AUX outputs, see
with respect to the logic, I use to control the leds, see attached schematic; I have installed a separate DCDC converter supplied by the 3S LiPo to have a 5V supply for the PWM outputs of Pixhawk, which also supplies my leds.
My current understanding is, that by default AUX Pins 54 and 55 are configured as digital Output, i.e. providing voltage Levels of 0V and 3.3V depending on programmed state while the other 4 AUX Pins are configured as PWM out.
What I don't know is how to change the state of those Pins, in your case via Input channels from RC, in my case via script or something else in Mission Planner.
The mentioned Relay_Pins seem to be mainly history from PX4 and APM but this is guessing only.
I also hope that someone with deeper knowledge of the interworking between RC, Mission Planner and Pixhawk can give us some hints.
I think you still misunderstand the difference between the usage of those 6 AUX Pins on Pixhawk:
By default AUX 1-4 (Pins 50 to53) are configured as normal PWM Output, i.e. you can control servos with those pins. The other 2 (AUX 5-6, pins 54,55) are configured as digital Outputs. To control a relay via those Pins you have to have a similar logic as I mentioned but need an additional protection diode for the transistor. A relay is a mechanical switch controlled via a solenoid switched by a transistor. (see the modified schematic).
The Switch you mentioned will work on PWM Outputs but you have to configure those pins to represent your RC channels 7 and 8. The Parameter Servo_Out_Function is used for this. I personally have already achieved to have 2 flap servos connected and working to AUX1 and AUX2. You have to experiment which Parameter will fit your use case best.
Replies
could you PLEASE explain how you were able to control your led's with your TX with a pixhawk flight controller
Alejandro said:
Hi Alejandro,
sorry for late reply but I have tried to repeat the steps you have tried in my environment.
I have managed to get the AUX 5 (pin 54) to toggle following the procedure in the link you mentioned.
First you have to make sure you have the BRD_PWM_COUNT = 4 (then AUX5 and AUX6 are configured as digital output)
The next I found out is you have to check that no other function uses those pins (in my case I had defined the parachute release with CH7 which seemed to block the function of AUX5) After disabling this function it suddenly worked as expected.
It also seems to be important that you have calibrated your radio and make sure that your CH7 is between 1100 and 1900
I can measure a voltage level of 0.03V / 3.3V on AUX5 (between GND and Signal) depending on the switch position on my radio.
I have updated to the latest Firmware version (copter 3.3.3).
Hope this helps you to also get it working.
Maybe I should mention that I also tried to get access to those pins via Missionplanner and a connected Joystick.
I was able to define 1 joystick button to switch the AUX5 pin on and off.
Regards
Harald
Hi, I am a freshman of drone and plan to build a Pxhawk drone and also like to use Pixhawk to control LED navigation light and strobe light instead of an independent LED control kit, like this or many other kits.
By this discussion, I learn Relay Switch, AUX OUT 5 & 6 can be set as relay to switch on/ off the navigation light though I haven't tested it. (Someone has tested it.) I just need the navigation light to be on or off and stay steady, but I want to flash the strobe light at a fixed frequency, like on-off-on-off in 1 sec, recycling after another 1 sec.
Is there a way to make the Relay Switch AUX OUT 5&6 on/off at a programmable frequency to blink the strobe light by editing the firmware code? If not, any simple hardware solution?
Appreciate to suggestions!
Hi Eric,
the phrase Relay Switch is a little bit misleading as you cannot directly switch a relay with the pin but you need a transistor to get the necessary current for switching a relay.
The meaning is that you can program those pins as being either normal PWM outputs to drive servos or a simple binary output which delivers only a high or a low level.
You need to have free channels on your RC to switch those functions.
I am not aware that it is possible to program a kind of on/off scheme into the Pixhawk. This would have to be done by programming your your RC (I am not aware if such kind of function exists)
With respect to the strobe light I would recommend to buy one with blinking already implemented.
I think I have seen such products already.
An example of how to connect the AUX pin to drive a relay is shown earlier in this thread.
If you want to create the blinking circuit by yourself you should look for applications with e.g. NE555 where you can define the blink frequency by choosing the right components.
Hope this helps you further
BR
Harald
Hi Harald,
Thanks for your explanation! This is really a nice place! Yes, there are some blinking strobes ready to use I can find! If you need such information, I can share with you!
Regards,
Eric
It looks like you have a good circuit and just need to change the pin voltage from 0 to 3.3v.
In the latest version of the firmware they have provided this function on channel 7 or 8.
http://copter.ardupilot.com/wiki/common-relay/
This could also be used to raise or lower landing gear.
It also talks about making more relay pins if you don't want PWMs.
Thanks Michael for your answer!
My issue is that I need to use channel 7 and 8 of my RC for different functions so my intention was to switch the navigation lights via MAVLINK from Mission Planner and currently I have no idea how to achieve this (maybe via Python script?)
Hi Leslie,
it depends what kind of receiver you are using? If it provides more than 8 channels in the PPM sum signal to the Pixhawk it should be possible to route them to the respective AUX outputs, see
http://diydrones.com/xn/detail/705844:Comment:2002097
Best Regards
Harald
Hi Jamie,
with respect to the logic, I use to control the leds, see attached schematic; I have installed a separate DCDC converter supplied by the 3S LiPo to have a 5V supply for the PWM outputs of Pixhawk, which also supplies my leds.
My current understanding is, that by default AUX Pins 54 and 55 are configured as digital Output, i.e. providing voltage Levels of 0V and 3.3V depending on programmed state while the other 4 AUX Pins are configured as PWM out.
What I don't know is how to change the state of those Pins, in your case via Input channels from RC, in my case via script or something else in Mission Planner.
The mentioned Relay_Pins seem to be mainly history from PX4 and APM but this is guessing only.
I also hope that someone with deeper knowledge of the interworking between RC, Mission Planner and Pixhawk can give us some hints.
LED-Control.JPG
Hi Jamie,
I think you still misunderstand the difference between the usage of those 6 AUX Pins on Pixhawk:
By default AUX 1-4 (Pins 50 to53) are configured as normal PWM Output, i.e. you can control servos with those pins. The other 2 (AUX 5-6, pins 54,55) are configured as digital Outputs. To control a relay via those Pins you have to have a similar logic as I mentioned but need an additional protection diode for the transistor. A relay is a mechanical switch controlled via a solenoid switched by a transistor. (see the modified schematic).
The Switch you mentioned will work on PWM Outputs but you have to configure those pins to represent your RC channels 7 and 8. The Parameter Servo_Out_Function is used for this. I personally have already achieved to have 2 flap servos connected and working to AUX1 and AUX2. You have to experiment which Parameter will fit your use case best.
relay-control.JPG
-
1
-
2
of 2 Next