
cw_amplitude_in_range:
;print 'sampling' message
mov #tblpage(cw_sampling_message), w0
mov #tbloffset(cw_sampling_message), w1
call tx_str_232
;----------------------------------------wait for 'position lock'
cw_position_lock:
;loop until flag bit is set
btss flags1, #hall_based_lock
bra cw_position_lock



Lebowski wrote:First thing to check is the power supply of the chip. The chip takes around 200 mA so make sure the 5V supply can
deliver this. Second, use lots of decoupling capacitors ! I use 4 times (for each supply set of vdd/vss) a 100 nF and 47 uF
capacitor in parallel. Keep in mind that internally the chip runs at 120MHz, faster than an old PC. It needs a proper power supply !
I've never seen it conk out of sampling mode where it just freezes.... In this sampling mode it switches on the ADC's which increase
the power consumption. If your supply cannot handle this or if there are not enough decaps I can imagine that switching on the
ADC's causes a drop in supply resulting in the chip to freeze...
Also, you must calibrate the hall sensor positions before you can sample the back-emf. If the chip conks out and you reset it
it has forgotten the hall positions as all calibration data is stored in RAM until you give it the command to save it in EEPROM.
This would be the only thing I can think of that freezes it during back-emf sampling, no hall position data... Can you post the
hall sensor graphs / tables ?
just had a look at the code:
- Code: Select all
cw_amplitude_in_range:
;print 'sampling' message
mov #tblpage(cw_sampling_message), w0
mov #tbloffset(cw_sampling_message), w1
call tx_str_232
;----------------------------------------wait for 'position lock'
cw_position_lock:
;loop until flag bit is set
btss flags1, #hall_based_lock
bra cw_position_lock
it's as I thought, no hall calibration means it will print the sampling message and then hang itself on
the loop waiting for hall_based_lock (this bit is set using interrupts).


------> z
########################################
# (c)opyright 2012, B.M. Putter #
# Adliswil, Switzerland #
# bmp72@hotmail.com #
# #
# experimental, use at your own risk #
########################################
a] calibrate hall sensors
b] determine coil positions
c) PWM parameters
d) current settings
e) control loop parameters
f) throttle setup
g) running modes
h) CAN bus setup
z) store parameters in EEPROM for motor use
------> b
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Sampling...
coil position capture failed
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Sampling...
coil position capture failed
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------>
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> d
data A, data B, data C
.0058 -.0005 -.0058
.0056 -.0002 -.0059
.0053 -.0001 -.0061
.0054 .0002 -.0060
.0052 .0005 -.0061
.0049 .0007 -.0062
.0047 .0010 -.0063
.0045 .0013 -.0064
.0043 .0016 -.0066
.0041 .0019 -.0067
.0041 .0023 -.0068
.0039 .0026 -.0070
.0038 .0029 -.0072
.0036 .0032 -.0072
.0034 .0035 -.0074
.0032 .0038 -.0073
.0029 .0039 -.0073
.0024 .0040 -.0072
.0022 .0044 -.0070
.0019 .0047 -.0070
.0015 .0048 -.0069
.0012 .0051 -.0068
.0008 .0054 -.0067
.0004 .0056 -.0067
.0001 .0059 -.0066
-.0001 .0061 -.0064
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> cÿ
########################################
# (c)opyright 2012, B.M. Putter #
# Adliswil, Switzerland #
# bmp72@hotmail.com #
# #
# experimental, use at your own risk #
########################################
a] calibrate hall sensors
b] determine coil positions
c) PWM parameters
d) current settings
e) control loop parameters
f) throttle setup
g) running modes
h) CAN bus setup
z) store parameters in EEPROM for motor use
------>
########################################
# (c)opyright 2012, B.M. Putter #
# Adliswil, Switzerland #
# bmp72@hotmail.com #
# #
# experimental, use at your own risk #
########################################
a] calibrate hall sensors
b] determine coil positions
c) PWM parameters
d) current settings
e) control loop parameters
f) throttle setup
g) running modes
h) CAN bus setup
z) store parameters in EEPROM for motor use
------> b
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Sampling...
coil position capture failed
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> 
Arlo1 wrote:One other thing is it normal for the motor to power up the chip when I spin the motor and the controller is unpowered?


Arlo1 wrote:I have been trying to calibrate the coils with out the powerstage powered but i did try powering the powerstage with 12v to try to calibrate the coils but i got to try again because the low side fet were in the wrong setting (thought i set it write. But i was wrong)

Lebowski wrote: nice, what motor did you use ?
doh!.. pull-up resistors.. how could i have forgotten those. THANKSLebowski wrote:Maybe you have
open collector output type hall sensors


-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400.5913 .4042 -.9521
.5473 .4545 -.9570
.5009 .4898 -.9575
.4609 .5328 -.9565
.4130 .5694 -.9497
.3671 .6097 -.9448
.3247 .6390 -.9350
.2773 .6683 -.9208
.2304 .6962 -.9013
.1801 .7200 -.8833
.1293 .7502 -.8632
.0805 .7781 -.8403
.0307 .8024 -.8164
-.0175 .8226 -.7915
-.0654 .8464 -.7666
-.1123 .8642 -.7392
-.1621 .8839 -.7075
-.2080 .9008 -.6738
-.2568 .9146 -.6445
-.3032 .9288 -.6098
-.3486 .9356 -.5742
-.3271 .8061 -.4667
-.4150 .9420 -.5195
-.4526 .9457 -.4814
-.4931 .9448 -.4379
-.5332 .9411 -.3916
-.5722 .9361 -.3496
-.6118 .9301 -.3056
-.6464 .9233 -.2583
-.6782 .9072 -.2138
-.7070 .8871 -.1689
-.7377 .8720 -.1166
-.7670 .8528 -.0688
-.7934 .8258 -.0195
-.8193 .8047 .0322
-.8408 .7768 .0791
-.8593 .7543 .1274
-.8774 .7250 .1728
-.8925 .6958 .2216
-.9106 .6683 .2695
-.9243 .6362 .3173
-.9331 .6037 .3583
-.9389 .5776 .3984
-.9453 .5351 .4433
-.9477 .5012 .4858
-.9472 .4614 .5234
-.9492 .4234 .5644
-.9462 .3813 .6040
-.9365 .3428 .6406
-.9267 .3012 .6733
-.9135 .2531 .7026
-.8979 .2091 .7329
-.8779 .1629 .7602
-.8598 .1190 .7900
-.8369 .0704 .8168
-.8149 .0256 .8437
-.7910 -.0201 .8666
-.7651 -.0654 .8872
-.7377 -.1084 .9082
-.7055 -.1538 .9262
-.6738 -.1977 .9414
-.6425 -.2444 .9575
-.6083 -.2893 .9677
-.5747 -.3286 .9736
-.5366 -.3652 .9750
-.5004 -.4023 .9760
-.4531 -.4435 .9775
-.4130 -.4838 .9721
-.3676 -.5140 .9697
-.3237 -.5502 .9628
-.2792 -.5822 .9536
-.2373 -.6147 .9399
-.1948 -.6422 .9272
-.1464 -.6710 .9116
-.0986 -.7022 .8920
-.0517 -.7283 .8657
-.0024 -.7489 .8452
.0468 -.7713 .8203
.0917 -.7878 .7939
.1396 -.8038 .7636
.1816 -.8180 .7338
.2314 -.8317 .7016
.2749 -.8454 .6699
.3178 -.8532 .6367
.3623 -.8651 .6035
.3999 -.8688 .5698
.4321 -.8711 .5454
.4755 -.8711 .5034
.5185 -.8738 .4580
.5561 -.8720 .4184
.5942 -.8665 .3769
.6289 -.8578 .3339
.6591 -.8500 .2934
.6879 -.8358 .2485
.7167 -.8226 .2060
.7470 -.8088 .1611
.7758 -.7914 .1123
.8051 -.7749 .0625
.8295 -.7534 .0175
.8525 -.7333 -.0297
.8701 -.7099 -.0766
.8974 -.6848 -.1191
.9130 -.6582 -.1669
.9335 -.6307 -.2158
.9501 -.6015 -.2592
.9594 -.5690 -.3061
.9658 -.5378 -.3457
.9711 -.5035 -.3837
.9721 -.4678 -.4238
.9726 -.4188 -.4780
.9721 -.3703 -.5185
.9643 -.3341 -.5566
.9624 -.2938 -.5932
.9531 -.2508 -.6289
.9409 -.2101 -.6606
.9282 -.1702 -.6889
.9125 -.1235 -.7207
.8886 -.0791 -.7519
.8725 -.0334 -.7817
.8540 .0137 -.8095
.8300 .0599 -.8310
.8046 .1039 -.8540
.7783 .1519 -.8735
.7470 .1940 -.8945
.7197 .2430 -.9135
.6850 .2883 -.9252
.6513 .3332 -.9389
.6118 .3717 -.9482
.0135 .0098 -.0226
.0126 .0108 -.0227
.0117 .0117 -.0227
.0107 .0126 -.0226
.0097 .0135 -.0225
.0086 .0144 -.0223
.0076 .0152 -.0221
.0065 .0160 -.0218
.0054 .0167 -.0215
.0042 .0174 -.0211
.0031 .0181 -.0206
.0019 .0187 -.0201
.0008 .0193 -.0196
-.0002 .0198 -.0190
-.0014 .0203 -.0184
-.0025 .0207 -.0177
-.0035 .0211 -.0170
-.0046 .0214 -.0162
-.0056 .0216 -.0155
-.0066 .0219 -.0147
-.0076 .0220 -.0139
-.0086 .0222 -.0131
-.0096 .0223 -.0123
-.0105 .0224 -.0115
-.0114 .0224 -.0106
-.0123 .0223 -.0097
-.0132 .0223 -.0087
-.0141 .0221 -.0077
-.0149 .0219 -.0067
-.0157 .0216 -.0056
-.0165 .0212 -.0045
-.0172 .0208 -.0034
-.0179 .0203 -.0023
-.0185 .0198 -.0011
-.0191 .0192 -.0000
-.0197 .0186 .0010
-.0202 .0180 .0021
-.0207 .0173 .0032
-.0211 .0167 .0043
-.0215 .0160 .0054
-.0219 .0152 .0064
-.0221 .0144 .0075
-.0224 .0136 .0085
-.0225 .0127 .0095
-.0226 .0118 .0105
-.0227 .0108 .0115
-.0226 .0098 .0124
-.0225 .0087 .0133
-.0224 .0077 .0142
-.0222 .0066 .0150
-.0219 .0055 .0158
-.0216 .0044 .0166
-.0212 .0033 .0173
-.0208 .0022 .0179
-.0203 .0011 .0186
-.0198 .0000 .0192
-.0193 -.0010 .0198
-.0187 -.0022 .0203
-.0181 -.0033 .0208
-.0175 -.0044 .0213
-.0167 -.0056 .0216
-.0160 -.0067 .0220
-.0152 -.0078 .0223
-.0144 -.0088 .0224
-.0135 -.0098 .0226
-.0126 -.0108 .0227
-.0117 -.0118 .0227
-.0107 -.0126 .0226
-.0097 -.0135 .0225
-.0086 -.0144 .0223
-.0076 -.0152 .0221
-.0065 -.0160 .0218
-.0054 -.0167 .0215
-.0042 -.0174 .0211
-.0031 -.0181 .0206
-.0020 -.0187 .0201
-.0008 -.0193 .0196
.0002 -.0198 .0190
.0014 -.0203 .0184
.0025 -.0207 .0177
.0035 -.0211 .0169
.0046 -.0214 .0162
.0056 -.0216 .0155
.0066 -.0219 .0147
.0076 -.0220 .0139
.0086 -.0222 .0131
.0096 -.0223 .0123
.0105 -.0224 .0115
.0114 -.0224 .0106
.0123 -.0224 .0097
.0132 -.0223 .0087
.0141 -.0221 .0077
.0149 -.0219 .0067
.0157 -.0216 .0056
.0165 -.0212 .0045
.0172 -.0208 .0034
.0179 -.0203 .0023
.0185 -.0198 .0011
.0191 -.0192 .0000
.0197 -.0186 -.0010
.0202 -.0180 -.0021
.0207 -.0173 -.0032
.0211 -.0167 -.0043
.0215 -.0160 -.0054
.0219 -.0152 -.0064
.0221 -.0144 -.0075
.0223 -.0136 -.0085
.0225 -.0127 -.0095
.0226 -.0118 -.0105
.0227 -.0108 -.0115
.0226 -.0098 -.0124
.0225 -.0087 -.0133
.0224 -.0077 -.0142
.0221 -.0066 -.0150
.0219 -.0055 -.0158
.0216 -.0044 -.0166
.0212 -.0033 -.0173
.0208 -.0022 -.0179
.0203 -.0011 -.0186
.0198 -.0000 -.0192
.0193 .0010 -.0198
.0187 .0022 -.0203
.0181 .0033 -.0208
.0174 .0044 -.0213
.0167 .0056 -.0216
.0160 .0067 -.0220
.0152 .0078 -.0223
.0144 .0088 -.0224------> d
a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 39.9 A
d) maximum battery current, motor use: 14.9 A
e) maximum battery current, regen: 0.0 A
f) maximum shutdown error current, fixed: 4.9 A
g) maximum shutdown error current, proportional: 4.9 A
h) IIR filter coefficient: 4
i) use additional comb filter: YES
z) return to main menu
------> e
a) loop sample frequency: 38.01 kHz
b) 1st order phase loop integrator coefficient: 53.0000
c) 2nd order phase loop integrator coefficient: 0.3099
d) amplitude loop integrator coefficient: 1.5000
e) maximum amplitude: 200 %
z) return to main menu------> g
a) sensored or sensorless: SENSORED
b} sensorless startup: PUSH START
c} e-rpm limit sensorless self start: 1183
d} e-rpm reached before transition: 47 %
e} minimum current push start: 2.9 A
f} push start current, error allowed: 24 %
g] erpm sensored to sensorless transition: 500
h] transition time sensored to sensorless: 99 milli-sec
i) return to motor start below 500 erpm
j) controlled slowdown for direction change: YES
k) phase current for controlled slowdown: 0.9 A
l) motor maximum, forward: 99.97 k-erpm
m) motor maximum, reverse: 39.99 k-erpm
n) motor standstill voltage threshold: 0.49 V
z) return to main menu
a] number of back-emf samples: 1
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> a
new value -> 100
a] number of back-emf samples: 100
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Sampling...
coil position capture failed
a] number of back-emf samples: 100
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> d
data A, data B, data C
.0049 .0003 -.0058
.0046 .0007 -.0060
.0036 .0002 -.0069
.0034 .0006 -.0070
.0032 .0010 -.0071
.0032 .0014 -.0071
.0033 .0020 -.0068
.0028 .0020 -.0073
.0029 .0026 -.0070
.0029 .0032 -.0068
.0026 .0035 -.0067
.0022 .0038 -.0066
.0019 .0040 -.0064
.0015 .0042 -.0063
.0014 .0046 -.0061
.0009 .0049 -.0061
.0007 .0054 -.0058
.0003 .0058 -.0056
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0002 .0057 -.0057
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
a] number of back-emf samples: 100
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> z
########################################
# (c)opyright 2012, B.M. Putter #
# Adliswil, Switzerland #
# bmp72@hotmail.com #
# #
# experimental, use at your own risk #
########################################
a] calibrate hall sensors
b] determine coil positions
c) PWM parameters
d) current settings
e) control loop parameters
f) throttle setup
g) running modes
h) CAN bus setup
z) store parameters in EEPROM for motor use
------> a
a] number of e-rotations: 30
b] calibrate hall positions
c] table out hall signals
z] return to main menu
------> b
Spin the motor then press any key to start measurement
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
a] number of e-rotations: 30
b] calibrate hall positions
c] table out hall signals
z] return to main menu
------> c
hall 1, hall 2, hall 3
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 .5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 -.5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
-.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 -.5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 .5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
.5000 -.5200 .5400
a] number of e-rotations: 30
b] calibrate hall positions
c] table out hall signals
z] return to main menu
------> z
########################################
# (c)opyright 2012, B.M. Putter #
# Adliswil, Switzerland #
# bmp72@hotmail.com #
# #
# experimental, use at your own risk #
########################################
a] calibrate hall sensors
b] determine coil positions
c) PWM parameters
d) current settings
e) control loop parameters
f) throttle setup
g) running modes
h) CAN bus setup
z) store parameters in EEPROM for motor use
------> z
a) write variables to EEPROM
b] reverse direction and write variables to EEPROM
z) return to main menu
------> a
Data stored in EEPROM for motor use
a) write variables to EEPROM
b] reverse direction and write variables to EEPROM
z) return to main menu
------> z
########################################
# (c)opyright 2012, B.M. Putter #
# Adliswil, Switzerland #
# bmp72@hotmail.com #
# #
# experimental, use at your own risk #
########################################
a] calibrate hall sensors
b] determine coil positions
c) PWM parameters
d) current settings
e) control loop parameters
f) throttle setup
g) running modes
h) CAN bus setup
z) store parameters in EEPROM for motor use
------> b
a] number of back-emf samples: 100
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Sampling...
coil position capture failed
a] number of back-emf samples: 100
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> d
data A, data B, data C
.0059 -.0007 -.0076
.0057 -.0003 -.0077
.0056 -.0000 -.0077
.0057 .0008 -.0073
.0049 .0006 -.0079
.0051 .0015 -.0075
.0050 .0019 -.0075
.0047 .0023 -.0076
.0045 .0025 -.0077
.0043 .0029 -.0079
.0043 .0033 -.0079
.0040 .0036 -.0079
.0038 .0039 -.0079
.0035 .0040 -.0079
.0032 .0043 -.0077
.0034 .0049 -.0070
.0029 .0051 -.0068
.0026 .0053 -.0066
.0025 .0057 -.0062
.0021 .0058 -.0063
.0018 .0062 -.0061
.0008 .0058 -.0067
.0007 .0064 -.0065
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
a] number of back-emf samples: 100
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> 
------> b
a] number of back-emf samples: 100
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> a
new value -> 850
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Sampling...
coil position capture failed
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Waiting for motor to slow down
Sampling...
coil position capture failed
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Waiting for motor to slow down
Sampling...
coil position capture failed
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Sampling...
coil position capture failed
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> b
Spin the motor then press any key to start measurement
Waiting for motor to slow down
Sampling...
coil position capture failed
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> d
data A, data B, data C
-.0144 .0134 .0010
-.0147 .0124 .0023
-.0148 .0116 .0032
-.0151 .0110 .0040
-.0154 .0105 .0048
-.0156 .0101 .0057
-.0156 .0097 .0065
-.0156 .0093 .0072
-.0156 .0092 .0084
-.0156 .0086 .0091
-.0156 .0081 .0099
-.0154 .0071 .0102
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
.0000 .0000 .0000
a] number of back-emf samples: 850
b] calibrate coil positions
c] reconstruct waveforms based on extracted parameters
d] table out data arrays
z] return to main menu
------> 

a) loop sample frequency: 38.01 kHz
b) 1st order phase loop integrator coefficient: 53.0000
c) 2nd order phase loop integrator coefficient: 0.3099
d) amplitude loop integrator coefficient: 1.5000
e) maximum amplitude: 200 %
z) return to main menu
a) sensored or sensorless: SENSORED
b} sensorless startup: PUSH START
c} e-rpm limit sensorless self start: 1183
d} e-rpm reached before transition: 47 %
e} minimum current push start: 2.9 A
f} push start current, error allowed: 24 %
g] erpm sensored to sensorless transition: 500
h] transition time sensored to sensorless: 99 milli-sec
i) return to motor start below 500 erpm
j) controlled slowdown for direction change: YES
k) phase current for controlled slowdown: 0.9 A
l) motor maximum, forward: 99.97 k-erpm
m) motor maximum, reverse: 39.99 k-erpm
n) motor standstill voltage threshold: 0.49 V
z) return to main menu


nieles wrote:so it is normal the reconstructed data is not scaled beteween 1 and -1?



Lebowski wrote:The hall sensor information from Arlo explains to me why there's trouble sampling the back-emf.
This is a plot from Arlo's hall data:
If you look at the graph you can see the hall spacing is really irregular and especially
series3 has a weird very high dutycycle (65%). The main killer for the sampling however is the
spacing between the series2 and series3 around position 45. The chip expects somewhat
evenly spaced halls (which would be a transition every 21 positions). It can deal with tolerances
on this but a spacing between transitions of only 7 positions is really out of proportions. What happens
is that the time between two hall transitions is extrapolated (using the known hall positions)
to the time for a full e-period. If this then differs more than 12% from the running average e-period
time it declares lock is lost and stops the back-emf sampling (basically it samples the voltages but
then has no clue anymore where in the e-period the samples were taken). With a very small
space between transitions the time between the halls is multiplied by a huge amount, easely
tripping the 12% max. error allowed.
Just to compare, this is the plot from the data posted by Nieles:
I actually have the feeling one of Arlo's halls is broken (hall 3), it would be interesting to spin
the motor with a drill (constant rpm) and to look at the output signal of hall 3. I think it will not
be a nice regular square wave. My reasoning: during the calibration the average falling edge was on position 41,
the back-emf sampling stops because of an unexpected hall transition at position 18 for the first
measurement posted and 12 for the second measurement posted by Arlo 2-3 posts ago.




Users browsing this forum: Google [Bot] and 6 guests