Plane mode on Mega (1280) board: Not running, Issues on PWM?
Plane mode on Mega (1280) board: Not running, Issues on PWM?
Hi guys,
did one of you successfully run Plane mode on a mega board?
I have connected everything correctly (using D2 for rudder, D3 for engine, D5 for elev and D6 for the wings) but the servos are going crazy and the ESC is beeping (no signal).
Du to that I analyzed the the PWM signal with a oszi and I think somethin is going wrong there.
To ensure correct measurement with the oszi I have analyzed the signals on the four pins (D2, D3, D5, D6) in QuadX mode. There they give a nice 2ms signal. Additionally I have tested with Arduino Servo library, which gives a nice signal too.
In airplane mode (passthru as well as gyro and acc) the PWM looks very strange: Its periodlength jumps between the discrete values 20,4ms, 24,4ms and 28,4ms.
The high period only jumps between the discrete values 1,2ms and 5,2ms when the corresponding channel is changing. (5,2ms on bootup of Arduino, holds at 1,2ms or 5,2 forever [didnt see the systematic) when stick moved left/right (or top/down). While moving it is jumping between 1,2 and 5,2ms. ).
As you can see: very crazy.
To sum up: In QuadX the signal is as expected, with Arduino servo library the signal is as expected, in airplane mode is is crazy as described.
My setup: Seeduino Mega 1280, MPU6050
Measurement with Fluke 196 Scopemeter
Do you have any idea on this?
Thank you
Kai
did one of you successfully run Plane mode on a mega board?
I have connected everything correctly (using D2 for rudder, D3 for engine, D5 for elev and D6 for the wings) but the servos are going crazy and the ESC is beeping (no signal).
Du to that I analyzed the the PWM signal with a oszi and I think somethin is going wrong there.
To ensure correct measurement with the oszi I have analyzed the signals on the four pins (D2, D3, D5, D6) in QuadX mode. There they give a nice 2ms signal. Additionally I have tested with Arduino Servo library, which gives a nice signal too.
In airplane mode (passthru as well as gyro and acc) the PWM looks very strange: Its periodlength jumps between the discrete values 20,4ms, 24,4ms and 28,4ms.
The high period only jumps between the discrete values 1,2ms and 5,2ms when the corresponding channel is changing. (5,2ms on bootup of Arduino, holds at 1,2ms or 5,2 forever [didnt see the systematic) when stick moved left/right (or top/down). While moving it is jumping between 1,2 and 5,2ms. ).
As you can see: very crazy.
To sum up: In QuadX the signal is as expected, with Arduino servo library the signal is as expected, in airplane mode is is crazy as described.
My setup: Seeduino Mega 1280, MPU6050
Measurement with Fluke 196 Scopemeter
Do you have any idea on this?
Thank you
Kai
Re: Plane mode on Mega (1280) board: Not running, Issues on
Me not. Only 328p working.
Re: Plane mode on Mega (1280) board: Not running, Issues on
Hi guys,
just checked it with my todays arriving Arduino Uno. It gives a clear and good PWM signal.
So I think there is something wrong with the implemetation for Mega boards.
Unfortunately I am not very familiar with all the timers/interupts stuff. Does someone of you have an idea where to search/how to fix the bug?
Regards
Kai
just checked it with my todays arriving Arduino Uno. It gives a clear and good PWM signal.
So I think there is something wrong with the implemetation for Mega boards.
Unfortunately I am not very familiar with all the timers/interupts stuff. Does someone of you have an idea where to search/how to fix the bug?
Regards
Kai
Re: Plane mode on Mega (1280) board: Not running, Issues on
In shared MIS did correct an error with interrupts on mega mcu. Maybe that helps?
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Plane mode on Mega (1280) board: Not running, Issues on
In airplane mode (passthru as well as gyro and acc) the PWM looks very strange: Its periodlength jumps between the discrete values 20,4ms, 24,4ms and 28,4ms.
The high period only jumps between the discrete values 1,2ms and 5,2ms when the corresponding channel is changing. (5,2ms on bootup of Arduino, holds at 1,2ms or 5,2 forever [didnt see the systematic) when stick moved left/right (or top/down). While moving it is jumping between 1,2 and 5,2ms. ).
The problem has nothing to do with interrupts, and should not be a problem

The way to generate software PWM for servo uses a variable period because one timer is used to generate several servo pulse.
The important thing is the HIGH state period (value of the servo command), the DOWN state duration is less important and is around 18ms
Re: Plane mode on Mega (1280) board: Not running, Issues on
Hi guys,
maybe it wasnt clear. The high period doesnt change like expectet. The GUI shows the expectet values, but the high signal only jumps between 1,2ms and 5,2ms (nothing between this). It jumps when not armed (idle), too...
The servos are going crazy with this..
May a video of the oszi measurement help you?
maybe it wasnt clear. The high period doesnt change like expectet. The GUI shows the expectet values, but the high signal only jumps between 1,2ms and 5,2ms (nothing between this). It jumps when not armed (idle), too...
The servos are going crazy with this..
May a video of the oszi measurement help you?
Re: Plane mode on Mega (1280) board: Not running, Issues on
Any luck with MIS improvment ?
http://code.google.com/p/multiwii/source/list
http://code.google.com/p/multiwii/source/list
Last edited by Gimbal on Tue Sep 11, 2012 7:35 pm, edited 1 time in total.
AW: Plane mode on Mega (1280) board: Not running, Issues on
Couldnt check it until now.
What do you mean with MIS?
What do you mean with MIS?
Re: Plane mode on Mega (1280) board: Not running, Issues on
Mis is a dev who fixed a bug with itr for mega. code is in shared.
(fixed some typos)
(fixed some typos)
Last edited by Hamburger on Sat Sep 15, 2012 11:19 pm, edited 1 time in total.
Re: Plane mode on Mega (1280) board: Not running, Issues on
I tried it some minutes ago with the latest checkout from Shared, but it is still the same. High periods of PWM is jumping between 1ms and 5ms when the GUI indicates a changing (eg. when moving the IMU -> changing servo signals, moving throttle stick -> changing ESC signal)...
This is really weird...
This is really weird...
Re: Plane mode on Mega (1280) board: Not running, Issues on
Hi KaiK, found a bug in output:
#if defined(AIRPLANE)|| defined(HELICOPTER)
// To prevent motor to start at reset. atomicServo[7]=5 or 249 if reversed servo
volatile uint16_t atomicServo[8] = {8000,8000,8000,8000,8000,8000,8000,8000};
change uint8 to uint16
#if defined(AIRPLANE)|| defined(HELICOPTER)
// To prevent motor to start at reset. atomicServo[7]=5 or 249 if reversed servo
volatile uint16_t atomicServo[8] = {8000,8000,8000,8000,8000,8000,8000,8000};
change uint8 to uint16
Re: Plane mode on Mega (1280) board: Not running, Issues on
Great. I will try it and scope it tomorrow.
Re: Plane mode on Mega (1280) board: Not running, Issues on
Fix is uploaded in _shared.
Re: Plane mode on Mega (1280) board: Not running, Issues on
Checked it with a scope and made a little test in airplane (on ground): Seems to fix it!