Shop OBEX P1 Docs P2 Docs Learn Events
Open Propeller Project #4: Program our ESCs with a Propeller — Parallax Forums

Open Propeller Project #4: Program our ESCs with a Propeller

Ken GraceyKen Gracey Posts: 7,392
edited 2014-09-09 19:30 in Propeller 1
OPP-ESCs2Prop.png

Open Propeller Project #4: Program our Electronic Speed Controllers with a Propeller
Help us ditch the $15 ESC programming card!

Hopefully I'm not wearing out my welcome with these requests.

I mentioned in another thread that we are planning significant performance and assembly improvements to the ELEV-8 and would like to drop the price to under $500. While looking at a costed Bill of Materials (BOM) today, one item stood out like something you'd use once and toss into the junk bin: the $14.99 BESC Programming Card. We all have enough electronic junk already, don't we? And why spend money on something we don't really need?

I introduce what appears on the surface to be an easy Open Propeller Project - emulate the programming card with a Propeller P8X32A and save us all some money. There are some good resources on the internet about doing this with a microcontroller. These cards are used to configure the ESC for the ELEV-8. Typically, you connect the programming card to power and the ESC, press a bunch of buttons that determine the settings, press "OK" and unplug the ESC from the programming card.

There may be a couple of programming "gotchas" in this Open Propeller Project. If somebody had no programming card, they can actually program the ESC by connecting it to a receiver and sending signals from their radio. This means it just takes a series of pulses with some specific timing in between them. But this method has no confirmation of the settings you've chosen. When you use a programming card you can also read the settings from the ESC [I believe, but I'm not certain]. To fully emulate the programming card, we'd also like to read the ESC settings if possible.

When I spoke with Daniel and David about this OPP this afternoon they got excited so it must be a reasonably rewarding project. They would probably love to spend their afternoon on this one, but they have other urgent projects in process that all of us would make a higher priority, like the Propeller 2 FPGA, Spinneret 2, a U-BLOX PAM-7Q GPS Module, etc., so we turn to the community with a new challenge! After all, SRLM mentioned in another thread he was going to other web sites to buy new products [and we certainly want to keep him happy here on his home turf with enough core stuff!].

The Goal
  1. Create a Spin/ASM (if required) program which provides a PST-based interactive terminal in which the user can configure the settings of an ESC by entering values, and then "downloading" them to the ESC.
  2. The PST menu choices can be shown by clicking a large picture of the programming card http://www.parallax.com/product/85000.
  3. Provide an option to read the programmed settings back, also using PST.
  4. Once we're all happy with the Spin version, we port it to C for use in Simple IDE so we have two versions of the same code.
  5. Verify that this configuration could be done through the Hoverfly Open board (I can do this part for you since few of us have this board). Maybe somebody could post the schematic in this thread.
The code should be nicely formatted and easy to read, like something Jon McPhalen would've written [I understand this is a subjective request]. The code would be integrated into our future UAS Education Program, and we could happily stop purchasing these cards (and passing the cost on to our customers, too!).

Am I expecting a half-dozen people to collaborate on the code and produce a single, final version? Nah...we'll just pick a final version from the thread, do a bit of minor formatting, and call it done. Yet I imagine there would be a lot of collaboration along the way.

Since you need hardware to do this job, I'd be happy to send out about five to six sets of programming cards and ESCs to those interested in the challenge (please have a domestic address!). I'm not sure if motors are needed to do this project but they might provide some kind of "beep" confirmation. I'll include them if required - just let me know by reply.

Just send me a message with the request to participate kgracey@parallax.com. Post your results here on this thread as you proceed.

Thanking you in advance,

Ken Gracey
600 x 250 - 108K
«1345

