Shop OBEX P1 Docs P2 Docs Learn Events
'This' Runs Faster In Spin — Parallax Forums

'This' Runs Faster In Spin

lardomlardom Posts: 1,659
edited 2021-03-02 02:17 in Propeller 1

I finally got a sensorless bldc motor to run closed-loop with Spin.

repeat
     If ina[8] == 1                   'comparator waiting for polarity to flip
       outa[0..5] := %100100       
     If ina[7] == 0       
       outa[0..5] := %100001       
     If ina[6] == 1                
       outa[0..5] := %001001      
     If ina[8] == 0    
       outa[0..5] := %011000       
     If ina[7] == 1  
       outa[0..5] := %010010       
     If ina[6] == 0    
       outa[0..5] := %000110 

I commented the start sequence and spun it with my finger. It works.
Here's the reasoning behind my title; The code, as written, is faster because an un-sensored bldc has a built in lag of 30°. Since Pasm would commutate almost instantly, a delay has to be inserted between the 'zero cross' and the commutation to optimize motor speed and torque.
I added a couple of Spin instructions and the motor stopped spinning in 'closed loop'.
The good thing is those six steps don't change.

Comments

  • Hi Lardom

    That is very interesting- I have tried interfacing a sensorless bldc to three sine waves 120 degrees apart and at a slow frequency the shaft will only spin if I give it a twist to start. I thought that by starting really slow and gently accelerating the rotor would follow- but not in my case.
    I was trying to decide how you had connected your motor- you seem to be using 6 pins to drive the three coils and three pins to sense the position. On my motor the ends of the coils are soldered together to give only three connections to drive- one for each phase- I hadn't thought to seperate them- is that what you did?

    Dave

  • Hi Dave
    My connections are separated. I first connected the motor leads though a resistor network, attached a set of oscilloscope probes across one of the resistors and spun the motor with a drill. The result was noise. I then connected my probes directly to the leads and spun the motor. This time I saw a clean sine wave.
    I had the same result with a comparator. When I connected a comparator through the resistor network what I saw was unusable. I then connected two motor leads directly to the comparator inputs through 33K resistors and I got a clean square wave. The other thing I saw was that even if I reversed inputs the result was the same. The instant the sine wave swung positive the comparator went high. The opposite was also true.
    I realized I have a delta wound motor. There is no neutral point because the coil phases are connected end to end.

Sign In or Register to comment.