trust

  • ****
  • 301
Re: Bimode aircraft code changes
« Reply #30 on: February 22, 2021, 07:52:15 am »
Did flight testing of bimode code today - bit windy 10-12mph but nice clear day. Some turbulence.
Successful 2 flights - first one most of the flight was in hrz wing mode with switch set to alternate mixer - and functioned pretty much as expected. Eliminated the mild roll oscillations that have been an annoyance. Seemed solid and smooth. All flight in roll & pitch attitude mode, yaw in rate mode. Take off in VTOL mode (vertical wing mode), rotated to hrz wing mode then flipped switch to alternate mixer. That switch also adds some front wing camber so it pitches up slightly (I adjusted it down some in flight). With too much wind doing the transition back to vertical wing mode is difficult, so went around - then noticed very low on battery so landed bit too abruptly.
  Next will test all rate mode, then test internal switching of aircraft type via switch (applies mainly to GPS special modes - RTB, VH, etc).

Re: Bimode aircraft code changes
« Reply #31 on: February 22, 2021, 09:26:22 am »
-j 4 is -jobs 4
This is what you want if your computer has a quad core CPU.  It compiles 4 files at a time, so the build is quicker.

OP/LP OSD is some code for old stuff that is not helpful for you.

You want the @JDL code.  If you modified any UAVOs that are read by the JDL OSD telemetry you will have to rebuild and reflash @JDL after possibly making some code changes to add the new fields (still needed as space holders if not used) and identify with new magic numbers.

Sounds like you have gotten over the hump and into the place where the aircraft is doing the technically correct thing.  Great going!  If I were you I would have a big satisfied grin on my face.   8)  ;)

trust

  • ****
  • 301
Re: Bimode aircraft code changes
« Reply #32 on: February 22, 2021, 10:17:19 am »
Celebrations were had earlier! Still, best to get more tests in - and on other aircraft. Also testing with the GPS modes.
Oddly the OSD did not have the same odd voltage variations during the tests today. I downloaded the 2.57 version of the JDL OSD code. Can I compile it within the same OSD framework? Compile help appreciated.

Another variation I'd like to set up with the mixers is a "always manual" mode. There are a lot of unused mixer channels, and I'd like to allocate some to do just straight mixing without the PIDs & attitude modes affecting the roll/pitch/yaw axis data & just use the receiver data. Maybe I'm missing something - does this already exist? Right now I use 2 channels on the receiver to output the front elevon data mixing a knob (for camber/reflex) with a switch (to enable/disable - which right now is also my V/H mode switch). I could regain one of those with onboard mixers.

Re: Bimode aircraft code changes
« Reply #33 on: February 22, 2021, 11:44:29 am »
@JDL is OSD man...  :)

PID is applied to signal before the mixer because the mixer may e.g. affect four actuators for e.g. X quad roll function.

PIDs only affect roll/pitch/yaw, so they don't affect anything like e.g. accessory #2.  You map a transmitter channel straight to an output channel on Vehicle page Accessory setup.  Then you tweak that accessory channel for e.g. servo max, min, neutral on the Output page.  This allows you to use a single wire carrying all channels from receiver e.g. SBus and connect some of those channels to servos.

There isn't any generic mixing other than for the 5 flight functions (a/e/r plus a pair of throttles) that go through the mixer table.

trust

  • ****
  • 301
Re: Bimode aircraft code changes
« Reply #34 on: February 22, 2021, 10:47:01 pm »
How do I compile just the code for the Atom FC? Is it coptercontrol? Do I need to re-make the GCS to also use the Atom FC?

Re: Bimode aircraft code changes
« Reply #35 on: February 22, 2021, 10:58:55 pm »
How do I compile just the code for the Atom FC? Is it coptercontrol?
Atom == CopterControl3D
Electrically the same.

Do I need to re-make the GCS to also use the Atom FC?
No.  You only need to remake GCS if you change GCS code or UAVOs or add a new FC that was not supported before.

trust

  • ****
  • 301
Re: Bimode aircraft code changes
« Reply #36 on: February 24, 2021, 05:40:47 am »
I've generated the Atom firmware using coptercontrol as the firmware parameter.

For the most part it looks like it works except for one major problem. The receiver channel 1 is being corrupted somehow - when I look at inputs it is constantly changing from neutral to max value - even when no control inputs are applied to the transmitter.
Even if Ch 1 is not selected as an active input for any control function, Receiver activity indicates channel 1 is active. Ch 1 is active even when the transmitter & receiver are off!
As a result it won't arm & input flag remains orange.
All the other channels seemed to work fine.
I also tried configuring the Atom FC in PPM mode to simplify the hookup - but here I could not get any received data at all, although the receiver being tested was tested with a Revo FC in PPM mode and worked fine.
  I wonder if there is some configuration parameters that are not being set up properly for this FC.
Any ideas? Where is the receiver set up code? Its not in receiver.c


Re: Bimode aircraft code changes
« Reply #37 on: February 24, 2021, 10:58:57 am »


