Re: Help needed quickly : matrixpilotquad issue of setup

840 views
Skip to first unread message

János Mészáros

unread,
Oct 4, 2012, 1:52:59 PM10/4/12
to uavde...@googlegroups.com
Hi Eng.kwili,

Please provide more detailed info about your errors to understand deeply your environment (which version IDE do you use) or setup (Win, Mac etc.) and others. I really don't want to hijack your post, but I've also experienced some compilation errors with MP_Quad trunk version, maybe yours are identical?

Regards,
János
error_mpquad.jpg

markw

unread,
Oct 5, 2012, 12:41:40 PM10/5/12
to uavde...@googlegroups.com
These errors hint that there is something wrong with file libUDB_internal.h. Is it possible that you got conflicts on an SVN update?
Conflicts result in lines like:
<<<<<<< .mine
inserted in your source files. A fresh checkout of the project shouldn't have this problem, though.

regards,
--Mark

On Thursday, October 4, 2012 1:21:09 PM UTC-6, eng.kwili wrote:

Iam using Wndows 7 , and Mplab v8.86 , I have  attached the errors as a picture

one important thing is that am using MatrixPilotQuad_MarkWhitehorn code without the matrixpilot 3.0 I mean I didnt mix the files together and I think it is the right way please if am wrong inform me thank you. 

 

eng.kwili

unread,
Oct 5, 2012, 12:55:52 PM10/5/12
to uavde...@googlegroups.com

Hello,

I couldnt understand what you said exactly but I think that everything in the source code is fine maybe if try to download the MatrixPilotQuad it will work ?? is it possible .... It my be file conflict but how can I be sure ? I downloaded every thing in order  

markw

unread,
Oct 6, 2012, 2:17:13 PM10/6/12
to uavde...@googlegroups.com
The first error message you show for libUDB_internal.h is complaining about a "'<' token".
Line 1 of this file is supposed to be:
// This file is part of MatrixPilot.
Note that there is no '<' token on this line, so there appears to be something wrong with your working copy.

Perhaps you should try building project MPQpid400.X using MPLAB-X as that is how I am doing it.
MPLAB-X is the latest version of MicroChip's IDE and is now available for free download. The C30 compiler still works, so you should be able to use the compiler you already have with MPLAB8.

best regards,
--Mark

János Mészáros

unread,
Oct 9, 2012, 4:25:44 PM10/9/12
to uavde...@googlegroups.com
Hi Mark,

I've tried to build your quad code in MPLab X IDE but I got several errors (attached textfile with the full build log - 17,18 and 26, 28,29 lines with errors) during the process. I tried to follow your previous suggestions but I got always the same.

Regards,
János
compile_error_MPQuad.txt

Giulio Berti

unread,
Oct 10, 2012, 4:05:35 AM10/10/12
to uavde...@googlegroups.com
Hi Mark,

