Lebowski's motor controller IC, schematic and setup manual

Electric Motors and Controllers

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Arlo1 » Wed Feb 29, 2012 12:25 am

Tried the drill. I can not get the drill to fit the shaft so I wraped tape around the arbor and used it as a friction drive to spin the motor. But I still can not get it to calibrate the coil positons. It just gets stuck on sampling and never does anything! I tried everything from 10-1000 samples. If i spin it to fast it says waiting to slow down. Then says sampling but frezes and I have to unplug it a bunch of times. To reset it.
Thanks Justin of http://www.ebikes.ca/
Also a thanks to Methy at http://www.methtek.com/ :)
And Dave who has some good deals on STUFF Incl. Mosfets, Current sensors and Nomex paper.
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages while charging and discharging.
Batteries of all kinds need respect they can burn your house down, so don't sleep with them under your bed or any other were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
User avatar
Arlo1
100 GW
100 GW
 
Posts: 5297
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Wed Feb 29, 2012 1:48 am

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).
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby nieles » Wed Feb 29, 2012 6:30 am

Got my motor Running in sensorless with push start last night! (with two current sensors)
it took me a while to test will different kind of settings. i think i have a pretty good understanding of all the settings in the running modes menu, so i should be able to fine tune it when i get home from work

is it normal the motor will spin slowly when you release the throttle?
when i try to stop the motor with my hand it will stop. but with an ever so slight movement on the rotor and it starts spinning again.

maybe the throttle calibration is a bit off?

i also tried the controller briefly with an other motor i have (a hub motor) with hall sensors

when i tried to calibate the hall sensors, it froze up and didnt respond to any commands.. after a reset of the controller and a reset of the rs232 adapter it would work fine again until i tried to callibrate again.
but it was late and i could have missed something. will try again tonight
nieles
1 kW
1 kW
 
Posts: 475
Joined: Mon Jul 14, 2008 5:39 pm
Location: The Netherlands

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Wed Feb 29, 2012 8:38 am

:D nice, what motor did you use ?

Whether the motor continues to spin when you release the throttle depends on the calibration you did.
I would recommend to slightly open the throttle and use this as a minimum. What happened
in your case probably was that the noise on the throttle signal caused enough throttle to
keep the motor running. To reduce the noise on the throttle the schematic has an RC filter
in the throttle lines, did you implement those or leave them out ? When the motor runs with
throttle closed it's probably in drive_3 (indicated by the LEDs), it will keep running because
of the small throttle signal (rectified noise). When you stop it by hand it will jump to drive_1
(the waiting-for-a-push mode) and stay stopped because in this mode the throttle is artificially
forced closed. A small push will have the controller jump back to drive_3. If it's toggling between
drive_1 and drive_3 you need to increase the 'push start current' in the running modes menu.

An ever so slight movement of the rotor to get it to spin again, that's normal. Dependent on the
setup variables entered in the menus it can be very sensitive. You can start a big hub motor with a
small pinky-push in this mode...

About the sensored hub motor, did you check the hall signals are really toggling ? Maybe you have
open collector output type hall sensors (in which case you need to add some 1k to 4.7k resistors to
vdd) ? The way to get it to 'freeze' during hall calibration is when none or not all hall signals are
toggling. The controller is not really frozen then, it's just endlessly waiting for the halls to toggle.

As mentioned in the response to Arlo's post, you must calibrate the halls positions before running
the back-emf calibration. The menu's are meant to be gone through in consequetive order, jumping ahead
to the back-emf calibration before hall sensor calibration will cause the chip to hang. During back-emf
measurement the chip uses the hall signals as a reference frame. If you have a geared hub, make sure
the clutch engages so that the magnets inside are spinning. This type of geared motor needs to be
calibrated in reverse, you can use the 'reverse and save' option in the EEPROM menu to reverse all the
calibration data (turning it into forward motion data) before saving.
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Arlo1 » Wed Feb 29, 2012 11:00 am

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).