The receiver channel 1 is being corrupted somehow - when I look at inputs it is constantly changing from neutral to max value - even when no control inputs are applied to the transmitter.
Even if Ch 1 is not selected as an active input for any control function, Receiver activity indicates channel 1 is active. Ch 1 is active even when the transmitter & receiver are off!
As a result it won't arm & input flag remains orange.
All the other channels seemed to work fine.
The fact that it changes even when disconnected is very suspicious.

multiple stacks to overflow (there is a stack scope and MEM health to look at), memory corruption (hardware debugging to see how it is being written on), priority issue, hardware

If you can write a function to detect the corruption and "print corrupt", you can write it to "print" the return address of the caller only the first time it detects corruption, and scatter it through suspect code sections and finally bisect to narrow down.

This is multi-tasking, so you can't sit in a loop waiting for something, you must wait for an event.

I would start by flashing stock firmware with stock GCS to see if it is a hardware issue.

I also tried configuring the Atom FC in PPM mode to simplify the hookup - but here I could not get any received data at all, although the receiver being tested was tested with a Revo FC in PPM mode and worked fine.
  I wonder if there is some configuration parameters that are not being set up properly for this FC.
Any ideas? Where is the receiver set up code? Its not in receiver.c
The startup at flight/targets/boards/coptercontrol/firmware/pios_board.c sets up all the ports.  Again, I would start by setting up the stock code.  That proves the hardware works and that you know how to configure it.  :)

CopterControl is very tight on memory.  You may want to remove some unused stuff or switch to Revo for a test.

trust

  • ****
  • 301
Re: Bimode aircraft code changes
« Reply #38 on: February 24, 2021, 10:03:16 pm »
Under SystemStats, SystemModStackRemaining indicates only 20 bytes - seems far too little to work.
I haven't tried testing the normal compile codes, but this remaining space seems far too small.
May not be useful to continue to try to make this work on this platform.
We have plenty of the mini Revos for now we'll just test on those.

jdl

  • ***
  • 246
Re: Bimode aircraft code changes
« Reply #39 on: February 25, 2021, 09:47:37 am »
.... I downloaded the 2.57 version of the JDL OSD code. Can I compile it within the same OSD framework? Compile help appreciated.

Arduino 1.0.5 package is used to compile to OSD source. Can be downloaded from: https://www.arduino.cc/en/main/OldSoftwareReleases

Additionally, some extra library files are required. Extract into Arduino "libraries" folder.
https://github.com/jdlilov/MinOPOSD-JDL/tree/main/Sources/Arduino%20libraries

Don't forget to select in OSD_Config.h your desired build options!

trust

  • ****
  • 301
Re: Bimode aircraft code changes
« Reply #40 on: February 25, 2021, 05:51:48 pm »
I'm not familiar with the arduino build make process.
Is there a command line entry that does that compile & link for your modified code?
Thanks

Re: Bimode aircraft code changes
« Reply #41 on: February 26, 2021, 07:26:10 am »
With Arduino and similar you run the PC program which is an editor/IDE.  You connect the board via serial or USB depending on the board.  You load the source code from the disk into the IDE and you see it there in the IDE editor.  You press a button and it compiles the code and loads it into the board.  Make a change.  Press the button again, and see the changed code run.

It really is that simple.  It was designed to be easy to use so beginners could enter a few lines of LED blinker code, run it, and see an LED blink on the board.

Don't forget to extract those extra @JDL library files as he said.

jdl

  • ***
  • 246
Re: Bimode aircraft code changes
« Reply #42 on: February 26, 2021, 09:10:20 am »
A hint: Easiest way to open the source in Arduino IDE is to just double-click on ArduCAM_OSD.ino file in Windows Explorer. This opens the associated program (Arduino IDE) and loads the source.

In Tools | Board select Arduino Pro or Pro Mini (5V, 16MHz) w/ Atmega328.

In Tools | Serial Port select the COM port your programmer is connected to.

This is all. Just Verify/Compile with the left-most button or Compile/Upload with the second one.

In case you don't have a programmer / RS232-TTL converter board, you can find the output HEX file in:

C:\Users\YOUR_USER_NAME\AppData\Local\Temp\buildXXXXXXXXXXXXXX.tmp\ArduCAM_OSD.cpp.hex

and upload it to the MicroMinimOSD board using OSD_JDL_Config.exe.

trust

  • ****
  • 301
Re: Bimode aircraft code changes
« Reply #43 on: February 26, 2021, 09:40:27 pm »
Ok, figured out some, compiled the code, output hex file.
I only change one item in the OSD_config.h - uncommented #define NEXT_UAVO
// JDL: LP16.09 or "next" r.735+ UAVOs
#define NEXT_UAVO
Set the target processor & compiled successfully.

I havent uploaded the hex files to the boards yet - but I'm wondering how they know which version I am using?
I have new code - not the same NEXT version.
On the boards in the systems now, they boot up and display everything, but after a few seconds everything disappears except the status line - DISARMED.

So something needs to be updated - but where?
Is there some set of automatically generated defines from my build I need to be including?
I'm using a Revo board, so I want to make sure its generating for that.

trust

  • ****
  • 301
Re: Bimode aircraft code changes
« Reply #44 on: February 26, 2021, 09:45:51 pm »
Its exactly 10 seconds after boot that it cuts out the main display - based on the OSD clock.
?