I've tried to do what you previously suggested me without success, I can't compile anything in MplabX (I've tried also to compile trunk).

What I did:
  • A fresh install of Mplab X and xc16

    Product Version: MPLAB X IDE v1.30

    Java: 1.6.0_32; Java HotSpot(TM) Client VM 20.7-b02

    System: Windows XP version 5.1 running on x86; Cp1252; it_IT (mplab)

    Userdir: C:\Documents and Settings\Prof\Application Data\.mplab_ide\dev\v1.30   

  • A checkout using tortoise svn of your branch
  • renamed option_base.h in options.h and commented the #error lines
  • checked that the include paths are right in the project properties
What I got:
(same as Jànos)
  • make[2]: *** No rule to make target `../main.c', needed by `build/default/production/_ext/1472/main.o'.  Stop.
    make[1]: *** [.build-conf] Error 2
    "C:\Program Files\Microchip\mplabc30\v3.30c\bin\pic30-gcc.exe" -g -omf=elf -x c -c -mcpu=33FJ256GP710A -Wall -I../../MatrixPilotQuad -mlarge-code -MMD -MF build/default/production/_ext/1077454706/filters.o.d -o build/default/production/_ext/1077454706/filters.o ../../libUDB/filters.c -legacy-libc --save-temps -D_ADDED_C_LIB 
    make[2]: Leaving directory `I:/Documenti/gentlenav/branches/MatrixPillotQuad_MarkWhitehorn/MatrixPilotQuad/MPQpid400.X'
    make[1]: Leaving directory `I:/Documenti/gentlenav/branches/MatrixPillotQuad_MarkWhitehorn/MatrixPilotQuad/MPQpid400.X'
    make: *** [.build-impl] Error 2

    BUILD FAILED (exit value 2, total time: 15s)
Where I'm doing wrong?
Could you share a zip file with a working copy? (just to understand if the problem is your source code or our mplabX.)

Best regards,

Giulio    

PS: complete build log in the attached file.
build errors.txt

markw

unread,
Oct 10, 2012, 1:49:26 PM10/10/12
to uavde...@googlegroups.com
Hi Jànos and Giulio,

Sorry you're having trouble building MatrixPilotQuad.

It looks like your checked-out projects can't locate main.c, and I think is is due to out-of-date project files and a few recent changes I've made while working on other projects.

Try updating to r1747 and let me know if there are any remaining problems.

best regards,
--Mark
Message has been deleted

János Mészáros

unread,
Oct 11, 2012, 1:16:25 PM10/11/12
to uavde...@googlegroups.com
Hi Mark,

I successfully compiled the trunk code today with MPLab IDE 8 (aka legacy) - sorry, I'm really disappointed about MPLab IDE X.

My workflow:
1. I copied the main.c and options.h file of the MPQpid400 X project folder to the main MatrixPilotQuad folder.
2. I edited the .c file: Original 23th row (#include "../../libDCM/libDCM.h") was changed to #include "../libDCM/libDCM.h".
3. The project was loaded into IDE 8 and I changed the parameters to my requirements in options.h.
4. Compiled the project without problem and burned on my UDB4 board.

This is a proper workflow and use of your code or I missed something important and I'm a lucky guy?

Regards,
János

markw

unread,
Oct 11, 2012, 3:16:55 PM10/11/12
to uavde...@googlegroups.com
Hi János,

I'm glad you were able to get a clean compile, and I hope the latest version of code works well for you, but keep in mind that this code is a work in progress and you probably will find bugs that I'm not yet aware of.

Your changes are OK if MPQpid400 is the only project you are working with, but any future SVN updates to main.c will still show up in the project directory. 

I am now maintaining different versions of main.c and options.h (and possibly other files also) for multiple subprojects, so each project has its own version of these files located in each project subdirectory. Instead of moving files and changing the include statements, you can just add the files at their new locations to the project. I try to keep the MPLAB-X project files up to date, but the MPLAB8 project files (if they even exist) probably won't reflect the new file locations.

regards,
--Mark

Giulio Berti

unread,
Oct 13, 2012, 4:05:02 AM10/13/12
to uavde...@googlegroups.com
Mark,

I successfully compiled your last working copy MPQ6000dual, but MPQpid400 doesn't compile yet, but the error is changed:


CLEAN SUCCESSFUL (total time: 312ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `I:/Documenti/gentlenav/branches/MatrixPillotQuad_MarkWhitehorn/MatrixPilotQuad/MPQpid400.X'
make  -f nbproject/Makefile-default.mk dist/default/production/MPQpid400.X.production.hex
make[2]: Entering directory `I:/Documenti/gentlenav/branches/MatrixPillotQuad_MarkWhitehorn/MatrixPilotQuad/MPQpid400.X'
In file included from ../../libDCM/libDCM.h:26,
                 from ../../libDCM/libDCM_internal.h:22,
                 from ../../libDCM/deadReckoning.c:22:
../../libDCM/../libUDB/libUDB.h:26:21: error: options.h: No such file or directory
In file included from ../../libDCM/../libUDB/libUDB_defines.h:109,
                 from ../../libDCM/../libUDB/libUDB.h:28,
                 from ../../libDCM/libDCM.h:26,
                 from ../../libDCM/libDCM_internal.h:22,
                 from ../../libDCM/deadReckoning.c:22:
../../libDCM/../libUDB/boardRotation_defines.h:52:18: error: missing binary operator before token "1"
../../libDCM/../libUDB/boardRotation_defines.h:57:19: error: missing binary operator before token "1"
../../libDCM/../libUDB/boardRotation_defines.h:76:18: error: missing binary operator before token "1"
../../libDCM/../libUDB/boardRotation_defines.h:81:19: error: missing binary operator before token "1"
../../libDCM/../libUDB/boardRotation_defines.h:100:18: error: missing binary operator before token "1"
../../libDCM/../libUDB/boardRotation_defines.h:105:19: error: missing binary operator before token "1"
"C:\Program Files\Microchip\mplabc30\v3.30c\bin\pic30-gcc.exe" -g -omf=elf -x c -c -mcpu=33FJ256GP710A -Wall -I/home/markw/MPLABXProjects/gentlenav/branches/MatrixPillotQuad_MarkWhitehorn/MatrixPilotQuad/MPQpid400.X -mlarge-code -MMD -MF build/default/production/_ext/1077471063/deadReckoning.o.d -o build/default/production/_ext/1077471063/deadReckoning.o ../../libDCM/deadReckoning.c -legacy-libc --save-temps -D_ADDED_C_LIB 
make[2]: Leaving directory `I:/Documenti/gentlenav/branches/MatrixPillotQuad_MarkWhitehorn/MatrixPilotQuad/MPQpid400.X'
make[2]: *** [build/default/production/_ext/1077471063/deadReckoning.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[1]: Leaving directory `I:/Documenti/gentlenav/branches/MatrixPillotQuad_MarkWhitehorn/MatrixPilotQuad/MPQpid400.X'

BUILD FAILED (exit value 2, total time: 1s)

 The compiler can't find options.h, although is in the project files (on the left in the IDE).
I have a options.h in gentlenav\branches\MatrixPillotQuad_MarkWhitehorn\MatrixPilotQuad and another one in gentlenav\branches\MatrixPillotQuad_MarkWhitehorn\MatrixPilotQuad\MPQpid400.X.
Where should I put it?

Could you confirm me that MPQpid400 is compilable for you?

Thanks,

Giulio

Giulio Berti

unread,
Oct 13, 2012, 4:09:29 AM10/13/12
to uavde...@googlegroups.com
I don't know if this is useful, but I got this in the Configuration Loading Error window:
warning: Configuration "default" builds with "C30", but indicates no toolchain directory.
info: Configuration "default" will build with toolchain "C30" at "C:\Program Files\Microchip\mplabc30\v3.30c\bin".
warning: Configuration "default" builds with "C30" at "/opt/microchip/mplabc30/v3.30c/bin", but no toolchain of that type is installed there.
info: Configuration "default" will build with toolchain "C30" at "C:\Program Files\Microchip\mplabc30\v3.30c\bin".
warning: Configuration "default" builds with "C30" at "/opt/microchip/mplabc30/v3.30c/bin", but no toolchain of that type is installed there.
info: Configuration "default" will build with toolchain "C30" at "C:\Program Files\Microchip\mplabc30\v3.30c\bin".


Best regards,
Giulio

Giulio Berti

unread,
Oct 13, 2012, 4:27:56 AM10/13/12
to uavde...@googlegroups.com
I removed this error selecting the compiler toolchain as in the picture attached

R,
Giulio
compiler location.PNG

eng.kwili

unread,
Oct 13, 2012, 2:54:08 PM10/13/12
to uavde...@googlegroups.com

Hello everybody actually am trying a lot of times and always have errors

the last thing I didi is that I downloaded MPQpid400 with the MatrixPilotQuad_Markwhithorn and the MPLABX whan I open the project and compile I have the following errors:::
 
 
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `C:/Users/DANGER/Desktop/MatrixPilotQuad_MARKWHITEHORN/Matrixpilot/MPQpid400.X'
make  -f nbproject/Makefile-default.mk dist/default/production/MPQpid400.X.production.hex
make[2]: Entering directory `C:/Users/DANGER/Desktop/MatrixPilotQuad_MARKWHITEHORN/Matrixpilot/MPQpid400.X'

In file included from ../../libDCM/libDCM.h:26,
                 from ../../libDCM/libDCM_internal.h:22,
                 from ../../libDCM/deadReckoning.c:22:
../../libDCM/../libUDB/libUDB.h:28:10: error: #include expects "FILENAME" or <FILENAME>
In file included from ../../libDCM/../libUDB/libUDB.h:29,

                 from ../../libDCM/libDCM.h:26,
                 from ../../libDCM/libDCM_internal.h:22,
                 from ../../libDCM/deadReckoning.c:22:
../../libDCM/../libUDB/mpu6000.h:132:2: error: #endif without #if

In file included from ../../libDCM/libDCM.h:26,
                 from ../../libDCM/libDCM_internal.h:22,
                 from ../../libDCM/deadReckoning.c:22:
../../libDCM/../libUDB/libUDB.h:32:21: error: options.h: No such file or directory
In file included from ../../libDCM/../libUDB/libUDB_defines.h:105,
                 from ../../libDCM/../libUDB/libUDB.h:34,

                 from ../../libDCM/libDCM.h:26,
                 from ../../libDCM/libDCM_internal.h:22,
         .......
 
continues in the attached file:::
 
errors.docx

János Mészáros

unread,
Oct 13, 2012, 4:36:04 PM10/13/12
to uavde...@googlegroups.com
Hi guys,

I wrote a short tutorial (see attached pdf file) about quad code compilation in MPLab X. I really hope that it will be helpful to all of you.

@Mark: I really don't want to disturb you with my code ideas, but it would be helpful to modify the libUDB.h and servoOut.c files' include parts as I did and wrote in the pdf file. It is flexible and cause less compilation error while these 2 changes don't affect negatively the basic code and each project contain an options.h file. However, my approach works at the current state of your code and I have no knowledge about your future plans and ideas.

Regards,
János
Compilation_workflow_of_MPQuad.pdf

markw

unread,
Oct 13, 2012, 5:35:07 PM10/13/12
to uavde...@googlegroups.com
János and everyone having problems compiling MPQpid400.X,

Thank you very much for writing this up. I'm sure that users new to MPLAB-X will appreciate it.

I finally found the problem which was causing you to move files up a level from the subproject directory. It was an absolute path
(specific to my system) which should have been specified as a relative path. The change to the MPQpid400.X project files has
just been committed and I hope this eliminates the problems with header files not being found.

For those interested in configuring an MPLAB-X project, a snapshot of the GUI screen for setting a relative include path is attached.

best regards,
--Mark
includeDirs.png

markw

unread,
Oct 13, 2012, 5:40:30 PM10/13/12
to uavde...@googlegroups.com
What does line 28 of libUDB.h look like?
It should be this:
#include "libUDB_defines.h"

Your compiler is saying the filename is missing, but it shouldn't be.

You might try updating your project files again, as I just committed a bugfix in the default makefile,
but I don't think that will solve this problem.

regards,
--Mark

eng.kwili

unread,
Oct 13, 2012, 6:42:42 PM10/13/12
to uavde...@googlegroups.com

Really Thank yopu all for your response and solutions I will be trying them now and I will post the results I hope it will work cuase am working on my graduation project and really there is no time am developing a new application of quadcopter, ad your code is really great but waiting for it to work ::::

 
I figured an important problem in the MPQ6000.X >>>> all the .C Files are replacing th ( &&)and the ( < =  ) with &amp and &lt or &gt so this happen I think because of the download criteria , but now am working on fixing this line by line really too long
 
finally thank you and I will be posting soon the results
 

eng.kwili

unread,
Oct 13, 2012, 6:53:37 PM10/13/12
to uavde...@googlegroups.com
This seems to be great I have changed the directories it alot of errors are gone but I have an error which is the following and I dont now how to deal with it am afraid that I will affect the code ::
 
../../libUDB/background.c:216: error: 'interrupt_save_set_corcon' undeclared (first use in this function)
../../libUDB/background.c:216: error: (Each undeclared identifier is reported only once
../../libUDB/background.c:216: error: for each function it appears in.)
../../libUDB/background.c:255: error: 'interrupt_restore_corcon' undeclared (first use in this function)
 
it keeps poping in all the files that have the "'interrupt_save_set_corcon' " so I tink something must be included or defined
Thank you

eng.kwili

unread,
Oct 13, 2012, 7:22:32 PM10/13/12
to uavde...@googlegroups.com

It seems that the main error is in the libUDB_internal.h because of the definition in the picture attached

 
 
error.png

markw

unread,
Oct 13, 2012, 9:00:14 PM10/13/12
to uavde...@googlegroups.com
Which SVN client are you using, and which version of which OS?

regards,
--Mark

Giulio Berti

unread,
Oct 14, 2012, 2:56:33 AM10/14/12
to uavde...@googlegroups.com
Hi Mark,

the pid400 subproject at revision 1753 finally compiles fine for me! thank you very much!
Now I can try to copy it and start the tricopter subproject :)

Regards,
Giulio

János Mészáros

unread,
Oct 14, 2012, 3:30:49 PM10/14/12
to uavde...@googlegroups.com
Hi Guys,

I'm glad that my short writing was useful and helpful, I'm going to modify it while the described changes were fixed in the new revision.

@Mark
I tried to compile r1756 code and I did it without problem. Thank you for your entire work with Quad code.

Regards,
János

eng.kwili

unread,
Oct 14, 2012, 3:44:51 PM10/14/12
to uavde...@googlegroups.com
 
 
Am using windows 7 OS,  and I dowmloaded the MPQpid400 from the branchs directory which is
 
still the errors are there ....thank you

eng.kwili

unread,
Oct 14, 2012, 3:47:23 PM10/14/12
to uavde...@googlegroups.com
 
I have for now the following error attached ...
 
 

بتاريخ الأحد، 14 أكتوبر، 2012 UTC+3 4:00:14 ص، كتب markw:
error.png

markw

unread,
Oct 14, 2012, 4:49:15 PM10/14/12
to uavde...@googlegroups.com
Which SVN client are you using?

eng.kwili

unread,
Oct 14, 2012, 5:13:33 PM10/14/12
to uavde...@googlegroups.com
 
Actually am not using any SVN software but now I downloaded the tortoiseSVN  is it neccessary to use an SVN software ? and am sorry for that cause am not very good in software area  

markw

unread,
Oct 15, 2012, 1:26:32 PM10/15/12
to uavde...@googlegroups.com
I expect that has been the source of all your problems to date. Your source files seem to be corrupted.

If you try again using TortoiseSVN, you should get the same results as Giulio and Janos.
Peter Hollands has made a tutorial: http://vimeo.com/9245809

regards,
--Mark

markw

unread,
Oct 15, 2012, 1:51:21 PM10/15/12
to uavde...@googlegroups.com
Thanks János,

I'm glad we got that problem fixed.

eng.kwili

unread,
Oct 15, 2012, 7:15:50 PM10/15/12
to uavde...@googlegroups.com
 
Thank you a lot everything is working now and build successful , and am really sorry that I dont know about the SVN and I was wondering how am going to dowmload the code by hand am really missing alot,
So I will work now on testing the quad by the MPQ400pid and I will be posting the results.
 
Thank you alot for the hard work and cooperation hope that I give something in return

markw

unread,
Oct 16, 2012, 9:47:02 AM10/16/12
to uavde...@googlegroups.com
You're welcome. Be sure to also check the MatrixPilot wiki and the DIYdrones pages; there's a lot of useful information available online.

Good luck with your quad, and please let us know what kind of copter you're flying and whether you have any problems with stability.

best regards,
--Mark

eng.kwili

unread,
Oct 24, 2012, 6:11:57 PM10/24/12
to uavde...@googlegroups.com
 
Mr.Mike and everybody , I am using the quad code which is MPQpid400 untill now making the setup of code after compile succesful but I need information about the setup and ground testing , so is all the information in the wiki apply to that code or is it different ?. For example for ground testing is it the same :::

 

 
and am not using GPS will it work ?
 
Thank you.

markw

unread,
Oct 25, 2012, 10:56:25 AM10/25/12
to uavde...@googlegroups.com
MPQpid400 will work without a GPS, and adding a GPS currently doesn't get you much extra capability.

Since the quad branches are a (small) subset of the trunk code, the wiki pages generally apply only to the currently implemented functions,
and you should only expect basic manual mode flight stabilization to work.

Since this is still early development code, the best documentation is the source code itself, and the discussion threads

I've been thinking about adding a wiki page specific to the quad development, but haven't yet had time to work on it.
You may have to wait a while before any wiki material appears.

73,
--Mark

eng.kwili

unread,
Oct 25, 2012, 10:22:18 PM10/25/12
to uavde...@googlegroups.com
Thank you for the information, it would be really an excellent thing to make the wiki for quad, I will be reading the code carefully this week and testing it on quad
but I was wondering that it had  an auto control after manual but it seems no. Actually I will be posting some questions about my application but after making sure the quad is working :) . Mainly my application needs at least two sonar sensors to be implemented and they will control motors in addition to the manual control. It is the graduation project I hope there is enough time. thank you and am sorry writing a lot.

markw

unread,
Oct 26, 2012, 11:33:49 AM10/26/12
to uavde...@googlegroups.com
Good luck with your project. Pete Hollands has been having good results with sonar on a fixed wing aircraft with the UDB4.

73,
--Mark

eng.kwili

unread,
Oct 30, 2012, 12:42:50 PM10/30/12
to uavde...@googlegroups.com
Mr.Mark how are you
 
till now I am testing the Code  MPQ_MW and am afraid to fly the quad because it seems not so stable and the response is slow
also am making the config X and it is showing a  + config I checked the options several times it is okay I dont know what is the problem
 
I was confused because there is two options files the options_base.h and options.h I did a correction as Janos mentioned before I hope it is good/
 
also am using the HKGC station but the telemetry sent is just strange symbols and not working ?

Mark Whitehorn

unread,
Oct 30, 2012, 1:29:38 PM10/30/12
to uavde...@googlegroups.com
Hi eng.kwili,

If the motors don't respond as you expect, check the orientation of the UDB4 and the assignment of motor channels in options.h
The front of the UDB4 (RX inputs) should be pointing to the front motor in + configuration.

options_base.h is the template for options.h. When you start a new project, you should copy it to options.h.

The telemetry isn't yet compatible with any groundstation software.

If you're seeing strange symbols, check the baud rate: TELEMETRY_BAUD
You should be able to use any standard rate.

regards,
--Mark

--
--
 
 



--
Mark Whitehorn
kd0...@gmail.com

eng.kwili

unread,
Oct 30, 2012, 1:45:21 PM10/30/12
to uavde...@googlegroups.com
Dear Mr.Mark ,
 
Thanks for the answer  but when am choosing the X config it response of quad is a + config how can I fix this am sure all connections and options are right I checked a couple of times

János Mészáros

unread,
Oct 30, 2012, 3:19:22 PM10/30/12
to uavde...@googlegroups.com
Hi Eng.kwili,

In X configuration the UDB4 has to point towards the left front arm with its RC input ports. Is this right on your quad?

Regards,
János

eng.kwili

unread,
Oct 30, 2012, 5:31:26 PM10/30/12
to uavde...@googlegroups.com
 
Actually the RC input ports are pointing between the left and right front motors

eng.kwili

unread,
Oct 30, 2012, 6:51:24 PM10/30/12
to uavde...@googlegroups.com
I have Fifured out the problem >>> Actually there is two option files and one option_base the MPQpid400 depend on the three files somehow
 
while checking I figured that all files inside the file MPQpid400 depend on the option.h inside it < but the source files outside the direc. which is main.c motor_contr.c and telem.c depend on the options.h in their directory.
so what I did for now I made all files of options look the same exactly by copy paste .
 
thank you
بتاريخ الثلاثاء، 30 أكتوبر، 2012 UTC+3 10:19:23 م، كتب János Mészáros:

eng.kwili

unread,
Oct 30, 2012, 6:52:32 PM10/30/12
to uavde...@googlegroups.com
 Sorry for the spelling mistakes I write in a hurry <<< it is **Figured :)