Comments

  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2014-03-20 23:10
    Hey Ken,

    This should be easy to get started! I looked into this very thing a while ago and found this link: http://eleccelerator.com/turnigy-esc-programming-card-reverse-engineered/
    It includes C/C++ source code for an atmega (not arduino, just the avr compiler). Works for Turnigy BESC Programming Card compatible ESCs.

    Some issues/details based on reading threads where this guy posted:
    1. The ESCs only go into "programming mode" when they first start up (get power applied) and you signal them appropriately in that startup window, so you can't just put them into programming mode whenever you want.
    2. It seems that the only output their current state once at startup, so you can't "read back" what you wrote in without a power cycle to the ESC.

    The above might not be rigid. It may be possible to send them a signal to make them switch into programming mode and to read out their current state, but it's something that would need to be figured out.

    Edit: After re-reading your post I realized you already linked this same site. Do'h! :) Anyway, the rest of my message applies.
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-03-21 20:24
    Need a few more takers here. Come on crew, we can do better than this! Roy and I are going to be really lonely.

    Need a few more to help out with this OPP.

    Ken Gracey
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-03-22 04:31
    Surely there are some takers here. Shouldn't be too difficult. It does need to be done at power up.
    IIRC the esc has to be setat max on powerup (probably some slight delay while the prop powers up wouldbe ok).

    Sorry Ken, I have toomuch on the go to look at this for now.
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2014-03-22 05:06
    I did a quick port of the code on that site into Spin, and got it working. I was able to successfully program my turnigy ESC and verified the new settings using the turnigy programming card afterwards.

    You need to attach the signal pin from the ESC servo connector to prop pin 6 (or change the code to whatever pin you want), and the ground pin from the ESC servo connector (not the battery ground) to ground on the prop board. These are on the servo connector. Then load/run the program and it'll print "Waiting for ESC...". Now attach power to your ESC (the main battery in). The program should print out the settings it read (hex number), then what it sent back (another hex number). Wait for it to print "Done.", then you can disconnect power from the ESC

    To change what settings get sent, you need to edit the main PUB at the top of the file.

    This is just a quick port to get it working. The comments are all just from the original C code. We can take this and clean it up, and add the PST interactive stuff you described. The hex numbers it prints out can easily be changed into pretty human friendly displays of the settings.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-03-22 06:01
    Nice work Roy.
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-03-22 06:17
    Great job, Roy! Looks like you have all the functionality in the Spin code so it's a matter of adding some user interface - and that's something we can do if another forum member doesn't grab the project. With your work, I'm tempted to mark this project "solved". It'll be Tuesday before I can try it at Parallax, though (we're in Napa for http://www.ecedha.org/conferences/2014-ecedha-annual-conference-and-ecexpo) through Tuesday.

    Then it's a matter of documentation, and then you and Parallax can split the savings on each kit :)

    Really, thanks again, Roy.

    Ken Gracey
  • jazzedjazzed Posts: 11,803
    edited 2014-03-22 09:08
    Ken Gracey wrote: »
    Then it's a matter of documentation, and then you and Parallax can split the savings on each kit :)

    Novel idea.
  • potatoheadpotatohead Posts: 10,261
    edited 2014-03-22 09:19
    Agreed. Nice thought Ken.
  • vanmunchvanmunch Posts: 568
    edited 2014-03-22 13:01
    Roy Eltham wrote: »
    I did a quick port of the code on that site into Spin, and got it working. I was able to successfully program my turnigy ESC and verified the new settings using the turnigy programming card afterwards.

    You need to attach the signal pin from the ESC servo connector to prop pin 6 (or change the code to whatever pin you want), and the ground pin from the ESC servo connector (not the battery ground) to ground on the prop board. These are on the servo connector. Then load/run the program and it'll print "Waiting for ESC...". Now attach power to your ESC (the main battery in). The program should print out the settings it read (hex number), then what it sent back (another hex number). Wait for it to print "Done.", then you can disconnect power from the ESC

    To change what settings get sent, you need to edit the main PUB at the top of the file.

    This is just a quick port to get it working. The comments are all just from the original C code. We can take this and clean it up, and add the PST interactive stuff you described. The hex numbers it prints out can easily be changed into pretty human friendly displays of the settings.

    Way to go!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-03-22 13:51
    I wanted to wait and sleep on this before offering assistance.

    I come back to this thread the next day had Roy has it all figured out.
    Roy Eltham wrote: »
    We can take this and clean it up, and add the PST interactive stuff you described. The hex numbers it prints out can easily be changed into pretty human friendly displays of the settings.

    @Roy, Would you like any help with this? I think I could (and I am offering) help with any of the above tasks you mentioned. Let me know which task(s) you'd like me to help with.
  • macrobeakmacrobeak Posts: 354
    edited 2014-03-22 23:28
    I have a question on programming ESC's that I would like to put forward. Model car ESC's are designed to be programmed for bi-directional rotation - forward/reverse for the car. Other basic ESC's used for planes and boats appear to be only programmable to rotate in a single direction - forward only for the boat or plane. Is it possible to create a program for a basic plane/boat ESC to be bi-directional?
  • StefanL38StefanL38 Posts: 2,292
    edited 2014-03-23 08:12
    @macrobeak

    the programming-card / propeller-code does change parameters. What parameters are offered is based on the firmware of the ESC.
    So if the ESC offers no option to choose unidirectional / bidirectional running of the motor you would have to rewrite the firmware.

    Maybe you can imagine parameters like mounting different brands of tires on a car. Changing tires is pretty easy.
    Changing the firmware is like
    If you want to have four wheel-driving you would have to change a lot of mechanical things inside the car that has only two wheel-driving.

    best regards
    Stefan
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-03-23 09:52
    macrobeak wrote: »
    I have a question on programming ESC's that I would like to put forward. Model car ESC's are designed to be programmed for bi-directional rotation - forward/reverse for the car. Other basic ESC's used for planes and boats appear to be only programmable to rotate in a single direction - forward only for the boat or plane. Is it possible to create a program for a basic plane/boat ESC to be bi-directional?

    I agree with Stefan that this isn't something that could be done using the programming signals.

    If one had access to the microcontroller used by the speed controller, then something like what your talking about might be possible. You'd have to know how to program the particular microcontroller and know what signals to send to the on board hardware. From my limited understanding of how brushless motors work, I don't think this would be an easy task.

    Your question makes me wonder if a bidirectional ESC could be made from the same hardware as an airplane ESC. My (frequently wrong gut) tells me it should be possible.

    The ESC programming going on here is more like selecting settings than truly reprogramming the ESC.

    Here's a picture of the programming card being used.

    attachment.php?attachmentid=96427&d=1350786940

    There's some discussion about which settings to use here.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2014-03-24 13:05
    macrobeak wrote: »
    I have a question on programming ESC's that I would like to put forward. Model car ESC's are designed to be programmed for bi-directional rotation -
    forward/reverse for the car. Other basic ESC's used for planes and boats appear to be only programmable to rotate in a single direction - forward only for the boat or plane. Is it possible
    to create a program for a basic plane/boat ESC to be bi-directional?

    You can not use a card to program in a fwd or reverse unless the speed controller (Esc) is programmed with those options.

    However, you can load your own program into an airplane or helicopter Esc using the information on this thread
    I believe there is another thread for reprogramming the C8051 speed controllers. Either way, there is plenty of well documented
    open source code available for the AVR, C8051, Arduino (avr) and maybe ST micro controllers using C or assembly.

    Note: There are no examples of how to add a reverse in the link I provided, but there is examples written in C in this thread.

    Once you have reprogrammed the Esc, you could build your own controller to reprogram any options you choose.




    Bill M.
  • macrobeakmacrobeak Posts: 354
    edited 2014-03-25 06:46
    Thanks guys, it is clear I should stick with car ESC's if I want bi-directional motors. Car ESC's are a little expensive and are generally a higher power rating. My interest is underwater drones, which need bi-directional motors. There are many sites which suggest 3 phase model motors can operate underwater - apparently the voltage is low enough for minimal current leakage. I did not believe it so I tested them underwater myself - they have worked fine in and out of salt water over a few months. Bouyancy and direction control is easy and responsive - it is really cool! I can't see why the motors should not work underwater for a long life, especially if you immersed the motor in light oil after underwater operation.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-03-25 08:11
    macrobeak wrote: »
    I did not believe it so I tested them underwater myself - they have worked fine in and out of salt water over a few months. Bouyancy and direction control is easy and responsive - it is really cool! I can't see why the motors should not work underwater for a long life, especially if you immersed the motor in light oil after underwater operation.

    I've heard brushless motors will work underwater but I think I'm going to have to try it myself to really believe it. It sure sounds like a cool idea.

    What about adding a DPDT switch to two of the three motor power lines? In order to switch the direction a brushless motor is turning, you swap two of the three power lines. This would something easy to program a microcontroller to do. I think this technique would probably work best if the motor was allowed to stop before the direction is changed.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2014-03-25 14:55
    macrobeak wrote: »
    Thanks guys, it is clear I should stick with car ESC's if I want bi-directional motors.


    That isn't necessary, some airplane, helicopter, and quadcopter esc's are equipped with a reverse.
    They are just not as common as the esc's that offer only one direction.

    For example: this HobbyKing 20A BlueSeries Brushless Speed Controller is equipped with a reverse.
    It is also one of the esc's that can be flashed with the SimonK firmware.

    This older "Mystery Pentium" BLDC Esc is also equipped with a programmable reverse. But it is an older
    esc and the newer esc's do not seem to have that option.

    Also: I am not sure if it can change direction in flight, or if it is only capable of CW or CCW operation.

    However SimonK programed in a "RC Car like Reverse" so that quad copters could fly upside down. Takao also wrote several
    examples of an "RC Car like Reverse" for Arduino based esc's and the examples were simpler than you might think.

    I have included a spread sheet listing bldc esc's that SimonK's software will flash, and 2 links on re-flashing the
    esc. Link 1 Link 2, I recommend you read this one

    This is one of Takao's examples of a program including CW & CCW rotation based on throttle input for a motor equipped with hall
    sensors.

    If you are interested in adding hall sensors to Outrunners 1
    adding hall sensors to Outrunners 2
    adding hall sensors to Outrunners 3
    adding hall sensors to Outrunners 4
    The Quadcopter guys may also be interested in link#3. Link #1 is for larger robotic motors.
    // Date: Jan. 3rd, 2011
    // Author: Takao
    // This is for "Arduino Nano ATMega328" Towerpro sensored Brushless motor(DV8V,1.5A no-load) drive test SKETCH program with all N-ch 
    //driver.
    //
    int Hall_Orange_In = 7;
    int Hall_White_In = 6;
    int Hall_Green_In = 5;
    unsigned Propo_Pulse_In = 0;
    unsigned char DRIVE_STATE;
    unsigned char SENSE_CODE;
    unsigned char PREV_SENSE_CODE;
    int PWM_Pin = 3;      // PWM(2048uS frame, duty 255:1) outputat at digital pin 3
    int Propo_in = 2;  // digital propo interrupt input-pin 2
    signed int PWM_Duty;
    unsigned char PWM_ON;
    boolean counting = false;
    unsigned long time1;
    unsigned long time2;
    unsigned char PWM_Status;
    boolean rpmdirection;
    //
    void setup()
    {
      pinMode(Hall_Orange_In, INPUT);   // set the digital pin as output:     
      pinMode(Hall_White_In, INPUT); 
      pinMode(Hall_Green_In, INPUT);   // sets the pin as MOSFET drive output
      digitalWrite(Hall_Orange_In, HIGH);       // turn on pullup resistors
      digitalWrite(Hall_White_In, HIGH);       // turn on pullup resistors
      digitalWrite(Hall_Green_In, HIGH);       // turn on pullup resistors 
    
      PORTB &= 0xc0;
      DDRB = 255;  // all push-pull output on portB
      pinMode(Propo_in, INPUT);  // sets the pin as input
      pinMode(PWM_Pin, OUTPUT);   // sets the pin as output
      attachInterrupt(0, Propo_Pulse_Width_Counting, CHANGE);  // Digital Propo in pin2
      //    Serial.begin(115200);
    }
    //
    void loop()
    {
      /*PORTB &= 0xc0;
       delayMicroseconds(10);
       //PORTB |=0x07;	// xx00 0111 UH(D13,PB5)="L", VH(D12,PB4)="L", WH(D11,PB3)="L", WL(D10,PB2) ="H", VL(D9,PB1)="H", UL(D8,PB0)="H"   
       PORTB |=0x20;	// xx00 0111 UH(D13,PB5)="L", VH(D12,PB4)="L", WH(D11,PB3)="L", WL(D10,PB2) ="H", VL(D9,PB1)="H", UL(D8,PB0)="H" 
       delay (1);
       PORTB &= 0xc0;
       delayMicroseconds(10);
       PORTB |=0x01;
       delay (1);
       */
      SENSE_CODE = (PIND & 0xe0);
      if (( PREV_SENSE_CODE != SENSE_CODE ) || (Propo_Pulse_In<10))
      {
        Spin_Free ();  
        delayMicroseconds(10);//MOSFET switching time
      }
      PREV_SENSE_CODE = SENSE_CODE;
      delayMicroseconds(10);  //Arduino BUG
      //  Serial.print(PWM_ON,OCT);
      //  Serial.print("");    
      {
        if ((PWM_ON > 0) && (rpmdirection == 1))
        {
          CCW ();
        }
        else
        {
          if (( PWM_ON > 0) && (rpmdirection == 0))
          {
            CW ();
          }    
        }
      }//
      if (counting == false)  // print once after the propo pulse width has been measured only.
      {
        PWM_Duty = (time2-time1-1000)>>1; // Get about integer length duty control data for byte length limitaion PWM function
        if ((PWM_Duty < 280) && (PWM_Duty > 220))  // DEAD BAND setting
        {
          PWM_ON = 0; 
          digitalWrite (PWM_Pin,PWM_ON);  // Keep off at throttle near off
          Spin_Free ();  
          delayMicroseconds(10);//MOSFET switching time  
          Braking ();
        }
        else
        {
          if ( PWM_Duty > 250 )  // upper limit as 100% duty ON setting
          {
            rpmdirection = 1;      
            if ( PWM_Duty > 504 )
            {
              PWM_Duty = 505;
            }
            PWM_ON = (PWM_Duty-250);
          }
          else
          {
            if (PWM_Duty < 250)
            {
              rpmdirection = 0;
              if (PWM_Duty<0)
              {
                PWM_Duty=0;
              }
              PWM_ON = (255-PWM_Duty);
            }
          }
          if (PWM_ON>0)
          {
            analogWrite(PWM_Pin,PWM_ON);  // 2mS fram. analogWrite values from 0 to 255 x 8uS, zero is invalid as keeping duty as before.
          }  
        }
        counting = true;
      }
      PWM_Status = PIND & 0x08;  // read PWM status on Pin3 
      if (PWM_Status == 0)
      {
        Spin_Free ();
      }
    }
    //
    void CCW ()
    {  
      switch (PREV_SENSE_CODE)
      {
      case 0x60:
        {
          State1_On ();
          break;
        }
        //
      case 0x40:
        {
          State2_On ();
          break;
        } 
        //
      case 0xc0:
        {
          State3_On ();
          break;
        }
        //
      case 0x80:
        {
          State4_On ();
          break;
        }
        //
      case 0xa0:
        {
          State5_On ();
          break;
        }
        //
      case 0x20:
        {
          State6_On ();
        }
      } 
    }
    //
    void CW ()
    {  
      switch (PREV_SENSE_CODE)
      {
      case 0x60:
        {
          State4_On ();
          break;
        }
        //
      case 0x40:
        {
          State5_On ();
          break;
        } 
        //
      case 0xc0:
        {
          State6_On ();
          break;
        }
        //
      case 0x80:
        {
          State1_On ();
          break;
        }
        //
      case 0xa0:
        {
          State2_On ();
          break;
        }
        //
      case 0x20:
        {
          State3_On ();
        }
      } 
    }
    //--------------------------------------
    // Motor drive each state control 
    //--------------------------------------
    void State1_On ()	// W open	
    {
      PORTB |=0x22;	// xx10 0010 UH(D13,PB5)="H",VH(D12,PB4)="L", WH(D11,PB3)="L", WL(D10,PB2) ="L", VL(D9,PB1)="H",  UL(D8,PB0)="L"
    }
    //
    void State2_On (void)	
    {				
      PORTB |= 0x24;	// xx10 0100  UH(D13,PB5)="H", VH(D12,PB4)="L", WH(D11,PB3)="L", WL(D10,PB2) ="H", VL(D9,PB1)="L", UL(D8,PB0)="L"	
    }
    //
    void State3_On (void)	
    {				
      PORTB |=0x14;	// xx01 0100 UH(D13,PB5)="L", VH(D12,PB4)="H", WH(D11,PB3)="L", WL(D10,PB2) ="H", VL(D9,PB1)="L", UL(D8,PB0)="L"	
    }
    //	
    void State4_On (void)	
    {				
      PORTB |=0x11;	// xx01 0010  UH(D13,PB5)="L", VH(D12,PB4)="H", WH(D11,PB3)="L", WL(D10,PB2) ="L", VL(D9,PB1)="L", UL(D8,PB0)="H"	
    }
    //
    void State5_On (void)	
    {				
      PORTB |=0x09;	// xx00 1001 UH(D13,PB5)="L", VH(D12,PB4)="L", WH(D11,PB3)="H", WL(D10,PB2) ="L", VL(D9,PB1)="L", UL(D8,PB0)="H"
    }
    //
    void State6_On (void)	
    {				
      PORTB |=0x0a;	// xx00 1001 UH(D13,PB5)="L", VH(D12,PB4)="L", WH(D11,PB3)="H", WL(D10,PB2) ="L", VL(D9,PB1)="H", UL(D8,PB0)="L"
    }
    //
    void Spin_Free (void) // All output MOSFETs off
    {
      PORTB &= 0xc0;	// xx00 0000 UH(D13,PB5)="L", VH(D12,PB4)="L", WH(D11,PB3)="L", WL(D10,PB2) ="L", UL(D8,PB0)="L", VL(D9,PB1)="L"
      //	PCA0CPH2 = 0;	// 101009 Watch dog timer off.
    }
    //
    void Braking (void)	
    {				
      Spin_Free (); // All MOSFTEs off DOES NOT WORK on Toshiba IGBT unit
      PORTB |=0x07;	// xx00 0111 UH(D13,PB5)="L", VH(D12,PB4)="L", WH(D11,PB3)="L", WL(D10,PB2) ="H", VL(D9,PB1)="H", UL(D8,PB0)="H"
    }
    //
    void Propo_Pulse_Width_Counting()
    {
      if ( digitalRead(Propo_in) == HIGH)
      {
        //  Serial.print("H");
        time1 = micros();
      }
      else
      {
        //  Serial.print("L");
        time2 = micros();
        Propo_Pulse_In ++;  // TX On?
        if (Propo_Pulse_In>10)
        {
          Propo_Pulse_In = 10;
        }
        counting = false;
      }
    }
    // Program End
    

    macrobeak wrote: »
    My interest is underwater drones, which need bi-directional motors. There are many sites which suggest
    3 phase model motors can operate underwater - apparently the voltage is low enough for minimal current leakage. I did not believe it so I
    tested them underwater myself - they have worked fine in and out of salt water over a few months.

    I have a lot of experience tuning Sea Doo's and Jet Ski's for salt water or fresh water racing. With your own code, you could do the same,
    and by building a programmer, you could adjust your motors to be more efficient for either fresh or salt water.

    Bill M.
  • macrobeakmacrobeak Posts: 354
    edited 2014-03-26 03:01
    Duane Degn wrote: »
    I've heard brushless motors will work underwater but I think I'm going to have to try it myself to really believe it. It sure sounds like a cool idea. What about adding a DPDT switch to two of the three motor power lines? In order to switch the direction a brushless motor is turning, you swap two of the three power lines. This would something easy to program a microcontroller to do. I think this technique would probably work best if the motor was allowed to stop before the direction is changed.
    Duane, Thanks, the swapping of 2 of 3 power lines is a good idea. The motor stops pretty quickly underwater, so it is fine. Go ahead and test the brushless motors underwater - you will be pleasantly surprised. The hobby fan ducted units are really cheap and make good underwater thrusters. The only problem is that they have high kV motors which are too fast for underwater use and easily draw too much current. I have not been able to find a fan ducted unit with a low kV motor - perhaps one of the experts posting here can help.
  • icepuckicepuck Posts: 466
    edited 2014-03-26 12:54
    Why not an esc based on the propeller ? Solves the problem of trying to figure out some one eles firmware.
    -dan
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-03-26 13:11
    icepuck wrote: »
    Why not an esc based on the propeller ? Solves the problem of trying to figure out some one eles firmware.
    -dan

    When it's been done cost-effectively already by the Chinese there's little reason to try to duplicate a low-cost, optimized production effort.

    But I'm happy to get rid of the ESC Programming Card. I'm still waiting to hear from David Carrier whether or not the ESCs can be programmed through the OPEN board (there's some buffer circuitry between the I/Os).

    Ken Gracey
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2014-03-26 16:43
    Ken Gracey wrote: »
    When it's been done cost-effectively already by the Chinese there's little reason to try to duplicate a low-cost, optimized production effort.

    I used to think that too, but their product is only as good it's software, and as a result 2nd & 3rd time buyers are
    purchasing esc's from US and European sources.
  • PublisonPublison Posts: 12,366
    edited 2014-05-16 13:42
    Just wanted to check if others have had success programming the current ELEV-8 ESC's with Roy's program..

    I'm at the point in my ELEV-8 build to program my ESC's , but my card is DOA. I want to be green and do it over the ether instead of Parallax sending me a new card. :)

    Jim
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-15 23:40
    Publison wrote: »
    Just wanted to check if others have had success programming the current ELEV-8 ESC's with Roy's program..

    I'm at the point in my ELEV-8 build to program my ESC's , but my card is DOA. I want to be green and do it over the ether instead of Parallax sending me a new card. :)

    Jim

    Jim,

    Yes, I did connect an ESC, program it and then plugged it into the card programmer to see the changes reflected. Interestingly I was unable to monitor the data with my scope. Even on X10 it seems to load the signal line down enough where the ESC won't respond with it attached. I will have to look more into this later.
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-07-25 21:51
    Hey all,

    We still need some help on this important OPP. :smile:

    I've attached the code we're using which is a modified version of Roy's code from the first page - the same except with a different PST interface. And I've also attached our ESC Programming Test Procedure. We need to get this resolved because we're shipping new ELEV-8 V2s starting next week.

    We have three problems. First, this seems to work but only under ideal conditions. Second, there is no verification stage. I've checked ESCs with programming cards after I've run this code and sometimes they're right, other times not. It would be ideal to read back the program settings and display them on PST with a "ESC Passed Programming" message. And finally, we're not all that sure of the actual power arrangement to be perfectly honest. We can get reasonably successful programming rates using a 9VDC power adapter with Vin going to the ESC's signal/power/ground connector with no power attached to the battery side of the ESC. We get slightly better programming success with an external 11VDC power supply connected to the ESC's battery connector and a regulated 5VDC on the ESC's signal/power/ground connector. We should have 100% success with our programming method.

    I can send out pairs of ESCs and programming to anybody who wishes to help us obtain this small but important project.

    Just send Julia an e-mail with your domestic shipping destination via jquillen@parallax.com and copy me kgracey@parallax.com. Don't use PMs with me, please, as I can hardly stay on top of e-mail without more communication around me.

    In the meantime I'm seeking out a programming specification from the supplier. I believe this is the actual model http://www.dys.hk/Download/HW25A30A.pdf. If an R/C radio can program these without a programming card, any microcontroller with compatible logic levels can certainly do the same.

    Thanks!

    Ken Gracey
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-07-25 22:18
    Ken,

    I should already have all I need to work on this. I don't mind working on this project, I just don't want to be duplicating someone else's efforts.

    I can use a logic analyzer to watch the communication between the programming card and the ESC to see how it queries the ESC for the settings and attempt to replicate this with the Propeller.

    I'll get working on this right away unless someone else really wants to do it (it won't hurt my feelings for someone else to do this).

    As I said, I already have all the gear so I won't be bothering Julia.
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-07-25 22:20
    This would be most fantastic, Duane.

    I don't like to burden any of you with this kind of project we should be able to do on our own, but we're really overloaded right now.

    Let me know if you need anything whatsoever.

    Ken Gracey
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-07-25 23:16
    Does the Parallax programming card work for other ESC's also or is it Parallax specific?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-07-26 00:27
    NWCCTV wrote: »
    Does the Parallax programming card work for other ESC's also or is it Parallax specific?

    Mine is a "Turnigy" card. I don't think I got it from Parallax but I know I've used it with the ELEV-8's ESCs. Besides Turnigy brand ESCs it also works with a lot of HobbyKing ESCs (but not all HobbyKing ESCs can be programmed). I'm not sure what other brands of ESCs it will program.

    @Ken, I think Roy's code will make this relatively easy. It looks like the timing could be improved by using synchronized delays rather than fixed delays. My guess is the Spin overhead in places is causing occasional timing glitches. I'm pretty confident this task is within my present skill set.

    I doubt it will be needed, but the timing could be made really tight by using PASM.
  • PublisonPublison Posts: 12,366
    edited 2014-07-26 08:36
    There is a discrepancy with the programming of the battery type. The Hoverfly documentation for the Open Board states, "Battery Type-NiMh (even if you use LiPo)"

    Parallax documentation states to set battery type to Li-xx, (assuming Li-Po).

    The program sets the battery type to NiMh, and LiPo cells to 3.

    Confusing.
  • trangertranger Posts: 179
    edited 2014-07-26 10:01
    Publison wrote: »
    There is a discrepancy with the programming of the battery type. The Hoverfly documentation for the Open Board states, "Battery Type-NiMh (even if you use LiPo)"

    Parallax documentation states to set battery type to Li-xx, (assuming Li-Po).

    The program sets the battery type to NiMh, and LiPo cells to 3.

    Confusing.

    Hmmm... yeah, very confusing. That setting (LiPo, NiMh) controls the voltages used for high / med / low cutoff values. The LiPo settings are 9.3 / 8.55 / 7.80 for a 3S pack. The NiMh settings would be 7.56 / 5.67 /"not used". Essentially those would be useless, the LiPo would be out of gas long before the cutoff kicked in. I think the Hoverfly documentation is wrong on this one.

    -Russ
Sign In or Register to comment.