Thread Tools
Apr 30, 2019, 02:47 PM
Registered User
RCvertt's Avatar
Thread OP
And what BluePill pin is that at the top right of the board? I know one pin is power, the other is ground, but what BluePill equivalent is the third pin?
Sign up now
to remove ads between posts
Apr 30, 2019, 08:03 PM
Registered User
MGeo's Avatar
I've been using these. PA4 samples the middle of a resistor divider connected to VBAT input. The Spektrum satellite connection goes to RXD at PA10.
Apr 30, 2019, 09:34 PM
Registered User
RCvertt's Avatar
Thread OP
Great. Just the info I was looking for. Thanks.

learningarduino on another thread said that the resistor values have to be changed if I want to use a 4 cell flight battery. We can't just change the complimentary filter battery code.

So if I want to use a 4cell flight battery with the flip32, it sounds like the best option is to just remove the battery voltage code and don't connect the flight battery to the flip32 vbat pin. All it does is turn on a LED as far as I can tell.
Last edited by RCvertt; Apr 30, 2019 at 10:21 PM.
Apr 30, 2019, 10:42 PM
Registered User
RCvertt's Avatar
Thread OP
Updated Pin chart.
May 01, 2019, 05:06 AM
Registered User
MGeo's Avatar
Quote:
Originally Posted by RCvertt

learningarduino on another thread said that the resistor values have to be changed if I want to use a 4 cell flight battery. We can't just change the complimentary filter battery code.

So if I want to use a 4cell flight battery with the flip32, it sounds like the best option is to just remove the battery voltage code and don't connect the flight battery to the flip32 vbat pin. All it does is turn on a LED as far as I can tell.
I don't see any need to change resistors, the present values remain in ADC range with 4 cells.

As you said, the simplest is to just remove the voltage sense code. Beta/Cleanflight went on for years before adding VBat compensation (https://github.com/cleanflight/clean...8dda59afefd3db). This feature can cause issues if not well implemented (filtering, limiting) and can add failure modes (i.e. if you don't limit and the v_sense wire falls off you fall from the sky). Battery voltage changes maybe 20% over a flight, so you could get by just fine without PID loop compensation and keep things simple for now. You do obviously have different PID values at different pack cell counts.
May 02, 2019, 02:19 PM
Registered User
RCvertt's Avatar
Thread OP
Thanks MGeo. I'll give it a try.
May 11, 2019, 11:43 PM
Registered User
RCvertt's Avatar
Thread OP
Testing controls.

DiyConvergence (0 min 46 sec)
May 15, 2019, 10:35 PM
Registered User
RCvertt's Avatar
Thread OP
First hover tests. Gyros only, no accel influence yet. I am unable to hover my real Convergence in gyros only mode so I am encouraged by the results. It feels loose but definitely controllable.

DiyConvergence GyroOnly Hover Test1 (1 min 15 sec)


DiyConvergence GyroOnly Test2 (1 min 25 sec)
Last edited by RCvertt; May 16, 2019 at 01:50 AM.
May 17, 2019, 01:39 AM
Registered User
RCvertt's Avatar
Thread OP

Heading hold with gyros only


I'm interested in getting some heading hold in here without the use of a magnetometer. Old AeroQuad had it in a build sent to me and I later implemented it into a MultiWii build but I can't find either one of those anymore So we get to do it from scratch again which should be fun I also recall AeroQuad doing some y=mx+b but not sure if the slope of a line helps us with heading hold or not.

While searching for the old heading hold code, I found this formula I wrote down at some point. Not sure if it's helpful or not.
Code:
 current heading (degrees) = gyro value (degrees/sec) * elapsed time per pass (sec) + previous heading (degrees).

desired heading (degrees) = gyro value (degrees/sec) * elapsed time per pass (sec) + previous heading (degrees).
Also came across this video which talks about getting a heading from gyros only, which might be helpful. Posting all of this in hopes it helps get some ideas from others on how to get this into Joops YMFC32.
Gyro Heading Calculation (10 min 41 sec)


Multiwii thread I found with heading hold info using only gyros. Might be use full?
http://www.multiwii.com/forum/viewto...ng+hold#p50867
Last edited by RCvertt; May 17, 2019 at 04:42 AM.
May 17, 2019, 02:00 AM
Registered User
Woga65's Avatar
Quote:
Originally Posted by RCvertt
First hover tests. Gyros only, no accel influence yet. I am unable to hover my real Convergence in gyros only mode so I am encouraged by the results. It feels loose but definitely controllable.

https://youtu.be/IQFNjccTWJc

https://youtu.be/1dwMBbYDsbg
Great to see your project takes shape.
May 18, 2019, 02:13 AM
Registered User
RCvertt's Avatar
Thread OP
Thanks Woga65. Hard to believe we're just a few months shy of a year since I started. Time goes by quick when you don't have much of it to spend on a project.

Found this heading hold code example online. Looks a little closer to the formula I posted.

https://forum.arduino.cc/index.php?P...325#msg2005325

Code:
angle = 0;

loop {

dt = time_now() - time_of_last_read; //seconds
rate = read_gyro();  //degrees/second
time_of_last_read=time_now();

angle += rate*dt;

do_something();
}
May 18, 2019, 04:39 AM
Registered User
RCvertt's Avatar
Thread OP
First pass at trying to conform those formulas and the last code post into something the YMFC32 can use. Also trying to make it readable to me. Not tested in anyway yet. Just writing it down.

Not sure how this works with the PID info? Just add the PID results for yaw and the results of this heading hold code together?

Code:
unsigned long currentTime;
unsigned long deltaTime;
unsigned long currentHeading = 0;
unsigned long previousTime;
unsigned long previousHeading = 0;

void loop
 {
  currentTime = millis();
  deltaTime = currentTime - previousTime;
  currentHeading = previousHeading + first_gyro_yaw_input * deltaTime; 

  previousTime = currentTime;
  previousHeading = currentHeading;
 }
Last edited by RCvertt; May 18, 2019 at 04:55 AM.
May 19, 2019, 02:18 AM
Registered User
RCvertt's Avatar
Thread OP
So these code parts appear to be holding heading but the movement has large steps in it for some reason...

Code:
int headingHold = 1;                    
unsigned long currentTime;                     
unsigned long deltaTime;                       
long currentHeading = 0;           
unsigned long previousTime;                   
long previousHeading = 0;            


  if (headingHold == 1)                                                                     
     {
      currentTime = (millis() / 1000);      //Divide by 1000 to get seconds.
      deltaTime = currentTime - previousTime;
if (channel_3 < 1050) currentHeading=0;
    else currentHeading = previousHeading - first_gyro_yaw_input * deltaTime;                                             

      previousTime = currentTime;
      previousHeading = currentHeading;      
     }


pid_yaw_setpoint -= currentHeading;



Trying to find out why when millis is used, the error grows super quick, much faster than the gyro is actually drifting. With millis/1000 the error grows much slower but I think the millis/1000 is causing the large stepped jitters for some reason.

Also don't see the point in the calculating "deltaTime". I printed it out and it is always zero
Last edited by RCvertt; May 19, 2019 at 07:33 PM.
May 28, 2019, 04:03 AM
Registered User
RCvertt's Avatar
Thread OP

Spektrum R617XL receiver


This was nice an easy. Got the setup program working with the Flip32 and an R617XL CPPM receiver bound to my DX6e in DSMX mode.

Default code is Futaba channel order so I just rearranged them a little to match Spectrum channel order.
Code:
//  if (channel_select_counter == 1)channel_1 = measured_time;   //Futaba=Aileron  Default
//  if (channel_select_counter == 2)channel_2 = measured_time;   //Futaba=Elevator Default
//  if (channel_select_counter == 3)channel_3 = measured_time;   //Futaba=Throttle Default
//  if (channel_select_counter == 4)channel_4 = measured_time;   //Futaba=Rudder   Default
//  if (channel_select_counter == 5)channel_5 = measured_time;   //Futaba=Gear     Default
//  if (channel_select_counter == 6)channel_6 = measured_time;   //Futaba=Aux1     Default

  if (channel_select_counter == 1)channel_3 = measured_time;   //Spektrum=Throttle
  if (channel_select_counter == 2)channel_1 = measured_time;   //Spektrum=Aileron
  if (channel_select_counter == 3)channel_2 = measured_time;   //Spektrum=Elevator
  if (channel_select_counter == 4)channel_4 = measured_time;   //Spektrum=Rudder
  if (channel_select_counter == 5)channel_5 = measured_time;   //Spektrum=Gear
  if (channel_select_counter == 6)channel_6 = measured_time;   //Spektrum=Aux1
Last edited by RCvertt; May 28, 2019 at 03:01 PM.
May 28, 2019, 03:04 PM
Registered User
RCvertt's Avatar
Thread OP
Anyone know what pin the Flip32 is supposed to be powered by when the USB is not connected?

Not all of the power pins appear to behave the same. When USB is connected only two pins send out 3.3v. The rest send out only .29 volts.


Quick Reply
Message:

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Question Arduino combat rc quadcopter/drone DMKL Multirotor Drone Electronics 0 Aug 03, 2017 05:49 AM
New Product Crazepony Open Source With STM32 MS5611 Mini Quadcopter RTF bluetooth crazy pony Drra Mini Multirotor Drones 103 May 21, 2017 05:28 PM
Discussion Openpilot port to CJMCU stm32 quadcopter fishpepper Mini Multirotor Drones 25 Aug 22, 2016 01:41 AM
Help! Arduino Quadcopter Spinning Problem (DC motor) jswcomkr Multirotor Drone Talk 0 Jan 04, 2016 12:12 PM