Robert Dickenson

unread,
Oct 30, 2012, 10:40:43 PM10/30/12
to uavde...@googlegroups.com
G'day Eng.kwili,

I'm pretty certain it will not work with your UDB board mounted pointing between the two motors. You'll have to remount it to point at the motor-A arm.

Kind regards,

Robert.

--
--
 
 

eng.kwili

unread,
Nov 1, 2012, 11:52:18 PM11/1/12
to uavde...@googlegroups.com
Hello Ansuz,
 
Yes I have fixed that error thank you  

eng.kwili

unread,
Nov 2, 2012, 12:01:23 AM11/2/12
to uavde...@googlegroups.com

Dear Mr.Mark

Am doing now my final ground testing for the quad after checking everything
But now am facing a problem, when I increase the throttle stick to the middle not all the motors have the same speed exactly and one of the motors stops, and when I increase the throttle more it start working with the other motors
even in pitch, yaw and roll not all same speeds.
Is this issue a pure gain adjustment ? and if it is the gain is it enough to adjust it using ch7 input as the code mention or should I adjust the code itself ?
am using the MPQpid400 code
X-flight config and the Turnigy 25A esc.
Thank you
Sincerely

markw

unread,
Nov 2, 2012, 8:37:16 AM11/2/12
to uavde...@googlegroups.com
Hi eng.kwili,

Try setting YAW_KI to zero. You're probably seeing "integrator windup" in the yaw PID controller while the quad is on the ground.

This particular issue has been discussed a few times on the boards, so you might do a search to see what other people have had to say.

--Mark

eng.kwili

unread,
Nov 2, 2012, 1:14:02 PM11/2/12
to uavde...@googlegroups.com
Thank you I will be searching for that probably in this site

eng.kwili

unread,
Nov 8, 2012, 11:33:36 AM11/8/12
to uavde...@googlegroups.com
Dear Mr.mike
Today i was flying the quad but something went wrong the quad is not going up straight I always have an issue with a motor which is slower than others
I have tried many values of gains but I think the issue is the trimmers how can I neglect them through the code ? if that is not the problem what else do you think is the problem
بتاريخ الجمعة، 2 نوفمبر، 2012 UTC+3 3:37:16 م، كتب markw:

Giulio Berti

unread,
Nov 8, 2012, 11:53:40 AM11/8/12
to uavde...@googlegroups.com

Hello,
I suggest to disable HARD_TRIMS in options.h

Regards,
Giulio

--
--
 
 

eng.kwili

unread,
Nov 8, 2012, 12:35:31 PM11/8/12
to uavde...@googlegroups.com
I have tried to put HARD_TRIMS to 0 and the two values under it I didnt change them but also it is still affected by the radio trimmers
and it seems to be unbalanced
 
