Menu

Arduino protocol

Furax49
2013-03-09
2015-12-23
<< < 1 .. 3 4 5 6 7 .. 14 > >> (Page 5 of 14)
  • Petter Wolff

    Petter Wolff - 2014-04-07

    Sorry for the very late answer. Life got in the way...
    I vary between gy_521_send_serial_HAT_ITG and gy_521_send_serial_HAT_ITG_spring_reset
    It's very weird that the home key centering would not work in Arma 3 if it works for you - I have to alt-tab out of the game when I want to re-center.

    Also on a more generic note, I get very strange output sometimes from the Hatire (or is it the Arduino files?); suddenly 'roll' is displayed in the graphs although it's disabled in Hatire settings. Or up becomes down (no I did not take on my headphones switching left-to-right). What's the cause of this?

     
  • Sel

    Sel - 2014-03-20

    Thanks I'll give that a try soon.

     
  • Sebastian

    Sebastian - 2014-03-21

    Hey Sel,

    I did found what you are talking about. I added some filter for Yaw from pitch and roll values to compensate this. I have to still test it but next week I should update the code. I did also put some filters on gyro and compass to get better experience.

     
  • Sel

    Sel - 2014-03-21

    Thanks Sebastian that sounds great, I'm a little tied up right now and won't have any time to do calibrations for a few days.

     
  • Sebastian

    Sebastian - 2014-03-25

    Sorry it is taking so long but I switch engine to one used by Multiwii project. I got board working with smooth pitch/roll compensation but I still need to adapt interface with Furax one. Problem is that they did their own communication over serial which is much harder (for me as I am not C++ specialist) to adapt. The benefit is that it comes with very nice calibration software and it is able to be configured with most of boards. Only thing I have to overcome is the serial communication. I need someway to transfer float into 4 times 8 bits bytes as their interface is sending everything as 8 bits. Unfortunately >> (shifting bits) is not working on floats.

     
  • Sebastian

    Sebastian - 2014-03-27

    I just did uploaded v0.1 based on Multiwii project http://sourceforge.net/projects/gy80facetrack/files/FTR%20v0.2.zip/download
    Good thing about this it does not require libraries for boards as all supported boards have proper codes inside. There is also nice graphical interface to calibrate.
    I will do manual in future (and will try to do it more simpler) but for now:
    1. Go to Calibration\Arduino\Multiwii and open Multiwii.ino
    2. Go to configh.h tab. Uncomment in line 39 #define QUADX and in line 129 #define GY_80 (if you have other board look for it and uncomment only proper one).
    3. Compile and load into Arduino.
    4. Go to Calibration\Config\MultiWiiConf\application.windows32 (windows64 does not work for me for some reason, I left others OS if someone would like to try if it works) and start MultiWiiConf.exe
    5. On left side of interface there will be dialog PORT COM and below COM# (# is your port number for your connection). Click on it. It will go green.
    6. Find and click START button. You will see graph will fill with incoming signals from board. You can also see all numbers on left side.
    7. Click Read button.
    8. Put board on flat surface. Click Calib_Acc and wait few seconds.
    9. Take board in hand and click Calib_Mag. You have 30 seconds to rotate/tilt/roll board in every possible direction (the more movements you will do the better results will be)
    10. Now you can see on right side Pitch Roll and compass with heading. Check if board behave correctly when you turn around, roll, tilt. If not you can repeat calibration
    11. Click write
    10. Close application
    11. Go to FaceTrack\MultiFTR and open MultiFTR.ino
    12. Do steps 2 and 3
    13. Start FaceTrackNoIR and start connection. Always wait up to 4 seconds without movement to allow gyro to calibrate.

     

    Last edit: Sebastian 2014-05-05
  • Sel

    Sel - 2014-03-28

    Thanks for this Sebastian, I hope I can test it out at the weekend I'm just so busy right now.

     
  • Sebastian

    Sebastian - 2014-03-29

    Hello,

    Look again. They only say they are using 9 DOF IMU. They does not say what kind of DOF they will track. And I bet it will be 3 in current configuration. I do not believe that it is possible to do precise positioning without external source (that is why we have GPS IRL).

     
  • Jeff

    Jeff - 2014-04-03

    Hi Sebastian,

    Great Work!

    I plan to give your new calibration code a try. I have a couple of questions though.

    My board (NanoWii) does not have the magnetometer.

    How does the magnetometer improve the interface?

    Will your new code still work on my board if I do not have the magnetometer (NanoWii)?

    If so, I imagine I simply disregard calibration of the magnetometer.

    Thanks!

     
  • Furax49

    Furax49 - 2014-04-03

    Yo men

    Nice solution Sebastian ! I also began to extract the MultiWii library to make a simplified arduino sketch, but it's hard to remove all RC command.

    I have also a NanoWII and I have no YAW values (​​because no magnetometer ?) i quickly compare with MutliWII 2.3 i don't see where is the bug...

    Same problem Jeff?

     
  • Jeff

    Jeff - 2014-04-03

    Hi Furax,

    I'm going to give this a try over the weekend. But, I can tell you I did use my NanoWii for a quad-copter, using the exact same MultiWii code.

    I set it for the Quad X, just as Sabatian mentioned, but i set it for "#define NANOWII // the smallest multiwii FC based on MPU6050 + pro micro based proc <- confirmed by Alex"

    instead of the #define GY_80. My quadcopter flew just fine with this setting and calibrated OK (without calibrating the magnetometer).

    So, I'm going the uncomment #define NANOWII instead.

    I'll stop back and let everyone know if it worked for me.

     
  • Jeff

    Jeff - 2014-04-05

    Hi Furax and Sebastian,

    I also have the same problem Furax experiences. I'm getting no ROLL or PITCH or YAW values in FaceTrack.

    If I reload the original code, FaceTrackNoIR works, so I know it's not the board.

    If I use MultiWii code, I do have pitch and roll, when using the MultiWii calibration program. But of course, no compass interaction.

    I've taken a look at the code, but it was not obvious to me where to change the code to use the gyro and accelerometer to output at least the pitch.

     

    Last edit: Jeff 2014-04-06
  • Sebastian

    Sebastian - 2014-04-06

    Hello Jeff and Furax,

    Sorry I was busy last week.
    I got GY-521 which can be connected as NanoWii (I just uncommented nanowii instead GY80).
    It is true that you will not get yaw with NanoWii as yaw would be based o gyro and could drift with time (same problem as we had before with boards without compass). Problem is in this code in IMU.cpp

    #if MAG
    att.heading = _atan2(
    EstM32.V.Z * EstG32.V.X - EstM32.V.X * EstG32.V.Z,
    (EstM.V.Y * sqGX_sqGZ - (EstM32.V.X * EstG32.V.X + EstM32.V.Z * EstG32.V.Z) * EstG.V.Y)*invG );
    att.heading += conf.mag_declination; // Set from GUI
    att.heading /= 10;
    #endif

    As you can see it is only computing heading if compass is present. This is propably to avoid yaw drifting when flying which is quite dangerous in air. I will try to modify it. So it is not a bug. It is a feature.

    EDIT:
    I made a quick fix but it does not work as I expected. It is behaving like with strong spring effect which is not good for Head tracking. It is propably some kind of filter to avoid drift. Fix is not simple and would require some additional changes in the code of Sensor.cpp

    EDIT2
    For compass users I noticed that if you uncomment #define GYRO_SMOOTHING {20, 20, 3} it improves yaw stability. I changed 3 to 30 for better results but you can try to adjust as you need.

     

    Last edit: Sebastian 2014-04-06
  • Furax49

    Furax49 - 2014-04-06

    I found a solution !
    try that :
    #if MAG
    att.heading = _atan2(
    EstM32.V.Z * EstG32.V.X - EstM32.V.X * EstG32.V.Z,
    (EstM.V.Y * sqGX_sqGZ - (EstM32.V.X * EstG32.V.X + EstM32.V.Z * EstG32.V.Z) * EstG.V.Y)*invG );
    att.heading += conf.mag_declination; // Set from GUI
    att.heading /= 10;
    #else
    att.heading = _atan2(EstG32.V.Y , EstG32.V.X);
    att.heading /= 10;
    #endif

     
  • Jeff

    Jeff - 2014-04-06

    Hi Furax,

    I'm glad to see that you found something. I did give this a try, but I still do not get any roll, pitch, or yaw.

    When I use the Serial Monitor in Arduino, I see data being sent back from the board. But, when I connect to FaceTrackNoIR, I do not get any roll, pitch, or yaw values.

    When I reload Sabastians OLD code (non MultiFTR), the same board works OK in FaceTrackNoIR.

    I tried both uncommenting NanoWii and GY-521 (not at the same time, of course), but I get the same identical results.

    So, I'm at a bit of a loss.

    Sabastians original code works very well for me, so it's not a problem. But, it would be nice to store the calibration and not depend on the 'spring' to maintain the view.

    Furax, are you getting Pitch, Roll, and Yaw values in FaceTrackNoIR?

     

    Last edit: Jeff 2014-04-07
  • Sel

    Sel - 2014-04-12

    Well I finally found some time to get back to this.

    I followed the instructions for setting up the GY80.

    All went well up to

    (11). Go to FaceTrack\MultiFTR and open MultiFTR.ino

    There is no file in FaceTrack

    I tried using the save button MultiWiiConf but the file is just a list of entry key type message.

    snippet

    ?xml version="1.0" encoding="UTF-8" standalone="no"?>
    !DOCTYPE properties SYSTEM "http://java.sun.comdtd
    properties.dtd">
    properties>
    comment>Sat Apr 12 16:20:32 BST 2014</comment>
    entry key="pid.3.d">24.0</entry>
    entry key="power.trigger">0</entry>
    entry key="pid.2.i">0.045</entry>
    entry key="pid.1.p">3.3</entry>

    is this correct?

    I also tried in in FaceTracker without calibrating and it isn't being detected.

    Is this because it wasn't calibrated or another problem like that that Furax is getting.

    I decided to re-check, when load the G80_9DF all the lights on the Ardruino are light and don't flash.

    When I try the new MultiWii only two lights are on static red and flashing green.

     

    Last edit: Sel 2014-04-21
  • RoySIM11

    RoySIM11 - 2014-04-21

    Sebastian and Furax49, I just want to say thanks to you guys. What you have working here sounds pretty promising and I want to give a shot at putting one of these together.

    From the thread, it seems a few different pieces of hardware are floating around:
    -Pro Micro 32u4 controller with GY-521(MPU-6050)
    -MultiWii NanoWii (combined 32u4 controller and MPU-6050)
    -Pro Micro 32u4 controller with GY-80 (which has the included magnetometer)

    I was leaning towards the GY-80 option, but then the thread seems to diverge back towards the NanoWii. Which is currently the more promising option if starting from scratch?

    Thank you for your help.

     
  • Sebastian

    Sebastian - 2014-04-22

    Hello Furax, Jeff, Sel and Roy,

    Sorry for late answers but I have lot of work lately.

    @Furax
    Did not tested but if you did how big was the drift?

    @Jeff
    To be honest I am not sure what is wrong. If the old code works and MultiiWii does not it is strange. But make sure you first try to run it with calibration software (and calibrate).

    @Sel
    You did downloaded http://sourceforge.net/projects/gy80facetrack/files/FTR%20v0.1.ZIP/download which is FTRv0.1.zip? Because when I do I have all files inside (FaceTrack then MultiFTR folder) and you must have all files inside so double check. BTW that fault is coming in Arduino software right?

    @Roy
    I would go with Gy-80 as it does not have drift which MPU6050 will have.

     
  • Sel

    Sel - 2014-04-22

    Thanks I don't know how I missed that, seems I didn't copy all the files.

    Sadly I still can't seem to make use of it.

    No matter how I try and calibrate the Gyro it still seems to be messed up.
    It seems to read two directions at once on the same axis.

    If I tilt it up it also turns left and if I tilt it down it rotates.

    If I set them in FT one by one they work but turn them all on and they're messed up again.

    I'm not convinced calibrating is doing anything, I look at the file dates in MultiFTR and nothing has changed.

    Where is it going when you select write?

    Also don't we have to set declination any more?

     

    Last edit: Sel 2014-04-22
  • Sebastian

    Sebastian - 2014-04-23

    Hey Sel,

    First make sure you have board in proper position (if you have board upside down strange things may happens). Do first ACC calibration then mag. Also after starting application do not move board for 3 seconds as gyro is calibrating. BTW you do not calibrate gyro as it is calibrating by itself but acc.

    -After starting does heading is showing direction and it follows the board when you rotate board? Because even uncalibrated should follow.

    -When you tilt does horizont on right top side of app is tilting and when you pitch up and down does it move? It should do it in the way you are moving even without calibration. If something wrong is going on maybe you have your board in wrong orientation?

    -Magnetic calibration will help to give you better precision.

    -FT is separate thing. First make it work good in calibration software which is much better for testing then FT.

    -Calibration is storing data on board that is why you do not see any changes in files.

    -There is option to set declination but to be honest it is used only when you need to know where is NSEW. Without it you have all direction shifted but it will not change accuracy.

    -One day I will make youtube video to show how I do it but I have to have time for that.

     
  • Sel

    Sel - 2014-04-23

    Cheers Sebastian seems to be working much better tonight, no drift and working in games.
    I think the orientation was wrong, it certainly doesn't match the image printed on the circuit board.
    To see it working correctly in the Calibration I have to have it at 45deg to the screen test the calibration. I couldn't find a way to synch it Gyro to the screen like in FT.

    Anyway thanks for the help.

     
  • Sebastian

    Sebastian - 2014-04-24

    Hey Sel,

    Glad I could help. But it is strange you need to have 45 degrees. Mine is lying flat on table and it works good. What do you mean synch gyro?

     
  • RoySIM11

    RoySIM11 - 2014-04-24

    Sel,

    I believe you mentioned the GY-80 operated sluggishly when you first were trying it out. Now that you have calibrated the Gy-80, is there any noticeable difference in response time? How about comparing it to the MPU-6050?

     
  • Sel

    Sel - 2014-04-26

    It does feel better after calibrating, probably still not as quick as the MPU-6050. It's been a while since I tried the MPU-6050 and I didn't mess with filters in FT.

    Looks like I have another issue, if I unplug the cable or restart PC the Gyro no longer works. I have to go through the whole setup and calibration from scratch.

    As this doesn't happen with the previous software I think there has to be a bug somewhere.

     

    Last edit: Sel 2014-04-26
<< < 1 .. 3 4 5 6 7 .. 14 > >> (Page 5 of 14)

Log in to post a comment.