Shop OBEX P1 Docs P2 Docs Learn Events
Microstepping a motor with the Propeller and PWM - Page 2 — Parallax Forums

Microstepping a motor with the Propeller and PWM

2»

Comments

  • jmspaggijmspaggi Posts: 629
    edited 2011-01-12 11:58
    There is no solders because I'm using an header. I don't want to have to solder all the 25 pins each time I'm doing a test ;)

    Just to see if the issue was coming from the header, I just tried on a brand new board without the header, and I just burned another TB6560. I putted a sink and a fan on it just to be safer, and was able to burn it even at 12V :(

    Only 2 TB6560 remaining. After that I will move to a Gecko drive...

    JM
  • SapiehaSapieha Posts: 2,964
    edited 2011-01-12 13:11
    Hi jmspaggi.

    Maybe that can help YOU.
    Look attached PDF
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-12 13:14
    Thanks Sapieha.

    I already have this one too.

    I was able to get some results few minutes ago with another TB6560. But 2 outputs seems to always be low. I will have to figure that. There might be some bad connection somewhere. Ouf. Long road! :(

    JM
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-01-12 16:37
    jmspaggi wrote: »
    New tries, new failures...

    Sorry to hear this.

    Are you able to do any sort of diagnostics on the circuit (multimeter, oscilloscope, etc) before it burns up, or does it burn up too fast to even watch what is happening?

    One problem with using a header to connect the chip is that the header will not be very good at sinking the heat that builds up in the chip. The usage considerations suggest using a heat sink, too.

    The usage considerations also suggest The power-on sequence described on page 28 must be properly followed But I haven't been able to find the page they are talking about. Perhaps there is some trick to powering up this chip???

    Do you happen to have a fuse between the power supply and the chip like the usage considerations indicate? I've been wondering if a fuse could prevent a total burn-out like this.

    Also, did you ever get some non-inductive resistors? If I remember correctly, there was some confusion about that a couple weeks ago.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-01-12 19:03
    idbruce wrote: »
    ...


    I never seen that terminology used in a datasheet before.

    ...

    http://www.semicon.toshiba.co.jp/docs/application_note/en/TB6560AHQ-E_en_090324.pdf

    The pin matrix for "Possibility to smoke or burst" on page 12 of this document does indeed seem a bit comical, if not downright knee-slapping worthy of a chortle.
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-13 04:50
    idbruce wrote:
    Post a schematic of your current wiring
    Here is the documentation: http://www.hwml.com/PUTB6560.pdf There is the schematic, but not the PCB. So I have to trust them for that.

    The usage considerations also suggest The power-on sequence described on page 28 must be properly followed
    And you know what? I think that's why I burned the few first chips. The sequence is described on page 1 in the document Sapieha posted above.

    One problem with using a header to connect the chip is that the header will not be very good at sinking the heat that builds up in the chip.

    Here is what I have now fixed in the back of the TB6560: http://tiny.cc/x0xg0 But I did not used that at the beginning, and that also, I think, was the cause of some burns.
    Do you happen to have a fuse between the power supply and the chip like the usage considerations indicate?
    Yep, I have. But since my power suply is made for 3A, I have 3A fuses. anyway I just bought a real power suply from DigiKey (http://tiny.cc/kyrd2) so I will be able to limite the current now.
    Also, did you ever get some non-inductive resistors?
    I fixed that too. I used http://tiny.cc/in7ii instead. Seems to be better.

    idbruce wrote:
    that would be if it was accompanied by jmspaggi's photograph.
    ;) Good idea! I might have to send them an email with the suggestion ;)



    @all: Thanks for your suggestions, comments, help, etc. Today I will order 4 more TB6560, a real power supply and some missing comment. And that will be my last try. so by the end of the coming week-end, I might be able to give you more news.

    JM
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-01-14 06:35
    jmspaggi wrote: »
    ...

    I burned few other TB6560, and I still don't know why....

    JM,

    on a different thread, someone posted the following product PCB that seems to use the same chip but to control 3 axes. If you have a look, it's got a fan and some serious heat sinks, so perhaps one of your problems is that you just need a lot of heat sinking capability when working with this chip???

    http://www.aliexpress.com/product-gs/340635688-3-axis-TB6560-3-5A-CNC-engraving-machine-stepper-motor-driver-board-16-segments-stepper-motor-wholesalers.html
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-14 06:51
    JM,

    on a different thread, someone posted the following product PCB that seems to use the same chip but to control 3 axes. If you have a look, it's got a fan and some serious heat sinks, so perhaps one of your problems is that you just need a lot of heat sinking capability when working with this chip???

    I was not using heat sinks before, but now I'm using huge one ;) Each TB6560 now have a sink as big as the one in the URL you gave, and each with a fan. http://tiny.cc/x0xg0
    idbruce wrote: »
    Okay I now have more faith in you design. Phil over at Pminmo has a pretty good reputation for designing drivers that work. Did you buy the board from him?

    Not directly from him. I bought that on eBay. Phil did a USB driver also, with a guy in Canada, and I bought the card from that guy. He is the one selling and sending the cards in North America.

    I will bring him all the components today and he will solder everything for me. And Sunday, I will get everything back. So the big final result will be Sunday evening... I will cross my fingers all over the week-end ;)

    JM
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-18 10:22
    So I got my 4 new boards!!!

    They was all working fine with 12V, 1A. Motors was moving.

    But as soon as I tried with higher values, I burned them. One by one.

    So I gave up with the TB6560 and bought a Gecko 540 yesterday that I received today.

    And my motors are already moving with 24V, 2A with no issue. I will try later this afternoon with the full power supply (36V, 2.8A per motor). But I'm confident.

    The conclusion is: The TB6560 is probably is good component. 1/16 steps, easy to use, etc. But I'm not good enought in electronique to use it. The card ElectricAye sent the link might be a good alternative, but I choosed to buy a made in noth-america card instead ;)

    Now, I have to find how to pulse properly with the propeller to do some testing.

    JM
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-18 10:42
    Thanks. I will try that today.

    I will have to move to the mechanical part now that motors are moving.

    JM
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-19 18:02
    Hi Bruce,

    I just tried you code.

    First I tried it without the motor because it's far from my propeller. When I saw that 10 turns will be done in 0.94s, I was pretty septic, thinking it's should not be working.

    But when I tried with the motor I was impressed!

    I tried it many times, and look like the motor is stopping exactly at the same position. I can't garanted it's not missing a step, but look like it's accurate.

    I can't also garanteed it's doing 10 turns because it's going to fast ;)

    I will try to run it for 100 or 1000 turns tomorrow to see if it's running well over time.

    When you said "settings 'above 12,000 will cause the G251 to falter." is it because the propeller will not be fast enought to handle that?

    Will it be faster with PASM?

    Also, what's the voltage you are using for your motor?

    Damn, I'm impressed! I like what I saw ;)

    JM
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-20 05:51
    idbruce wrote: »
    It could be due to any of the following reasons:
    • The spin code is not fast enough (most likely)
    • Not a high enough voltage for the motor coils (unlikely)
    • Improper ramping (possible)

    I also think the limitation is coming from the spin code. My voltage is 30V. I will have 40V at the end, so I will try this evening with the max power supply, but since the Propeller is takin 0.94 to pulse, the motor can't turn faster.
    idbruce wrote: »
    I think so.
    ***Please note that if this driver is rewritten in PASM, please post the PASM code in this thread so that others may benefit from it. Also try to increase the 12,000 setting, and please add notes of your test results pertaining to accuracy and speed.

    The PASM code will not come from me :( It will take me months to do it. There is code in you SPIN that I don't even understand. So I will try, but don't expect any result before a couple of weeks. But it will be very interesting to have it.

    Thanks again for the code. I will look at the PASM version starting next week-end. Maybe we will have something before next summer ;)

    JM
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-20 06:57
    I will try with more steps this evening. It's easy to test. To change the direction, I need we need a slowler rampup. I will try that too.

    Also, here is a tentative of PASM conversion.

    I'm trying to translate that:
        repeat RampingSteps
        phsa := HIGH_PULSE_WIDTH
        waitcnt(Counter += CycleOffset--)
        StepCount++
    

    Into that:
                            MOV     _index, _RampingSteps
    loop1                   MOV     phsa, HIGH_PULSE_WIDTH
                            ADD     _Counter, _CycleOffset
                            WAITCNT _Counter      
                            SUB    _CycleOffset, #1
                            SUB    _Index, #1
                            TEST   _Index, #0
                  IF_A      JMP    :loop1
    

    On the SPIN side of the PASM version I also have this initialisation:
      LONG[_RampingSteps] := RampingSteps
      LONG[_RunningSteps] := RunningSteps
      LONG[_CycleOffset]  := CycleOffset
      LONG[_Counter]      := Counter
    

    And those new variables:
    _index                  LONG    $00000000                             
    _RampingSteps           LONG    $00000000 
    _RunningSteps           LONG    $00000000  
    _CycleOffset            LONG    $00000000
    _Counter                LONG    $00000000
    

    I think the loop can be improved. I remember I saw a way to do -1 on the test. That will remove the SUB line. But I did not find it.

    Anyway, I have not yet tested it since I don't have a propeller at the office.

    JM

    PS: I just figured that "MOV phsa, HIGH_PULSE_WIDTH " is not compiling.... :(
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-20 07:19
    Ok. I will try that.

    In the meantime, here is my quick and very dirty PASM code I'm trying to build:
    PUB PulseTheStepPinWithCog(StepPin, TotalSteps) | RampingSteps, RunningSteps, Counter, CycleOffset
    
      if TotalSteps > RAMPING_RANGE
        RampingSteps := SPEED_RANGE
        RunningSteps := TotalSteps - RAMPING_RANGE
      else
        RampingSteps := TotalSteps / 2
        RunningSteps := TotalSteps // 2    
      
      CycleOffset := MIN_SPEED
    
      ctra[30..26] := %00100 ' Configure Counter A to NCO
      ctra[5..0] := StepPin
      frqa := 1
      dira[StepPin]~~
    
      Counter := cnt
      LONG[_RampingSteps] := RampingSteps
      LONG[_RunningSteps] := RunningSteps
      LONG[_CycleOffset]  := CycleOffset
      LONG[_Counter]      := Counter
    
      COGNEW(@cogstart, @cogstart)
      
    
    DAT
                            ORG     0
    cogstart                
                            MOV     _index, _RampingSteps
    loop1                   MOV     phsa, _HIGH_PULSE_WIDTH
                            WAITCNT _Counter, _CycleOffset      
                            SUB    _CycleOffset, #1
                            SUB    _Index, #1
                            TEST   _Index, #0
                  IF_A      JMP    loop1
    
                            MOV     _index, RunningSteps
    loop2                   MOV     phsa, _HIGH_PULSE_WIDTH
                            WAITCNT _Counter, _CycleOffset
                            SUB    _Index, #1
                            TEST   _Index, #0
                  IF_A      JMP    loop2
    
                            MOV     _index, _RampingSteps
    loop3                   MOV     phsa, _HIGH_PULSE_WIDTH
                            WAITCNT _Counter, _CycleOffset      
                            ADD    _CycleOffset, #1
                            SUB    _Index, #1
                            TEST   _Index, #0
                  IF_A      JMP    loop3
    
    end                     JMP end                            
    
    
    
    _index                  LONG    $00000000                             
    _RampingSteps           LONG    $00000000 
    _RunningSteps           LONG    $00000000  
    _CycleOffset            LONG    $00000000
    _Counter                LONG    $00000000
    _HIGH_PULSE_WIDTH       LONG    $FFFFFFF6
    

    It's compiling, but I don't garanteed the result ;)
  • jmspaggijmspaggi Posts: 629
    edited 2011-01-20 12:45
    I can confirm that it's not working ;) and since the propeller is a pain to debug, it will take time to understand where the issue is.

    anyway, I'm working on that.

    JM
Sign In or Register to comment.