when I move the throttle stick up the two motors infront of each other rotates and two others not and when playing with the trimmers the other two starts rotating and the others stop they never rotate together four of them
 
except in 75% or more throttle

Mark Whitehorn

unread,
Nov 8, 2012, 3:04:57 PM11/8/12
to uavde...@googlegroups.com
Try doing throttle calibration on your ESCs.  Instructions for that should be in the documentation for your ESCs.

good luck,
--Mark


--
--
 
 



--
Mark Whitehorn
kd0...@gmail.com

john mac

unread,
Nov 11, 2012, 11:48:22 PM11/11/12
to uavde...@googlegroups.com
I wanted to upgrade my Quad code that Jerry Chapman and I wrote based on Matrix Pilot (http://code.google.com/p/matrixpilotheli/wiki/TopLevel?tm=6) to your new MatrixPilotQuad code.  Been reading up on this thread, but wanted to ask a couple basic questions before I go down a rabbit hole.

1) I'm using a UDB4 and MPLAB 8.83
2) Checked out MatrixPillotQuad_MarkWhitehorn into new folder
3) Copied main.c and options.h from MPQpid400.X into MatrixPilotQuad (per some MPLAB-X documentation I found here)
4) Ran MatrixPilotQuad-udb4.mcp
5) On build, it seems to find main.c but not options.h as called from main.c....Build fails
6) I'm sure I will find more errors once I get by this

So questions...

Do I have to use MPLAB-X for this project?  Or can I use MPLAB v8?
What needs to be done for compiler to find options.h in the MatrixPilotQuad directory?  Seems to be some relative vs absolute ref?

I'm thinking it may all be related to having to use MPLAB-X

I didn't find any documentation other than Compilation Workflow of MPQuad.pdf.  Is there a Wiki?

Best,
John

Mark Whitehorn

unread,
Nov 12, 2012, 10:33:09 AM11/12/12
to uavde...@googlegroups.com
Hi John,


comments interleaved below:

On Sun, Nov 11, 2012 at 9:48 PM, john mac <mcclell...@gmail.com> wrote:
I wanted to upgrade my Quad code that Jerry Chapman and I wrote based on Matrix Pilot (http://code.google.com/p/matrixpilotheli/wiki/TopLevel?tm=6) to your new MatrixPilotQuad code.  Been reading up on this thread, but wanted to ask a couple basic questions before I go down a rabbit hole.\
 
    1) I'm using a UDB4 and MPLAB 8.83

2) Checked out MatrixPillotQuad_MarkWhitehorn into new folder
3) Copied main.c and options.h from MPQpid400.X into MatrixPilotQuad (per some MPLAB-X documentation I found here)

The MPLAB8 project files are probably out of date, since my "good" development PC (only 5 years old) runs Linux.
The includes are set up to expect options.h and main.c in the project subdirectory, not up a level in MatrixPilotQuad.
  
4) Ran MatrixPilotQuad-udb4.mcp
5) On build, it seems to find main.c but not options.h as called from main.c....Build fails

You can add include directory paths using the "project properties" in both versions of MPLAB.
 
6) I'm sure I will find more errors once I get by this

So questions...

Do I have to use MPLAB-X for this project?  Or can I use MPLAB v8?
What needs to be done for compiler to find options.h in the MatrixPilotQuad directory?  Seems to be some relative vs absolute ref?

I'm thinking it may all be related to having to use MPLAB-X

It might be best to upgrade to MPLAB-X; then the project should build cleanly on checkout.
 
 
I didn't find any documentation other than Compilation Workflow of MPQuad.pdf.  Is there a Wiki?


I guess we're overdue for a wiki page on this... It's good to see you're back into copter code development.

73,
--Mark

eng.kwili

unread,
Nov 12, 2012, 12:18:48 PM11/12/12
to uavde...@googlegroups.com
Hello,
 
Finally we did our first flight it was good enough for the first time still need some tuning for smoothing the movements but it is excellent
 
I will be posting a video soon and also will be posting all errors and how we fixed them.
 
really thank you Mr.Mark for the great code
 
Sincerely

Mark Whitehorn

unread,
Nov 12, 2012, 2:17:41 PM11/12/12
to uavde...@googlegroups.com
Congratulations eng.kwili,

I'm glad you're making progess.

I appreciate your feedback and look forward to seeing your flight videos and details on your quad's configuration.

73,
--Mark


--
--
 
 



--
Mark Whitehorn
kd0...@gmail.com

john mac

unread,
Nov 12, 2012, 5:24:29 PM11/12/12
to uavdevboard
Hi Mark

I downloaded and installed MPLABX v1.5. I seem to be having compiler
issues.

I assumed I could use the old MPLAB v8 C30 compiler.

I used MPLABX to Open Project MPQpid400.X from your files (fresh
checkout)

Everything loaded, but I get this error:
error: Configuration "default" builds with "C30", but no toolchains of
that type are installed.
Errors have occurred while loading one or more configurations.
If a specific error is not shown above, this may happen when you
import a project from another computer.
+ You can add language tools in Tools->Options embedded tab.
+ You can change which language tool to use in the project
properties dialog.

I went into Tools/Options/Build Tools to see what Tool Chain was being
used and it looked fine:
Type dsPIC
Right Base Directory
Right C compiler
Right Assembler

But when i go to Project Properties, it has:
Right ASM30 with path
C30 (None found)
dsPic (v3_22) with path

So not sure how to get the project to recognize the C30 Compiler even
though the right Tool Chain is set


Should I be downloading the MPLABX Compiler? Which one?

This would be easier if I could include screen shots. I could
probably do that in a direct email to you.

Best,

John








On Nov 12, 8:33 am, Mark Whitehorn <kd0...@gmail.com> wrote:
> Hi John,
>
> comments interleaved below:
>
> On Sun, Nov 11, 2012 at 9:48 PM, john mac <mcclelland.j...@gmail.com> wrote:
> > I wanted to upgrade my Quad code that Jerry Chapman and I wrote based on
> > Matrix Pilot (http://code.google.com/p/matrixpilotheli/wiki/TopLevel?tm=6)
> > to your new MatrixPilotQuad code.  Been reading up on this thread, but
> > wanted to ask a couple basic questions before I go down a rabbit hole.\
>
>     1) I'm using a UDB4 and MPLAB 8.83
>
> 2) Checked out MatrixPillotQuad_MarkWhitehorn<http://code.google.com/p/gentlenav/source/browse/#>into

Mark Whitehorn

unread,
Nov 12, 2012, 7:11:47 PM11/12/12
to uavde...@googlegroups.com
Hi John,

Here's a screenshot of my /opt/microchip directory. New users of MPLAB-X usually just download the recommended XC16 compiler, and it seems to work OK with or without legacy libc. I think you'll just get a warning if the project wants C30 but you just have XC16.

Inline image 1

73,
--Mark


--
--





--
Mark Whitehorn
kd0...@gmail.com

Screenshot.png

john mac

unread,
Nov 12, 2012, 9:23:26 PM11/12/12
to uavdevboard
Thanks Mark...It all built with the XC16.

Now I need to pour thru options.h to set my system up and shake the
cobwebs out of the quad.

Thanks for your help.

John

On Nov 12, 5:12 pm, Mark Whitehorn <kd0...@gmail.com> wrote:
> Hi John,
>
>  Screenshot.png
> 140KViewDownload

Mark Whitehorn

unread,
Nov 12, 2012, 10:13:19 PM11/12/12
to uavde...@googlegroups.com
John,

That's great! 

Although there's no wiki page on options.h (or anything else yet), the embedded comments should explain everything that's unique to multis.

Let me know if there's anything that's not clear, and I'll try to fix it.

73,
--Mark

eng.kwili

unread,
Nov 15, 2012, 6:22:13 AM11/15/12
to uavde...@googlegroups.com
Dear Mr.Mark

we would like you to provide us with the model on which you designed your code and what are your parameters and equations

we are doing a graduation project and we are using your code we would like to do some simulation... we know it may be a private information to you but surely

we will put your name in the acknowledgements and reference all our information

 

and if you cant just give us some links to point us to the right direction

 

thank you

 


بتاريخ الخميس، 4 أكتوبر، 2012 UTC+3 6:21:34 م، كتب eng.kwili:
hello, 
thank you for the hard work done on the matrixpilot, am using udb4 for my quadcopter my isue is that I downloaded the MatrixPilotQuad_markwhitehorn
in a seperate directory of matrix pilot 3.0 and when I compile i have a lot of errors I dont know what is the mistake am doing so could u please tell me how to use the code or how to set it up? ?
thank you.

Mark Whitehorn

unread,
Nov 15, 2012, 9:59:45 AM11/15/12
to uavde...@googlegroups.com
Sorry, but I have no simulation models. The controller is using standard PID techniques described on Wikipedia.

The ArduCopter team is doing a lot of simulation, so you may want to ask them.

regards,
--Mark


--
--
 
 



--
Mark Whitehorn
kd0...@gmail.com

markw

unread,
Dec 4, 2012, 11:41:39 PM12/4/12
to uavde...@googlegroups.com
Hi Ryan,

Sorry, but that's baffling. There should be no difference in behavior with or without the PICkit connected. 

Could there be a problem with your power connections?
And why would your RX PWM outputs change when you disconnect the PICkit?

You weren't running in simulation mode were you?

regards,
--Mark

On Tuesday, December 4, 2012 5:11:05 PM UTC-7, Ryan Rahn wrote:
Mark,

I've been trying to get the MPQpid400 project to work on my UDB4 board. It compiles fine and seems to work fine when I still have the Pickit3 plugged in, but then when I unplug it and reset power (disconnect and reconnect the battery) I just get the dim yellow and the flashing red light with NO GREEN. It doesn't "recognize" the radio. I did some debugging and the pwm inputs are nowhere near 3000 (somewhere around 10k, I think). I was debugging a similar problem with the _UDB5 build and changing the pre/postscaler in (libUDB.c) seemed to help with that build, but not with this one.

I'm just trying to get my quadcopter to work with UDB4. Please help!

I am using OSX 10.8 + MPLABX v1.51 + XC16 v1.10

Any ideas?

Ryan Rahn

unread,
Dec 5, 2012, 1:22:58 PM12/5/12
to uavde...@googlegroups.com
I was thinking it might be power too. I had all 4 ESC's connected (including power for all 4 of them). I connected just one for power and the others only to the signal lines. Stil the same. When I reprogram everything, it works fine (until I unplug the battery), and then it's done. I actually flew it some earlier today, but every time I want to fly it, I have to connect the PICkit3 and (usually, but not always) reprogram it.

Again, the only thing I can think of is that the clock/scaling is changing when the power is reset. Could is be that the clock settings are not being saved to the EEPROM? Also, When I changed the PLL pre/post scaling on the _UDB5 version it affected the scale of the PWM inputs (though that doesn't have the scaling function on it whereas I believe the MPQpid400 does use the scaling function for the PWM inputs.

What's weird is that I don't have this problem with the "gentlenav_quad" code. That code does use the FRC8X_CLOCK, but I tried using the FRC8X_CLOCK setting (in options.h) with the MPQpid400 project and got the same results as before...as soon as the power is cut, it resets to not picking up the radio.

And no, not running in simulation mode. I got it flying actually, I just can't unplug it after I reprogram it.

Ryan Rahn

unread,
Dec 5, 2012, 1:31:31 PM12/5/12
to uavde...@googlegroups.com
Also, the + - rails are showing 5.03V when connected to the ESC, and I am programming it with the ESC power on and charged batteries.

- Ryan

markw

unread,
Dec 5, 2012, 3:49:10 PM12/5/12
to uavde...@googlegroups.com
Ryan,

Are you using the Make and Program Device button (green arrow pointing down) or the Debug Project button (small green arrow pointing towards the right?

Ryan Rahn

unread,
Dec 5, 2012, 3:53:11 PM12/5/12
to uavde...@googlegroups.com
The Make and Program Device button.

Thar

unread,
Dec 6, 2012, 6:03:31 AM12/6/12
to uavde...@googlegroups.com
Hi All, 

I have UDB4 board and want to build quad copter. I have one problem is that when I applied 50% throttle to a motor, the total current draw is 0.8 to 1.2A. After I connected 4 motors and applied 50% throttle to all 4 motors, the total current is still the same (0.8A to 1.2A). Therefore, all the motor are not turning same amount. Anybody has same problem before?  (I am just using  only "output compare module" to apply to the motor. the output waveform from the pin is correct as I check with an oscilloscope )  (2000Kv Micro Brushless outrunner (10g) + Turnigy 6A plush + UDB4 Board)


Please help,

Regards,
Thar Thar

Ryan Rahn

unread,
Dec 9, 2012, 8:11:05 PM12/9/12
to uavde...@googlegroups.com
Looks like it was my RX somehow not liking that the UDB4 gets power before it. If I give it power first, everything is ok. If I give the UDB4 power first, it is *sometimes* ok. Time to upgrade my cheap Chinese junk, I guess. Thanks for the help.

Mark Whitehorn

unread,
Dec 9, 2012, 8:49:53 PM12/9/12
to uavde...@googlegroups.com
Ryan,

Glad to hear you have gotten around the problem. I'd like to understand what's going on; MatrixPilot checks for a valid pulse width on the failsafe channel to decide whether the radio is "on".  

0) Which channel have you designated as the failsafe channel (and what is the valid range of pulsewidths for your radio)?
1) Is your receiver (sometimes) not putting out valid PWM signals when the UDB4 is powered up first?
2) What does your system power configuration look like, and why aren't UDB4 and RX powered on simultaneously?
3) What RX are you using? I've had good luck with the OrangeRX Spektrum compatible ones.

regards,
--Mark


--
--
 
 



--
Mark Whitehorn
kd0...@gmail.com

Ryan Rahn

unread,
Dec 9, 2012, 9:06:51 PM12/9/12
to uavde...@googlegroups.com

0) Throttle (channel 3) is designated as failsafe. I checked channel 5 (failsafe mux) and it is not affected. I would set that as the failsafe channel, but then I would still have bogus throttle inputs.
1) Right now I'm assuming that's what it is. I will have to take it into work and look at it with the oscilloscope to confirm. When the UDB4 is powered up first, and then the TX, one or two of the channels *sometimes* get reversed (up is down, down is up).
2) The UDB4 and RX are powered up simultaneously...which is what was creating the problem. The configuration is as follows: RX <-> UDB4 <-> ESC(s). It's this configuration that messes up the RX (at least some of the channels).
3) I am using a turnigy RX which came with my TX9 flashed with er9X. I am planning on replacing the TX/RX with a a longer range FrSky system. I have been going to do that for range purposes anyway. If that doesn't work, I'll probably have to invest in a Spektrum. I had a Spektrum several years ago but I loaned it out and never got it back. I also have a friend's older (72 Mhz style) futaba TX/RX that I might try.

Also, something to note: I started out with a HobbyKing Control board (gyro only) using the the same power configuration (RX <-> Control Board <-> ESCs), and the RX never seemed to have a problem (that is, all of the channels worked as expected). That board was significantly less sophisticated, but just thought it worth noting.

I will let you know what I found out on the oscilloscope later.

Always glad to be of help any way I can,
-Ryan

Mark Whitehorn

unread,
Dec 9, 2012, 9:19:39 PM12/9/12
to uavde...@googlegroups.com
Ryan,

Thanks for the additional information.

For safety reasons, I always turn the TX on before powering up the aircraft, so you may be seeing behavior I've never experienced. 

On the Turnigy 9X, I have one myself that I plan to do the ER9X upgrade on. After I modify it I'll take a close look at how the RX behaves when powered up with no TX signal.

Still can't imagine how the UDB4 could have any effect on this though. Those are RX PWM outputs that seem to be incorrect, and the UDB4 can't do anything to change the behavior of the RX; no signals of any kind are being sent from UDB4 to RX.

regards,
--Mark

Ryan Rahn

unread,
Dec 9, 2012, 10:37:29 PM12/9/12
to uavde...@googlegroups.com
Sorry I mis"spoke": 1) should be RX not TX. I always have my TX powered on before I power on the aircraft. My bad.

I will take a look at it (including the power signal) more closely with an oscilloscope and report any findings.

- Ryan
Reply all
Reply to author
Forward
0 new messages