Lebowski said:An example when this happens: when you've come to a stop at a traffic light....
Stop? Trafic light? Yeah, like that's gonna happen...

Lebowski said:An example when this happens: when you've come to a stop at a traffic light....
texaspyro said:Lebowski said:An example when this happens: when you've come to a stop at a traffic light....
Stop? Trafic light? Yeah, like that's gonna happen...![]()
oldswamm said:But, you have to remember that Lebowski has to deal with much tougher law enforcement than we in northamerica, so he ALWAYS complies with ALL laws, rules, and regulations. :wink:
oldswamm said:You probably do stop to charge or change your batteries at least, right? On those rare occasions, it is nice to be able to get going again, without pedaling?
Am i missing something or is my iphone not showing the whole pic ? I cant see the hall capture??Lebowski said:captured back-EMF waveforms in relation to hall sensors...
oldswamm said:Ditto from me too, Lebowski.![]()
I've been working on add on circuitry for commercial controllers and slow (hub) motors, which will have auto sensored/sensorless switching, as well as auto hall sensor learning.
Other functions I intend to implement are serial to/from the controller units, handlebar unit, lighting controller, BMS, and any other functions (such as a brake interface).
The handlebar unit will include the basic CA functions, the ability to 'reprogram' the controller units, and inputs for more controls than almost anyone could want. I'm also working on interfacing to LED arrays such as in 'moving' signs (bright green, red, or orange 2-1/2" characters) as an alternative to the standard LCD interface.
A board in the hub for an interface for the halls as well as 3 thermistors, 2 in the windings, a fan control, and 6 tach inputs for fans. (edit: using the 3 hall wires as a 3bit parallel interface, and 12v on the red wire)
I want the ability to control 2WD and 3way (intelligently :wink: . )
Lighting control , including turn signals.
Thermal current limiting (temp sensors on the mosfets too).
I would also LIKE to implement skid/spin control (what I got interested in controller design for!), eventually including electronic brake control, integrating regen and electric brakes. Would include AFB (anti flip braking
), and a wheelie eliminator (selectable). I think I would need use hall sensors on the suspensions. Can't see a G sensor (tilt/tip) working (at least not easily).
edit: Forgot about timing, which will partially compensate for processing the halls through 2 processors, as well as poorly timed halls.![]()
Bob
Arlo1 said:Very cool great work lebokski!
Are you sure you can just free spin it or should it be held at a steady rpm? Can this be used to determin the phase shift caused by inductance vs rpm?
John in CR said:Great features Bob. Would AFB be a wheelie riding enabler, or are you talking about anti front flipping? Also, sensors on the suspension would seem extremely hard for it to distinguish between bumpy road conditions and bike lifting issues.
With phase amp monitering you should not need to worry about locked rotor problems!oldswamm said:Have you guys thought about locked rotor programing. I've blown FETs twice that way.The first time I tried to power the rear wheel over a pallet (my dog's patio), with 50# of sla on the rear wheel, and at least one third throttle on a stock 22A controller, but I just took out mosfets in a modified infineon controller that I don't think should have happened. Very little throttle, better mosfets and capacitors, and almost no weight on the rear wheel (I was standing pushing on the handlebars, and have LiPo up forward). I suspect what happened was it started up, shut down, then rolled back, which may have caused an unpredictable switching sequence. Took out FETs in 2 high side and 2 low side phases.
Yup i will but you also must note the phase amp sensors will fead a Sd pin on the fet driver through a flipflop so if over current is found once the sd pin will be triggered then the fet driver will stay off for the rest of the cycle!oldswamm said:Probably true.
But, the current will be calculated based on the assumption that each phase only sees a 33% duty cycle, so the junction temp could rise rapidly.
Also, and I know you're not likely to write the program so it's possible, but I suspect the last infineon I blew was a shoot through caused by the motor turning backward while being driven forward. Worth giving a few moments thought when you write the code.![]()
Bob
A locked rotor should be no problem the whole idea is to limit the pwm on vs off time so with a stall condition or locked rotor you do not exceed the max you want while using the sd pin for a condition like a shorted wire or overtemp condition. Rember the inductance in the motor slows the amp ramp up so as long as you program a limit for pwm on time it should be ok.oldswamm said:It would stay off for the rest of the PWM cycle, (normal operation right?), but to be safe with a locked rotor, it would have to stay off, or be farther limited, for the rest of the commutation cycle, wouldn't it?
#######################################
(c)opyright 2011, xzt06sd@hotmail.com
#######################################
1) calibrate hall sensors
2) determine coil positions
3) change PWM parameters
9) store parameters in EEPROM for motor use
------> 1
1) calibrate hall positions
2) change # of e-cycles
8) table out hall signals
9) return to main menu
# of e-cycles to be used:65535
------> 2
new value -> 14
1) calibrate hall positions
2) change # of e-cycles
8) table out hall signals
9) return to main menu
# of e-cycles to be used:14
------> 1
Spin the motor then press any key to start measurement
1
2
3
4
5
6
7
8
9
10
11
12
13
14
1) calibrate hall positions
2) change # of e-cycles
8) table out hall signals
9) return to main menu
# of e-cycles to be used:14
------> 8
hall 1, hall 2, hall 3
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 .520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 .540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 -.520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 -.540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
-.500 .520 .540
1) calibrate hall positions
2) change # of e-cycles
8) table out hall signals
9) return to main menu
# of e-cycles to be used:14
------> 9
1) calibrate hall sensors
2) determine coil positions
3) change PWM parameters
9) store parameters in EEPROM for motor use
------> 2
1) calibrate coil positions
2) change # of back-emf samples
3) reconstruct waveforms based on extracted parameters
8) table out data arrays
9) return to main menu
# of back-emf samples to be used for coil calibration:65535
------> 2
new value -> 850
1) calibrate coil positions
2) change # of back-emf samples
3) reconstruct waveforms based on extracted parameters
8) table out data arrays
9) return to main menu
# of back-emf samples to be used for coil calibration:850
------> 1
Spin the motor then press any key to start measurement
coil position capture successfull
data arrays now contain sampled back-emf waveforms
1) calibrate coil positions
2) change # of back-emf samples
3) reconstruct waveforms based on extracted parameters
8) table out data arrays
9) return to main menu
# of back-emf samples to be used for coil calibration:850
------> 8
data A, data B, data C
.759 .134 -.891
.728 .189 -.909
.699 .236 -.920
.669 .283 -.927
.636 .325 -.933
.601 .366 -.939
.567 .408 -.941
.530 .447 -.941
.491 .488 -.937
.451 .524 -.933
.409 .559 -.928
.364 .593 -.921
.320 .625 -.911
.274 .658 -.898
.226 .686 -.883
.175 .715 -.869
.126 .741 -.849
.073 .765 -.831
.023 .787 -.810
-.028 .810 -.787
-.078 .829 -.760
-.125 .846 -.738
-.187 .864 -.703
-.261 .886 -.655
-.310 .896 -.624
-.356 .906 -.588
-.401 .914 -.552
-.444 .919 -.514
-.485 .922 -.476
-.526 .922 -.436
-.563 .922 -.394
-.600 .918 -.351
-.635 .913 -.308
-.666 .906 -.261
-.699 .894 -.218
-.726 .883 -.170
-.755 .869 -.125
-.776 .856 -.082
-.815 .829 -.0010
-.838 .810 .038
-.858 .788 .088
-.877 .766 .136
-.895 .741 .182
-.911 .715 .230
-.924 .687 .277
-.935 .658 .322
-.947 .625 .365
-.954 .593 .409
-.959 .559 .449
-.962 .524 .490
-.961 .488 .529
-.962 .447 .564
-.959 .407 .599
-.952 .367 .633
-.944 .327 .666
-.933 .283 .693
-.920 .239 .724
-.906 .194 .751
-.891 .145 .774
-.871 .099 .799
-.853 .051 .819
-.831 .001 .839
-.808 -.047 .858
-.778 -.107 .878
-.743 -.167 .895
-.714 -.212 .908
-.685 -.259 .917
-.654 -.305 .925
-.621 -.343 .932
-.587 -.387 .934
-.552 -.428 .935
-.514 -.468 .933
-.474 -.505 .931
-.432 -.540 .927
-.389 -.576 .920
-.346 -.610 .909
-.299 -.641 .899
-.253 -.673 .885
-.204 -.702 .870
-.155 -.729 .854
-.103 -.753 .835
-.052 -.777 .813
-.002 -.799 .792
.049 -.819 .766
.099 -.837 .741
.151 -.854 .715
.196 -.869 .684
.240 -.881 .660
.316 -.897 .608
.361 -.908 .573
.406 -.914 .537
.448 -.918 .499
.489 -.922 .460
.528 -.922 .421
.564 -.921 .378
.601 -.915 .338
.636 -.910 .295
.668 -.902 .249
.699 -.891 .204
.727 -.880 .156
.752 -.866 .108
.780 -.849 .063
.803 -.832 .013
.825 -.813 -.035
.848 -.791 -.080
.864 -.772 -.122
.887 -.740 -.186
.903 -.715 -.232
.916 -.688 -.278
.930 -.657 -.323
.940 -.626 -.367
.946 -.593 -.409
.951 -.560 -.449
.954 -.524 -.489
.954 -.486 -.528
.953 -.451 -.564
.950 -.410 -.599
.943 -.370 -.633
.934 -.328 -.665
.924 -.286 -.693
.910 -.242 -.721
.897 -.196 -.748
.882 -.149 -.772
.864 -.102 -.795
.843 -.056 -.817
.821 -.008 -.836
.799 .041 -.854
.773 .088 -.870
1) calibrate coil positions
2) change # of back-emf samples
3) reconstruct waveforms based on extracted parameters
8) table out data arrays
9) return to main menu
# of back-emf samples to be used for coil calibration:850
------> 3
data arrays now contain reconstructed back-emf waveforms
1) calibrate coil positions
2) change # of back-emf samples
3) reconstruct waveforms based on extracted parameters
8) table out data arrays
9) return to main menu
# of back-emf samples to be used for coil calibration:850
------> 8
data A, data B, data C
.743 .154 -.923
.715 .205 -.937
.686 .255 -.948
.656 .303 -.958
.623 .349 -.964
.589 .394 -.968
.554 .437 -.969
.516 .478 -.968
.477 .518 -.964
.436 .556 -.958
.393 .592 -.949
.350 .627 -.939
.305 .661 -.928
.259 .693 -.914
.211 .724 -.899
.163 .753 -.883
.114 .781 -.864
.063 .806 -.843
.012 .831 -.820
-.040 .853 -.794
-.093 .874 -.765
-.146 .893 -.734
-.199 .910 -.701
-.251 .925 -.666
-.302 .938 -.628
-.352 .949 -.590
-.399 .958 -.550
-.444 .964 -.509
-.486 .968 -.468
-.526 .969 -.426
-.563 .968 -.383
-.598 .964 -.340
-.631 .957 -.295
-.663 .948 -.249
-.692 .937 -.202
-.721 .924 -.153
-.749 .909 -.103
-.775 .892 -.052
-.800 .874 -.000
-.824 .854 .051
-.846 .831 .102
-.866 .807 .154
-.885 .782 .204
-.901 .754 .253
-.915 .724 .301
-.926 .693 .347
-.935 .660 .392
-.942 .625 .436
-.947 .589 .477
-.950 .552 .518
-.950 .513 .556
-.949 .474 .594
-.945 .433 .629
-.940 .390 .663
-.932 .347 .695
-.921 .302 .725
-.909 .255 .754
-.894 .207 .780
-.878 .158 .805
-.859 .107 .829
-.839 .055 .851
-.817 .003 .871
-.794 -.049 .890
-.769 -.102 .907
-.743 -.154 .923
-.715 -.205 .937
-.686 -.255 .948
-.656 -.303 .957
-.624 -.349 .964
-.589 -.394 .968
-.554 -.437 .969
-.516 -.478 .968
-.477 -.518 .964
-.436 -.556 .958
-.394 -.593 .949
-.350 -.628 .939
-.305 -.661 .927
-.259 -.693 .914
-.212 -.724 .899
-.163 -.753 .882
-.114 -.781 .864
-.063 -.806 .843
-.012 -.831 .820
.040 -.853 .794
.093 -.874 .765
.146 -.893 .734
.199 -.910 .701
.251 -.925 .665
.302 -.938 .628
.352 -.949 .590
.399 -.958 .550
.444 -.964 .509
.486 -.968 .468
.526 -.969 .426
.563 -.968 .383
.598 -.964 .340
.631 -.957 .295
.662 -.948 .249
.692 -.937 .201
.721 -.924 .153
.748 -.909 .103
.775 -.893 .052
.800 -.874 .000
.824 -.854 -.051
.846 -.832 -.103
.866 -.808 -.154
.885 -.782 -.204
.901 -.754 -.253
.915 -.725 -.301
.926 -.693 -.348
.935 -.660 -.392
.942 -.626 -.436
.947 -.590 -.478
.950 -.552 -.518
.950 -.514 -.557
.949 -.474 -.594
.945 -.433 -.629
.939 -.391 -.663
.931 -.347 -.695
.921 -.302 -.725
.909 -.256 -.754
.894 -.208 -.780
.878 -.158 -.805
.859 -.107 -.829
.839 -.055 -.851
.817 -.003 -.871
.794 .049 -.890
.769 .101 -.907
1) calibrate coil positions
2) change # of back-emf samples
3) reconstruct waveforms based on extracted parameters
8) table out data arrays
9) return to main menu
# of back-emf samples to be used for coil calibration:850
------> 9
1) calibrate hall sensors
2) determine coil positions
3) change PWM parameters
9) store parameters in EEPROM for motor use
------> 3
1) change PWM frequency
2) change PWM deadtime
3) change dutycycle PWM test signal
8) test PWM signals
9) return to main menu
PWM frequency: 0kHz
deadtime: 8499ns
dutycycle testsignal: 50%
------> 1
new value -> 50
1) change PWM frequency
2) change PWM deadtime
3) change dutycycle PWM test signal
8) test PWM signals
9) return to main menu
PWM frequency: 50kHz
deadtime: 8499ns
dutycycle testsignal: 10922%
------> 2
new value -> 300
1) change PWM frequency
2) change PWM deadtime
3) change dutycycle PWM test signal
8) test PWM signals
9) return to main menu
PWM frequency: 50kHz
deadtime: 299ns
dutycycle testsignal: 10922%
------> 9
1) calibrate hall sensors
2) determine coil positions
3) change PWM parameters
9) store parameters in EEPROM for motor use
------> 9
Data stored in EEPROM for motor use
1) calibrate hall sensors
2) determine coil positions
3) change PWM parameters
9) store parameters in EEPROM for motor use
------>