Pages: [1]   Go Down
Author Topic: Arduino controlling an Arduino  (Read 584 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
 
New to the forum and to arduino so please forgive my ignorance. I have a Quadcopter that is controlled by an arduino based card called autopilot. I am also currently constructing a LED array which is controlled by an Arduino Uno and it is using SPI to do that. What I need help with is that I would like to communicate somehow with the Uno via the autopilot which is connect to an RC radio on which I have a free channel. This would give me the ability to change the program on the Uno in mid-flight. Can this be done? If so then very very long descriptions with lots of pictures and graphs would be GREAT. Thanks in advance for any help you might give this poor lost soul.
 
d
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
which is connect to an RC radio on which I have a free channel.
Does this mean a free servo channel or is there a data channel? Or do you want to program via the autopilot?

Quote
program on the Uno in mid-flight
I hope its functions aren't mission critical smiley

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
which is connect to an RC radio on which I have a free channel.
Does this mean a free servo channel or is there a data channel? Or do you want to program via the autopilot?
Yes on the aruopilot. Servo for sure not sure about the data.
Quote
Quote
program on the Uno in mid-flight
I hope its functions aren't mission critical smiley
Uno is specific only to the RGB matrix. I would like to somehow change how the LEDs are behaving via the connection between the two. The receiver is fully connected to the Ardupilot with a spare channel to play with.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The receiver is fully connected to the Ardupilot with a spare channel to play with.
I've not used these bits, what exactly is the has a spare RC channel got to do with the Arduino hanging off the Ardupilot?

If it's just an RC channel I don't see how it's of any use for "talking" to the Arduino except in the most simple of ways. Certainly not for reprogramming. That said

Quote
I would like to somehow change how the LEDs are behaving
You don't have to "reprogram" the Arduino to do this, just write a program that accepts some data from the Ardupilot and drives the LEDs differently according to the data.

That should be possible using an RC channel. Do I have this right?

RC channel ---> Ardupilot ----> Arduino

If so what do you get into the Arduino? Pulse train, SPI data, something else?

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The receiver is fully connected to the Ardupilot with a spare channel to play with.
I've not used these bits, what exactly is the has a spare RC channel got to do with the Arduino hanging off the Ardupilot?

If it's just an RC channel I don't see how it's of any use for "talking" to the Arduino except in the most simple of ways. Certainly not for reprogramming. That said

Like I said I am a newbie to the Arduino platform so I am not sure what can and cannot be done. I do know that with only the Ardupilot that flight modes which are part of the programing can be changed via a switch on the transmitter which in turn change the flying characteristics of the quad. These modes are acrobatic, stabilized, loiter, simple. I believe that it is using PWM to do this. Also not sure how and or if this same method can be used to accomplish what I want to do but I believe it can. Something like if the PMW is in this range have the LEDs do this part of the program on the Arduino and if it is in a different range do this other part of the program on the Arduino.

Quote
Quote
I would like to somehow change how the LEDs are behaving
You don't have to "reprogram" the Arduino to do this, just write a program that accepts some data from the Ardupilot and drives the LEDs differently according to the data.

That should be possible using an RC channel. Do I have this right?

RC channel ---> Ardupilot ----> Arduino

If so what do you get into the Arduino? Pulse train, SPI data, something else?


I do understand that branching of some sort would be required on the Arduino and have no problem in doing that. I just need to understand how to communicate that from the Ardupilot. I am currently using SPI on the Uno to drive the addressable RGB LEDs and I am not familiar with what Pulse train or whatever the alternatives are if any. Separately the Ardupilot and the Uno function just fine by themselves. I just want to modify the program on the Uno to accept a signal from the Ardupilot to trigger a branch in the program on the Uno to make the LEDs behave differently. As it is now I can only start the Uno on the ground with the program I currently have. It is my goal to be able to change modes on the Uno in flight. Thanks for your help.

d
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I think I get it. In lieu of an Ardupilot expert I'll assume that you can get a PWM signal from the Ardupilot and that you can vary the duty cycle of this signal from the transmitter.

If that's the case then you can measure the width of the pulse and take action according to the value you read.

For the time being the simplest way to do that is using the pulseIn() function.

I think you said that this channel is controlled by a switch on the transmitter, how many positions on this switch? That will determine how many different "programs" you can run.

_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I think you said that this channel is controlled by a switch on the transmitter, how many positions on this switch? That will determine how many different "programs" you can run.

Right now the switch I want to use is a variable pot. But with the flight mode switch that I currently have, it was originally a variable pot but I modified the transmitter to have a 6 position switch with four trim pots to dial in the exact PMW with the high end of the switch being the high end of the PMW and the low end being the other end of the scale. So this might be a possible solution. Thanks for the feedback.

d
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like you are good then. You should be able to measure the pulses and get 6 "commands" from that.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Rob. Will update here at least I have a direction to work towards.

d
Logged

Pages: [1]   Go Up
Jump to: