Development discussion of TauLabs software such as flight controllers, sensors, radios and speed controllers.
no avatar
User

hal

Posts

16

Joined

Fri May 23, 2014 6:56 am

Switching flight modes with a 4 channel radio

by hal » Fri Jun 06, 2014 11:25 pm

I've been trying to come up with a little project that I could do that would be both useful and also help me learn a bit about navigating this project. I was thinking of adding a way to switch flight modes without a computer or dedicated radio channel. I think the easiest way to do this would be to start with modifying the code that already exists for arming in the process_transmitter_events() function. The set_flight_mode() function is also in that module already, so it seems relatively straightforward. I haven't looked at the GCS code yet, but I think I'll just hard code the firmware first to try it out, before adding a way to change the configs in the GCS. Then I imagine I can once again adapt the arming code.

I have a couple of questions.
1) I think it would be helpful to have some sort of visual indication. Is there a list somewhere of all the LED assignments? I looked through the LED module, but it's not really obvious to me to see what is controlling which LED, and see if there is a free one.
2) Does this seem reasonable? Am I overlooking anything? Is there a way to do this that would be more useful? Any other suggestions from someone with more experience?
User avatar
User

peabody124

Posts

1339

Joined

Tue Feb 18, 2014 12:33 pm

Re: Switching flight modes with a 4 channel radio

by peabody124 » Sat Jun 07, 2014 2:49 pm

Yeah I always start by working on the firmware and add the GUI features later. Your post is a bit unclear, what method do you intend to use to change flight mode if not an external device or channel?

Regarding the LED, the current status is either armed or not armed. you can see some discussion about changing it here: viewtopic.php?f=17&t=96&hilit=LED
no avatar
User

ernieift

Posts

193

Joined

Sun Mar 02, 2014 11:21 am

Re: Switching flight modes with a 4 channel radio

by ernieift » Sat Jun 07, 2014 4:13 pm

Any solution for switching with a 4 channel radio would require disarming the vehicle. There are many flight modes, which you can't start with.
It is possible to see the current flight mode via telemetry link. Do you think of switching the mode via gcs instead of a TX channel? How should this be done in practise?
no avatar
User

hal

Posts

16

Joined

Fri May 23, 2014 6:56 am

Re: Switching flight modes with a 4 channel radio

by hal » Sat Jun 07, 2014 4:50 pm

Sorry it wasn't clear. There is already a feature to arm and disarm using a combination of throttle off and either a certain pitch/roll/yaw direction, or "switch," which I think is just a GPIO input. looking at the code, it looks like you have to hold this combination for a full second, so you don't do it by accident.

I thought it would be nice to be able to select a different combination of throttle off and a certain direction, or a switch, to switch flight modes. And maybe I can flash an LED a certain number of times to indicate the selected mode. So this would give you the ability to switch modes while on the ground and disarmed, without a telemetry link (or laptop/tablet at all), and without a dedicated rx channel.

Thanks for the link! I'll do some more reading in the forum - I was mostly looking in the code and official documentation before.
User avatar
User

carbo

Posts

54

Joined

Sun Mar 02, 2014 11:23 am

Re: Switching flight modes with a 4 channel radio

by carbo » Sat Jun 07, 2014 6:52 pm

I seriously doubt there are enough 4 channel radios in use to justify the effort.
no avatar
User

ernieift

Posts

193

Joined

Sun Mar 02, 2014 11:21 am

Re: Switching flight modes with a 4 channel radio

by ernieift » Mon Jun 16, 2014 9:27 am

What type of FC are you using? STM32F4 based?
no avatar
User

hal

Posts

16

Joined

Fri May 23, 2014 6:56 am

Re: Switching flight modes with a 4 channel radio

by hal » Tue Jun 17, 2014 10:48 pm

Carbo: Well, there's at least one (me!). And as I said, the effort is mostly to learn something and navigate the code, not because I want the feature THAT badly.

Ernie: I'm using the f3 discovery (flyingf3) board.

I've been working to put together my quad - I ran into some trouble I didn't anticipate - so I haven't made any progress on this yet. But I'll post when I do!
no avatar
User

hal

Posts

16

Joined

Fri May 23, 2014 6:56 am

Re: Switching flight modes with a 4 channel radio

by hal » Wed Aug 13, 2014 6:43 am

Ok, my quad is flying, and I've started trying to do this mod! I think I'm at a dead end in understanding some of the code, and I was wondering if someone could give me a little nudge.

I think the meat of my question is what does the system module, and specifically the "objectpersistance" do? It looks like the LED is controlled by "objectPersistenceQueue," which is in the system module. It runs (and therefore, blinks) at twice the speed when armed. I

I think I could also benefit a bit by understanding a bit better how the PiOS works. Where is the task scheduler? Does each "module" contain one task? And I think I understand part of how a task is inserted into the task scheduler (by calling xQueueReceive()), but I thought "objectPersistenceQueue" should be a pointer to the task, and I can't find where that is initialized.

Thank you for any help or links to info you could give!
no avatar
User

alexpaul

Posts

11

Joined

Thu Nov 10, 2016 3:24 am

Re: Switching flight modes with a 4 channel radio

by alexpaul » Wed Dec 14, 2016 8:09 am

I think the meat of my question is what does the system on module, and specifically the "objectpersistance" do? It looks like the LED is controlled by "objectPersistenceQueue," which is in the system module. It runs (and therefore, blinks) at twice the speed when armed.

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron