10 Replies Latest reply on Sep 2, 2016 2:50 PM by Intel Corporation

    flight controller, Edison pwm

    Thomas Kirven

      Wondering if anyone has built a flight controller using the Edison and an IMU. Just a simple little flight controller with some #includes, that gets IMU data and drives the 4 pwm lines. I am trying and this is the part that isn't working:

       

      mraa::Pwm* pwm1

      pwm1 = new mraa::Pwm(20);

      pwm1->enable(true);

       

      int freq = 50; // Hz

      int per = 1000000/freq; // microseconds

      int pulse = 1400 // microseconds

       

      pwm1->period_us(per);

      pwm1->pulsewidth(pulse);

       

      produces the correct signal, only it isn't recognized by the ESC (the 1.8v pwm output is level shifted to 5v). Meanwhile the same signal from an Arduino Uno IS recognized by the ESC. I am wondering if the low or high voltage level of the PWM signal from the Edison is slightly different from that of the Arduino, (maybe as a result of the level shift?) enough so that it isn't recognized.

       

      Are there any sort of pulldown or pull up resistors on the pwm lines, or any other gpio settings, that could effect the low or high voltage level of the pwm signal?

       

      I greatly appreciate any advice or direction anyone has for me! Thanks,

       

      Thomas

        • 1. Re: flight controller, Edison pwm
          piotrek

          I managed to control my escs with edison pwm using a higher frequency of 1khz instead of the standard 50hz ppm. I only checked it on BLheli but it might work on others.

          • 2. Re: flight controller, Edison pwm
            Thomas Kirven

            Interesting.. I will try that, thanks!

            • 3. Re: flight controller, Edison pwm
              Thomas Kirven

              Piotrek were you not able to get the motors spinning with ant other frequency?

              • 4. Re: flight controller, Edison pwm
                piotrek

                At first I tried to control the motors using the 50 Hz PPM signal, however I quickly discovered that the 8 bit resolution of Edison PWM generator is way too low to keep the quadcopter stable (it gives you like 13 steps from 0% to 100%) so I found in the BLHeli esc documentation that it also supports 1khz, 2, 4, 8 and 12khz true PWM input. However I'm pretty sure that if you can't even get your motors to spin the problems is with something else, but I'm using arduino board so I don't have much experience with all those pullups and shifters.

                • 5. Re: flight controller, Edison pwm
                  Thomas Kirven

                  Ok cool, I am using what eBay says are Emax 12A ESC's w/simonk. They seem to accept any frequency between 10-1000 hz, if it comes from an arduino. Also made the same pwm signal with a signal generator, and it accepts that too, even if the amplitude is less than 5v (went down to about 3v  and the ESC still registered it). The Edison pwm signal however is not accepted, and I am baffled as to why not.

                   

                  With the signal generator I even biased the entire signal so that the ground level was +- 1 volt and the ESC STILL accepted that. It seems to be very adamant about not accepting the Edison signal for god knows why.

                  • 6. Re: flight controller, Edison pwm
                    Thomas Kirven

                    To be clear the problem is not the PWM resolution at this point (though that may be a problem further down the road). The problem is that the Edison pwm signal is not Accepted by the ESC's at all, and it simply doesn't make any sense. Heres why:

                     

                    - An oscilloscope shows that the Edison and Arduino pwm signals are pretty much identical.

                    - A signal generator has shown that the ESC's will accept pretty much any variation of the pwm signal, whether its biased (DC offset of 1v) above or below ground voltage level, also accepts signal lower than 5v which also may be biased above or below ground voltage. In short the ESC's are remarkably permissive regarding signal input.

                    - Somehow, for some ridiculously obscure reason, the ESC doesn't register the Edison signal, though it is much better than the worst signals that were accepted from the signal generator.

                    • 7. Re: flight controller, Edison pwm
                      piotrek

                      Is the code above all you do? You missing the arming sequence

                      • 8. Re: flight controller, Edison pwm
                        Thomas Kirven

                        I don't think these ESC's really require an arming sequence, they respond whenever I give them a pwm signal with any period between 10-1000hz and duty cycle between 1-2 ms, just not when it comes from the Edison. I have also tried giving them an arming sequence from the Edison: a high duty cycle (2ms) followed by a low (1ms) but no response.

                        • 9. Re: flight controller, Edison pwm
                          Thomas Kirven

                          I may have found the problem: It seems the Edison is only putting out 5-10 milliAmps on the pwm lines, while the signal generator and arduino are outputting 50+ milliAmps. As of now this is the only difference I have found between the signals and despite what I've learned about ESC's (that they only care about duty cycle and period) I think that the current must also matter since the Edison PWM is not detected, presumably because it outputs only about 1/10 the amount of current of the other sources, which were both successful in influencing the ESC.

                           

                          CONCLUSION - ESC's need at certain amount of input current.

                          • 10. Re: flight controller, Edison pwm
                            Intel Corporation
                            This message was posted on behalf of Intel Corporation

                            Hi Thomas,
                             
                            That’s a great analysis, good job. Looks like you need an external circuit to increase the current, in your case I recommend you to use an external PWM controller to implement your flight controller.
                             
                            Thank you for remaining so positive.
                             
                            Regards,
                            -Leonardo
                             

                            1 of 1 people found this helpful