Ok man I will look at this all tonight. It could be a lack of caps. I will scope the 5v in when I hit calibrate. I will try to calibrate the halls again. What I have done so far because I learnt that I need to do resets. Is I burnt all the settings to the eeprom before going to the coil position calibration. Then it remembers all the rest.
Thanks Justin of http://www.ebikes.ca/
Also a thanks to Methy at http://www.methtek.com/ :)
And Dave who has some good deals on STUFF Incl. Mosfets, Current sensors and Nomex paper.
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages while charging and discharging.
Batteries of all kinds need respect they can burn your house down, so don't sleep with them under your bed or any other were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
User avatar
Arlo1
100 GW
100 GW
 
Posts: 5297
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Arlo1 » Wed Feb 29, 2012 11:02 am

One other thing is it normal for the motor to power up the chip when I spin the motor and the controller is unpowered?
Thanks Justin of http://www.ebikes.ca/
Also a thanks to Methy at http://www.methtek.com/ :)
And Dave who has some good deals on STUFF Incl. Mosfets, Current sensors and Nomex paper.
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages while charging and discharging.
Batteries of all kinds need respect they can burn your house down, so don't sleep with them under your bed or any other were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
User avatar
Arlo1
100 GW
100 GW
 
Posts: 5297
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Arlo1 » Wed Feb 29, 2012 11:21 am

Here is a sample of a quick test before I head to work,
Code: Select all
------> 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

------>
Thanks Justin of http://www.ebikes.ca/
Also a thanks to Methy at http://www.methtek.com/ :)
And Dave who has some good deals on STUFF Incl. Mosfets, Current sensors and Nomex paper.
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages while charging and discharging.
Batteries of all kinds need respect they can burn your house down, so don't sleep with them under your bed or any other were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
User avatar
Arlo1
100 GW
100 GW
 
Posts: 5297
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Wed Feb 29, 2012 2:17 pm

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?


It kinda depends...

Some current will flow from the high voltage battery via resistors Ra and the diodes to the 5V
but if the resistors are 10 kOhm we're talking only max 30 mA for 100V battery. With the chip
taking 200 mA this is nowhere near enough to power the chip so this mechanism is unlikely.

Are you maybe trying to calibrate the back-emf with no high voltage battery connected ? In
such a case the back-emf of the motor will be rectified by the protection diodes of the FETs
and the motor will put a DC voltage on the main battery supply line. If this then goes via a
regulator to the 5V supply of the chip then yes, you're supplying the chip via the motor. The
high voltage battery supply should be connected when you're doing the calibration just to
prevent current drawn from the motor influencing the measured back-emf waveforms. Maybe
connect something like 24V to the high voltage battery supply (no need to go straight to 200 V) ?

Maybe something funny is going on with the circuit, having to unplug it when it freezes should not
be necessary, a simple reset should do. Make sure your circuit is OK !

Sampling of the back-emf, once started, only fails when the hall sensor give an irregular pattern
to the chip. This can be because the motor spins unregular (maybe it is slipping because of the
way you spin it with the drill) or because the hall signals are noisy. I can imagine a bad supply
(via the motor) will give funny hall signals, these have to look like nice square waves without
any spikes as the calibration works with rising/falling edges (not with high/low states). A noise
spike on the halls will be interpreted as a rising/falling edge and will fail the back-emf measurement.
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Arlo1 » Wed Feb 29, 2012 2:32 pm

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 right. But i was wrong)
Last edited by Arlo1 on Wed Feb 29, 2012 10:32 pm, edited 1 time in total.
Thanks Justin of http://www.ebikes.ca/
Also a thanks to Methy at http://www.methtek.com/ :)
And Dave who has some good deals on STUFF Incl. Mosfets, Current sensors and Nomex paper.
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages while charging and discharging.
Batteries of all kinds need respect they can burn your house down, so don't sleep with them under your bed or any other were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
User avatar
Arlo1
100 GW
100 GW
 
