Arduino controlled flying wing and a joystick app to control the plane

Yah but that was only in the arduino code but I fixed it.

Hi @mayinjabob

Thanks for sharing the video, it's looks like you're making good progress controlling the motor.

(Take care though, although it's a DC motor, if possible for safety I'd remove the propeller while testing, or at least make sure it's very secure. It's just that code changes during development can result in unexpected motor behaviour).

Thanks but it is all because you helped that I have been able to come this far thanks, and soon God willing I will be done with this project' s first phase. Thank you.

Hello everyone,
I have been quite for a while trying to figure out everything.
Quick recap;
I kinda of finished the project but with a brushed motor which had less power so I got a brushless.

Then now problems came in calibration(after getting a PDF manual on Google) but when I finally did so it kinda of rests it'self each time when I put on the propeller. (Like it works for a second and rests it'self)

Then two, by the way I observed this in on the brushed one as well. When I start the motor and if at all it spins, it will continue spinning normally but when I move the servos, it either reduces speed and resumes later or it stops in the case were I have the prop on.

My assumptions;

  • I think it's the servo library messing up because of this "timer stuff" since it is running three objects on the library
  • or I think the voltage for the arduino and ESC are in parallel on a 2s li- ion(8v) max. In that it is not receiving a smooth voltage.
    I will be posting the code so , please help.

WHAT DO YOU THINK?........

Hi @mayinjabob

Looks like your flying wing project's coming together.

It sounds like it might be a power issue to me:

  • Might I ask what the current rating of your battery is?

  • Is the battery directly powering the brushless motor Electronic Speed Controller (ESC)?

  • How are you providing 5V power to the servos?

Yap it is coming together but the motor now is the problem.
But am using a total of 14A and 8V since they are two li-ions in series.
It is providing power directly for the esc, arduino, and servos all in parallel.
But even when I use the esc's bec to give 5v to the arduino it still happens.

@mayinjabob Are the servos being powered by the ESC's 5v BEC?

No but by the li-ions

@mayinjabob Most servos usually have an operating voltage of roughly around 4.8 to 6.0V (ish). I think that voltage supplied by the 8V li-ion batteries might be too high.

In a RC plane, the ESC's 5V BEC often used to power the RC receiver and any attached servos.

@MartinL
So what do you think is causing the case of the motor shutting down or slowing down.

It still sounds like a power problem. What EXACTLY is the battery you are using? There is no such thing as a 14A 8V li-ion battery so what do you actually have? A link to where you bought it from might provide more useful information.

Steve

Hi @mayinjabob

As @slipstick mentions, the battery specification is very important. It needs to be able to supply the current demanded of it by your system.

Batteries are specified by the number of cells 2S, 3S, 4S, etc... with determines the output voltage at 3.7V per cell, therefore 2S = 7.4V, 3S = 11.1V and so on. There's also the cell capacity meaured in mAh (milliamp hours) and the maximum discharge rate 'C', which is a multiple of the capacity for example 25C, 30C, etc...

In the RC world, Li-po rather than Li-ion batteries are favoured, since in general they have a higher discharge rate.

If the battery is unable to supply the necessary current, the voltage starts to drop. This can cause a number of problems.

  1. As the voltage drops the motors will start to slow or stop

  2. ESCs have a voltage monitoring cutoff threshold, dependent on battery type that will cause the ESC to cutoff power to the motor when the input voltage is too low.

  3. A drop in voltage may also affect your Arduino flight control system.

Regarding your power system. I'd recommend powering your Arduino and ESC direct from a 2S battery and the servos from the ESC's BEC, provided that the BEC can supply 2A or more.

Also, care needs to taken routing the servo's noisy return ground paths, since the servos connect to both the ESC's BEC and your Arduino's ground. These need to be connected at a common single (star) point at or near your Arduino flight controller. In other words, the servo grounds should not pass across your Arduino board to get back to the BEC.

You can see here in this image of a flight controller's layout, how the ESC's BEC and servos grounds are connected together at a common point (on the board), without flowing across the flight controller itself:

OK but am savaging batteries from a laptop battery and wen fully charged they tend to 4V each hence 8V
The 7A is when I measured it directly so that is how I got the values
IMG20211128212420

And am trying an F-22 jet

but with 2 brushed motors since the brushless us misbehaving, but the MOSFETs (11N60E, and SW634) keep over heating .
Please help me with recommendations or a circuit.

Hi @mayinjabob

If you're not using a brushless ESC with a BEC anymore, how do you intend to power the servos with 5V?

Am is using the 8v to also power the arduino

I have kind of resolved this in a way that I add two cells in parallel and then in series hence, a 2P2S battery and now everything works at least fine.

Attached is my sketch for elevon (or V-tail) mixing for any of the AtMega328 (or 168) based 16MHz Arduinos - so Uno, Nano, Pro Mini, etc. It doesn't use any libraries.

It uses pins 2 and 3 for the receiver inputs to the Arduino (call those received servo positions A and B). Then it puts out A+B on pin 4, A-B on pin 5, -A+B on pin 6, and -A-B on pin 7. The idea is that you don't have to reverse any channels on your transmitter or mechanically on your plane - you just plug the servo into whichever of the four output channels provides the correct movement for both controls.

It uses pins 2 and 3 for the two inputs because they are the 'hardware interrupt' pins, and the interrupt code for timing the pulse edges can be more succinct than when using other pins. If you edit the code, it would be pretty easy to use pins other than 4,5,6,7 for the four outputs, but I built my mixer that way because it made the wiring neater.

The code has my own accurateMicros() function to replace the standard micros() function which only resolves to 4 microsecond intervals. My function uses Timer2 and resolves to one microsecond (and could easily be modified to give half-microsecond accuracy).

The code uses Timer1 as a one-shot interval timer to send each of the four servo output pulses.

It drives the four servo outputs at the industry standard 50Hz rate, and constrains the pulse widths to the standard 800 to 2200 microsecond range. Servo neutral position is the standard 1500 microseconds.

If you're sure that your on-board battery or ESC with BEC voltage will never exceed 6V, then it's best to power the Arduino by connecting that voltage to VCC rather than Vin.

ElevonMixer.zip (2.1 KB)

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.