Hi there,
I am totally new in the drone as DIY. For some experiments, I want to build a drone by myself, very simple without any need of performance (just a drone which can fly). The only imperative is the following: I have to onboard 9 range sensors (I don’t know for the moment which kind, IR or Ultrasonic) and to implement my intelligence (AI) on a board to control the rotors. Just to notice, this concerns an experiment, in indoor. The drone would follow by itself a path.
So, after spending some times on this cool website, I have two options:
I can use an APM2.6 board, with ArduPilot. I can connect my 3-pins sensors to the A0-A8 inputs from the APM2.6 board, modify the ArduPilot firmware to include sensor driver and the AI (this is not a lot of code lines, quite simple). Problems with this solution are:
ArduPilot community ?
Capability of the ArduPilot firmware to accept additional computations for my AI ?
Weight ?
Stabilisation PID (I need a stabilized position of the drone when activating the AI) ?
And how to activate the AI, to switch from manual commands to autonomous flight) ?
I can use a simple board (Naze32, KK2.0, CC3D) with an open source firmware (compatible with all three ?) and an extra mono-board (RaspberryPi or ArduinoUno). My sensors will be connected to the mono-board, the AI will be computed by the mono-board and commands sent to the FC. Here again some questions:
To control the FC, how can I send concomitant commands with the AI and the remote ?
I was thinking about connecting the outputs of the RX module to the mono-board (Channel 1 to 4) and in function of the flight mode, passing directly the remote commands or passing the AI commands. But I dont know if this is feasible and how. I have read some things about the RX module (with PPM/PWM).
With a remote, do we have interruption button to switch from a mode to another (manual to autonomous) ?
I would appreciate some answers to my question, to help me defining a feasible solution and also to share external point of view.
Certainly. You can take a look at the code (open source) before buying.
The flight controller tends to be low weight compared to the rest of the drone, especially the main battery.
Every flight controller has its own stabilization PID / algorithm.
If you plan to modify the code, you’ll need to know when / how to send commands to move / stabilize. You run the risk of crashing since the existing code has been proven to work quite well.
This depends on if you plan to use external electronics. If so, you would no longer need a standard RC remote control - you’d need to provide serial commands either from a wireless input (Bluetooth, RF etc.) or a microcontroller / SBC. The commands themselves are found in the manual.
Not easy to use a standard RC remote for serial commands. Can you elaborate on this idea?
You’d need to program that into the mode function and yes, control it from one of the switches. The switch should override the autonomous mode.
Hope this helps, but if we didn’t understand a question or if you need some clarification, we’re here for you. If you can tell us any hardware you’ve already selected it would help as well.
Currently, I am thinking on the following hardware:
APM2.8 flight controller + ArduPilot
Receiver with at least 6 channels
the rest of the Hardware is not important for the moment in term of solution design.
Arduino Uno, which will be connected between the Receiver and the FC.
My solution would be to connect channel 1 to 4 directly on the Arduino Uno board in input, as well as the channels 5 and 6.
Then the Arduino Uno board will be connected through 4 wires to the FC. On each on these wires will be sent either channel 1 to 4 commands, or the AI commands, depending on the UAV mode, given by channel 5 or 6. The modes will be the following:
0 : Manual mode: control through the standard RC remote control
1 : Stabilization mode: when I manually place the UAV at expected altitude and position, an algorithm based on range sensors will keep the UAV at the same position (stationnary flight)
2 : AI mode : the UAV will receive commands from the AI embedded on the Arduino Uno board, by getting in input the range measured by sensors.
In any case, RC remote control will still take the priority on the mode 1 or 2. In such way, if one command is received from the RC remote, the UAV switches automatically to Manual Mode (0) for safety reason.
So, my work will be:
to build the UAV, with an ARF kit or similar
integrate the Arduino Uno board on the UAV (between Receiver and FC)
upload algorithm of each mode and the main program on the Arduino Uno
Perform some tests (stabilization, calibration of the UAV, then test of sensors, tests of mode 1 and mode 2, …)
I hope to be clear in my concept.
So few problems remain for me concerning the RC remote control and the Receiver:
AUX channels are of which type (only switch 0/1, analogic commands) ? Or do I have to foresee another communication mean to change the UAV modes ?
Bypassing the Receiver output with the arduino uno is possible ? I mean, values that I will collect on channel 1 to 6 are readable, or will be they formatted with a particular protocol (PPM??) ?
Thank you for your time,
I hope that my ideas could give new hint for the community
Normally the first four channels of an RC remote correspond to the two joysticks. Channels 5 and up are controller dependent and can be two or three position switches or analog knobs.
Yes, but you’ll need to find / create code which can time all of the pulses coming from the receiver. Arduino has just recently partnered with ARM (Cortex lineup) which have multiple timers.
Once you have timed the pulses, you can do whatever you want with that information.
It might simply be easier to use a normal RF / XBee module (a lot easier to code too), though you would not longer use a standard RF remote (you could use a computer, laptop or custom remote):
Ex: robotshop.com/en/wireless-ga … no-v2.html
Ok great, I just need an AUX channel with 3 states, or a simple button and implementing a machine state in the arduino.
Wow, so values that I am going to collect on each channel 1 to 4, and the AUX channels are not simple values ?
I wanted to create a simple infinite loop on the arduino, waiting for activity on each channel listener, and passing the read value to the FC.
But you mean that there is a time-multiplexing ?
I wanted to use a standard RC remote but this can fit.
If I understand well, I will need to program the remote too in this case ?
On the UAV, which configuration will I have?
Your proposed remote -)-)–)--)—)---)----)----)-----)-----) Xbee antenna <-----> Receiver? <------> arduino Uno <-------> FC ?
[font=Helvetica Neue, Helvetica, Arial, sans-serif][size=4][highlight=#ffffff]
[/highlight][/size][/font]
[font=Helvetica Neue, Helvetica, Arial, sans-serif][size=4][highlight=#ffffff]
[/highlight][/size][/font]
Your reply are really interesting, it provides other possibilities.
[font=Helvetica Neue, Helvetica, Arial, sans-serif][size=4][highlight=#ffffff]
[/highlight][/size][/font]
An RC remote sends out repeated 5V PWM pulses of between 500us (0.5ms) to 2500us (2.5ms) with a delay of around 20-30ms between pulses. These are always repeated and are updated when you move the joysticks or knobs.
The switches only send two or three values in the same format described before - they’re not digital. For a non-RC receiver to “understand” the pulses being received via each channel, it needs to time the length of each pulse… always.
The Arduino will / should always be receiving values from each channel, though the values may not always change, it does not know that in advance so must time everything.
Yup, but easier programming.
You could still use the Arduino and connect it to a mating XBee module for example, except now the Arduino is a lot more “free” for autonomous mode.
It’s based on your suggestion mostly: Gamepad -> XBee ))) Xbee -> Arduino -> Flight Controller
You could use the Arduino’s built-in servo library to generate the RC pulses, or communicate via serial with the flight controller.
I did not manage the communication part, that’s why I have lots of questions.
But I’m going to check this topic as soon as possible, to understand this multiplexing and why not writing code on my arduino to interface with the Receiver.
But your alternative seems interesting. I will have to check how to manage simultaneous commands from the generic remote.
What you propose can certainly (and has been) done. Ardupilot is Arduino-based and connects to a normal RC remote control.
Note that rather than a 6ch remote, you might want to “invest” just a little more and get a 9-10ch like: robotshop.com/en/radiolink-a … eiver.html
Having the ability to program the endpoints to get the full range of 0.5ms to 2.5ms is really useful (and sometimes necessary) for custom drones.
Also, should you go that route, an S-bus receiver might be appealing to you, like: robotshop.com/en/radiolink-r … eiver.html
Ok I will check this asap.
In any case, I will have to manage, with my Arduino Uno the PWM or PPM signal to send commands to the FC ?
Does it exist any numeric protocol between the Receiver (throttle, yaw, pitch, roll, and aux channels) and the FC which could facilitate the communication, and so my work on the Arduino (reading controls from the Receiver; writing commands to the FC) ?
Yes - a receiver like RB-Rlk-18 has an SBUS (and an FC which can accept it). Normal RC receivers (for the most part, though not all) tend to be channel to channel PWM.