Posts: 5297
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Wed Feb 29, 2012 2:38 pm

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)


The high/low active settings in the PWM menu are the only settings that you don't
need to save via main menu EEPROM option, they are immediately written to EEPROM...
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby nieles » Wed Feb 29, 2012 2:40 pm

Lebowski wrote: nice, what motor did you use ?


i am using a brushless outrunner viewtopic.php?f=30&t=20292

the hub motor is this one:
viewtopic.php?f=30&t=26012


Lebowski wrote:Maybe you have
open collector output type hall sensors
doh!.. pull-up resistors.. how could i have forgotten those. THANKS

installed the pullup resistors and the calibration is working:
hub motor.JPG
(108.57 KiB) Downloaded 3 times



i tried to run the motor. but when it wants to transition form drive 1 to drive 2 it stalls briefly and tries again or goes to drive 0


nieles
1 kW
1 kW
 
Posts: 475
Joined: Mon Jul 14, 2008 5:39 pm
Location: The Netherlands

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Wed Feb 29, 2012 4:00 pm

What's the funny noise in sensorless ? A loose fender or something ? It should run almost soundless in drive 3...

Looking at the graphs, it's strange they're not scaled and have a +1/-1 amplitude.. did you connect
the main battery supply when measuring the back emf ? Can you maybe post or send me the raw back-emf
data right after sampling (tables) and the reconstructed data ?
About the sensored mode, i have the feeling the order of the motor phases as they are connected to
pins 5, 7 and 8 of the chip are mixed up. Please check that motor phase A goes to pin 5 (via resistor of course), phase B
goes to pin 8 and phase C to pin 7. Maybe you have phases B and C reversed ? Also make sure the current
sensors in A and B go to pins 2 and 3 respectively (though i think this is OK else it wouldn't run in sensorless).
Can you also please post the contents of main menu d, e and g ?
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby nieles » Wed Feb 29, 2012 5:42 pm

halls
Code: Select all
-.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

raw data
Code: Select all
.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


reconstructed waves
Code: Select all
.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


menu d
Code: Select all
------> 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


menu e
Code: Select all
------> 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


menu g
Code: Select all
------> 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


the noise is a resonance in the steel tubes the motor is mounted in (in person the sound isnt as bad as it sounds in the vid)

i checked, the motor phase wires are wired correctly, and the current sensors too.

about the hall position sensors;
how much does the position of the hall sensors matter? does the spacing beteween the halls close?
the order of the sensors in relation to the phases doesnt matter right?
nieles
1 kW
1 kW
 
Posts: 475
Joined: Mon Jul 14, 2008 5:39 pm
Location: The Netherlands

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Arlo1 » Thu Mar 01, 2012 12:17 am

Here is a print out with the halls and the coil positions. I see it samples the coils then looses the info so I will look to see if the voltage is droping. Or the signals need CAPing lol.
Code: Select all
 

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

------>
Thanks Justin of http://www.ebikes.ca/
Also a thanks to Methy at http://www.methtek.com/ :)
And Dave who has some good deals on STUFF Incl. Mosfets, Current sensors and Nomex paper.
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages while charging and discharging.
Batteries of all kinds need respect they can burn your house down, so don't sleep with them under your bed or any other were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
User avatar
Arlo1
100 GW
100 GW
 
Posts: 5297
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Arlo1 » Thu Mar 01, 2012 12:55 am

Ok so I thought I had it I noticed I put Phase A to the pin8 and phase B to pin 5 so I switched them but still cant get it. Here is the last try.
I scoped the 5volts a few places on the board and its a clean smooth 5v as well scoped the voltage to the motor and its clean too!
Code: Select all
------> 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

------>
Thanks Justin of http://www.ebikes.ca/
Also a thanks to Methy at http://www.methtek.com/ :)
And Dave who has some good deals on STUFF Incl. Mosfets, Current sensors and Nomex paper.
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages while charging and discharging.
Batteries of all kinds need respect they can burn your house down, so don't sleep with them under your bed or any other were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
User avatar
Arlo1
100 GW
100 GW
 
Posts: 5297
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Thu Mar 01, 2012 4:46 am

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:
Arlo_halls.jpg
Arlo_halls.jpg (54.43 KiB) Viewed 683 times


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:
Nieles_halls.jpg
Nieles_halls.jpg (49.62 KiB) Viewed 683 times


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.
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Thu Mar 01, 2012 6:04 am

The back emf posted by Nieles looks good, this is the raw sampled data:
Nieles_raw.jpg
Nieles_raw.jpg (40.85 KiB) Viewed 675 times

and this then the reconstructed:
Nieles_reconstructed.jpg
Nieles_reconstructed.jpg (50.42 KiB) Viewed 675 times

You actually discovered a feature :mrgreen: Generating the reconstructed data is actually
a 2 step process. First it reconstructs the waveforms to within a +1 / -1 range. Then it
has a quick look at the setup pin to see whether it's in motor or setup mode. In setup mode
it leaves the data as-is, in motor mode it scales it with a PWM frequency related value.
The PWM scaled data tells me it was generated with the setup pin in motor mode, this has
however no consequences for the stored waveform data.

Looking at the video of the sensored trials, I'm assuming there's no led in the video for drive_0 ?
Looking closely I can see that the controller does also go into drive_3 but exits it almost immediately.
Based on this the things I would change in the setup:

Code: Select all
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

I would recalculate the values of b, c and d according to the setup manual. As it's a hubmotor, I would use
y=256. For unknown motor LR_delay, I would take 2 milliseconds as a slow guess. Then, with f_sample = 38 kHz and
f_pwm = 20 kHz:
option b -> 3.37
option c -> 0.005
option d -> 0.57
If it works you can reduce LR_delay. If it does not I would recalculate with y=1024.

Code: Select all
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


Here, it's better to have some hysteresis between options g and i. Try 300 for option i.
The time specified with option h is extremely short, I would recommend to start with
1000 to 2000 msec and work your way down.

By the way, as the motor was running OK in sensorless mode I think the issue is in the
running modes menu and not so much in the control loop menu.
Last edited by Lebowski on Thu Mar 01, 2012 7:09 am, edited 2 times in total.
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby nieles » Thu Mar 01, 2012 6:16 am

so it is normal the reconstructed data is not scaled beteween 1 and -1?
nieles
1 kW
1 kW
 
Posts: 475
Joined: Mon Jul 14, 2008 5:39 pm
Location: The Netherlands

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Thu Mar 01, 2012 6:34 am

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


If you generate the reconstructed data with the setup mode pin connected to ground the
reconstructed data will be in the +1 / -1 range. With the setup mode pin to vdd it will
be as you posted it, post-scaled with a PWM related parameter. You can try it, keep the
setup pin connected to ground and the reconstructed data will be between +1 / -1.

I'm guessing you have a push-button switch to ground which you press will giving it a
reset to bring it in setup mode. Because you released the push-button during data
reconstruction it post-scales it with PWM data. I had a toggle switch connected to my
setup pin, not a push button :D

I'm making a list of things to change, this is now on the list :D
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby nieles » Thu Mar 01, 2012 7:28 am

when i was programming the controller yesterday i noticed something odd.
when in setup mode and want to return to motor mode, you give the controller a reset. but when i do this, sometimes it will not respond to the "enter press" when returning to setup mode again. when this would happen i have to restart termite and cycle the connection to the rs232 adapter. The only way this would not happen is when i press the reset (to return to motor mode) when i am in the Main menu. so ALWAYS first return to the Main menu before resetting the controller (this could be part of arlo1's reset problems?)

this was in Termite (2.8) on WinXP
i havnt tested the same scenario on Ubuntu.
nieles
1 kW
1 kW
 
Posts: 475
Joined: Mon Jul 14, 2008 5:39 pm
Location: The Netherlands

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Thu Mar 01, 2012 7:44 am

I've never seen this (but then again, I've always used gtkterm under Ubuntu). I always resetted it
straight after saving the data in the EEPROM menu, I never first went back to the main menu.
From the chips point of view I don't see how this would work.
There can be some glitches on the RS232 pins of the chip on power up, this would be interpreted
by the RS232 as meaningless (non-ascii) characters which maybe upsets Windows ? But why this would
be different when resetting from the main menu, no clue. :?:
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Arlo1 » Thu Mar 01, 2012 10:24 am

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:
Arlo_halls.jpg


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:
Nieles_halls.jpg


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.

I just slid the halls into place and have not glued them permanently so I just had a look and one is on an angle so it might cause this. I will try to line them up better and glue them.
Thanks Justin of http://www.ebikes.ca/
Also a thanks to Methy at http://www.methtek.com/ :)
And Dave who has some good deals on STUFF Incl. Mosfets, Current sensors and Nomex paper.
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages while charging and discharging.
Batteries of all kinds need respect they can burn your house down, so don't sleep with them under your bed or any other were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
User avatar
Arlo1
100 GW
100 GW
 
Posts: 5297
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: Lebowski's motor controller IC, schematic and setup manu

Postby nieles » Sat Mar 03, 2012 11:18 am

did some more testing today, but i cant get the motor to spin with a load to to motor.
i am in push start brushless mode, and when i spin the motor and try to put a light load to the motor(with my hand) it cuts out (to drive 0 )
i think i am tripping either the menu d, option f or menu d, option g.

settings tested
menu d:
c: 40 A
d: 15 A
f: 5 A
g: 5 A

Menu d:
c:100 A
d: 15 A
f:10 A
g:10 A
nieles
1 kW
1 kW
 
Posts: 475
Joined: Mon Jul 14, 2008 5:39 pm
Location: The Netherlands

Re: Lebowski's motor controller IC, schematic and setup manu

Postby Lebowski » Sat Mar 03, 2012 11:31 am

There's a good chance the problem is in the control loop menu, options b,c and d (the values for
which the computations are given in the setup manual). Having these values too large will make the
controller effectively jump all over the place (as the updates are too big).
You right in thinking you're tripping menu d, options f & g (the error current settings, error current trip
level is calculated as option f + amplitude * option g, with amplitude in the 0..2 range). This can be
caused by the controller jumping all over the place due to too large control loop settings...

Did you try the suggested values I PM-ed you ? Can you PM me the contents of the menus ? Hub motor or RC ?
Last edited by Lebowski on Sun Mar 04, 2012 5:00 pm, edited 1 time in total.
User avatar
Lebowski
1 MW
1 MW
 
Posts: 1505
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: Lebowski's motor controller IC, schematic and setup manu

Postby nieles » Sun Mar 04, 2012 3:33 pm

not sure what settings you PMed me.

i am testing with my RC motor.

settings:
menu E:
b: 13.5 ( 3*1024/228 )
c: 0.02 ( 1024/(228^2) )
d: 0.6 ( 20000/458*0.002*38000 )
e:100%

x: 3*0.002*38000=228
y: 1024

what would be a good initial guess for the d and e parameters?
could there be a typo in the manual? on slide 15, it states options b, c and d are explaned on the next slides. but on slide 18 it explains the setttings for e instead of d.

if i am correct in thinking slide 18 is for setting d, what should i use for the setting e? i used different values and i get higher rpms with a higher value for e.
nieles
1 kW
1 kW
 
Posts: 475
Joined: Mon Jul 14, 2008 5:39 pm
Location: The Netherlands

PreviousNext

Return to Motor Technology

Who is online

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