Lebowski's motor controller IC, schematic & setup, new v2.A1

Leblowski.
Last night I knoticed a flaw your design. I was wiggling my wires to my current sensors when I broke a wire. This caused the rpm to run away because it did not sense the amps. SO if this was to happen with hi power on a motorcycle or car it would be very dangerous. We need a fail safe for a failed current sensor. I am thinking I will have a over current setup run to the SD pin on each driver but this will just be in case of a over current which will be a substantial amount over the max current. If we are at 1/4 throttle and lose one or more current sensors the throttle will pin it self in a sense to try to find the desired amps.
 
Arlo1 said:
Leblowski.
Last night I knoticed a flaw your design. I was wiggling my wires to my current sensors when I broke a wire. This caused the rpm to run away because it did not sense the amps. SO if this was to happen with hi power on a motorcycle or car it would be very dangerous. We need a fail safe for a failed current sensor. I am thinking I will have a over current setup run to the SD pin on each driver but this will just be in case of a over current which will be a substantial amount over the max current. If we are at 1/4 throttle and lose one or more current sensors the throttle will pin it self in a sense to try to find the desired amps.

That should be pretty easy - all he has to do is window the sensor data to "sane values" and lock up on a value outside that window. A large value pull up or pull down will also work as an after-hack.

-methods
 
There is no such thing as intellectual property... you cant own an idea. Use whatever method you want to use and enjoy. Do you really think these patent holders are going to find you on the big bad internet... then employ their $500/hour lawyers to jack you up fro selling 5 DIY boards a month? Not likely... Your entire net worth probably would not cover a day in court for them. The Lawyers would yawn.

The whole patent system was a mistake - it was put in place to create a false incentive for innovators - but it turns out real innovators don't need a cash incentive so the only thing the patent system accomplishes is making rich people richer - and other anti-competitive shit.

Be like RobinHood - steal from the rich and give to the poor.

-methods





Teh Stork said:
Hmm, I'm actually quite finished with my controller, but I've hit a major bump.

I employ both Field Oriented Controll and Space Vector Modulation. Both methods are patented. Then again, you would need a electron microscope to read the flash memory on my uC after I blow the programming fuses. When I look up more stuff that my controllers do, there is patents everywhere :( Oversampling, patent. Hall sensor for motor controll, patent. Bemf sampling, patent. ZVS, patent. :| srsly?

Paying royalties would most likely put my controller out of the price range compared to cheap china controllers. I'm not quite sure what I should do, have you given this any thougth? I'm not some anonomous chinese being able to hide over the pond. Is this a problem? Now I can speculate as to why Sevcons are damn hard to program and work with.
 
Arlo1 said:
Leblowski.
Last night I knoticed a flaw your design. I was wiggling my wires to my current sensors when I broke a wire. This caused the rpm to run away because it did not sense the amps. SO if this was to happen with hi power on a motorcycle or car it would be very dangerous. We need a fail safe for a failed current sensor. I am thinking I will have a over current setup run to the SD pin on each driver but this will just be in case of a over current which will be a substantial amount over the max current. If we are at 1/4 throttle and lose one or more current sensors the throttle will pin it self in a sense to try to find the desired amps.

it will notice this, just not in drive_1 or drive_2. In drive_3 which is the main running mode it will sense this and jump back to drive_0. I know
you're at the moment only in drive_1, sometimes drive_2 but these are only to start the motor, at a few 100 e-rpm it;s supposed to go to
drive_3 (the 1500 you specified for this is way too high, see my comments to your settings)
 
Lebowski. I tried setting the transition to sensorless all the way from 100-5000 rpm I was trying to make sure I tried everythign. I found out my current sensor wires were giving issues among other things. I got it to drive 3 once this morning for a second but powersupply was to weak so Im bring home a battery latter to continue testing with. I was in drive 1 when I broke the wire to the one current sensor and the rpm started to climb fast!
 
I just glanced at his schematic... there are not pull-up/down resistors on those inputs.
If you look at any controller - say an Infineon - it will have a pull-down resistor on any input that could cause run-away in the even of a broken connection. On an infineon this would be the throttle input where they place a 20K to 50K resistor to ground. This is somewhat problematic in that it creates a voltage divider with any line resistance... but usually this is constant and minimal. You can account for it in the firmware.

If there is an electrical input to your system that can cause run-away and it is hooked to a wire with a sensor you need to pull it high or low. Perhaps he can do this in the firmware by activating internal pull-ups or pull-downs... but letting an A/D input float is not ok.

I would set it up so that it simulates maximum current input in the case of disconnection... so would that be a pull-up? Not sure what you are using for current sensing but I figure it is a hall sensor. Chances are you can run a 50K resistor to VCC and it wont affect his firmware but it will protect you from run-away.

-methods
 
methods said:
I just glanced at his schematic... there are not pull-up/down resistors on those inputs.
If you look at any controller - say an Infineon - it will have a pull-down resistor on any input that could cause run-away in the even of a broken connection. On an infineon this would be the throttle input where they place a 20K to 50K resistor to ground. This is somewhat problematic in that it creates a voltage divider with any line resistance... but usually this is constant and minimal. You can account for it in the firmware.

If there is an electrical input to your system that can cause run-away and it is hooked to a wire with a sensor you need to pull it high or low. Perhaps he can do this in the firmware by activating internal pull-ups or pull-downs... but letting an A/D input float is not ok.

I would set it up so that it simulates maximum current input in the case of disconnection... so would that be a pull-up? Not sure what you are using for current sensing but I figure it is a hall sensor. Chances are you can run a 50K resistor to VCC and it wont affect his firmware but it will protect you from run-away.

-methods
Thats tricky. The current sensors we use and lebowskis controller wants are 0 amps at 2.5v and full amps at 5v and -full amps at 0 volts. Maybe a pull up.....?
 
So today is a good day! Almost done my dyno :) Just have to paint the frame and rivet the checker aluminum on and ballance the roller!

But even better I am getting drive 3!!!!!! One of the main problems was I was running from a powersupply! Now I am using 2 3s pacs in series! and Its AWESOME this motor has never sounded so good!
[youtube]MXCyAvphwGY[/youtube]
 

Attachments

  • 002_renamed_3966.jpg
    002_renamed_3966.jpg
    63.7 KB · Views: 2,580
Its a little smoother and full rpm I just had to enter the right numbers for the control loop parameters. I had it make a star wars sound a couple times! It was VERY loud and it was when the motor was at a stand still I think the controller thought it was turning and sent the signals lol It was so cool! I thought for sure there was going ot be fire but no such luck. That remides me I need to bring a fire extingusher home lol.

But things are almost done with the setup. I tried 20 30 and 40 khz pwm here is some of my setup info.
[youtube]vJQiFdv8jnc[/youtube]

Code:
########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> d 

a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 89.9 A
d) maximum battery current, motor use: 29.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 6.2 A
g) maximum shutdown error current, proportional: 6.2 A
h) IIR filter coefficient: 3
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> h 
new value -> 5 

a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 89.9 A
d) maximum battery current, motor use: 29.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 6.2 A
g) maximum shutdown error current, proportional: 6.2 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> e 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 307.1998
c) 2nd order phase loop integrator coefficient: 0.0198
d) amplitude loop integrator coefficient: 12.8998
e) maximum amplitude: 200 %
z) return to main menu

------> b 
new value -> 20.5241954 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0198
d) amplitude loop integrator coefficient: 12.8998
e) maximum amplitude: 200 %
z) return to main menu

------> c 
new value -> .04570775 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 12.8998
e) maximum amplitude: 200 %
z) return to main menu

------> d 
new value -> 1.31285949 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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 

a) PWM frequency: 30kHz
b) deadtime: 599ns
c) dutycycle testsignal: 50%
d) toggle high side polarity, now active HIGH
e) toggle low side polarity, now active HIGH
f) test PWM signals
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> d 

a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 89.9 A
d) maximum battery current, motor use: 29.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 6.2 A
g) maximum shutdown error current, proportional: 6.2 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> k 


  default values restored


a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 89.9 A
d) maximum battery current, motor use: 29.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 6.2 A
g) maximum shutdown error current, proportional: 6.2 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> zx 

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

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> [00][00][00]






























########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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 

a) PWM frequency: 30kHz
b) deadtime: 599ns
c) dutycycle testsignal: 50%
d) toggle high side polarity, now active HIGH
e) toggle low side polarity, now active HIGH
f) test PWM signals
z) return to main menu

------> a 

new value -> 40 

a) PWM frequency: 40kHz
b) deadtime: 599ns
c) dutycycle testsignal: 66%
d) toggle high side polarity, now active HIGH
e) toggle low side polarity, now active HIGH
f) test PWM signals
z) return to main menu

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> d 

a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 89.9 A
d) maximum battery current, motor use: 29.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 6.2 A
g) maximum shutdown error current, proportional: 6.2 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> g 

a) sensored or sensorless: SENSORED
b} sensorless startup: SELF START
c} e-rpm limit sensorless self start: 4993
d} e-rpm reached before transition: 86 %
e} minimum current push start: 0.9 A
f} push start current, error allowed: 8 %
g] erpm sensored to sensorless transition: 2000
h] transition time sensored to sensorless: 299 milli-sec 
i) return to motor start below 150 erpm
j) controlled slowdown for direction change: YES
k) phase current for controlled slowdown: 74.9 A 
l) motor maximum, forward: 255.60 k-erpm 
m) motor maximum, reverse: 152.57 k-erpm 
n) motor standstill voltage threshold: 0.29 V
o) enable low side pulsing in drive 0: YES
p) low side pulsing rate: 20 Hz
q) low side pulsing width: 20 usec
z) return to main menu

------> g 
new value -> 500 

a) sensored or sensorless: SENSORED
b} sensorless startup: SELF START
c} e-rpm limit sensorless self start: 4993
d} e-rpm reached before transition: 86 %
e} minimum current push start: 0.9 A
f} push start current, error allowed: 8 %
g] erpm sensored to sensorless transition: 500
h] transition time sensored to sensorless: 299 milli-sec 
i) return to motor start below 150 erpm
j) controlled slowdown for direction change: YES
k) phase current for controlled slowdown: 74.9 A 
l) motor maximum, forward: 255.60 k-erpm 
m) motor maximum, reverse: 152.57 k-erpm 
n) motor standstill voltage threshold: 0.29 V
o) enable low side pulsing in drive 0: YES
p) low side pulsing rate: 20 Hz
q) low side pulsing width: 20 usec
z) return to main menu

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> e 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> a 
new value -> 78000 

a) loop sample frequency: 176.46 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> a 
new value -> 78000 

a) loop sample frequency: 176.46 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> a 
new value -> 78 

a) loop sample frequency: 78.12 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> b 
new value -> 15.2614507 

a) loop sample frequency: 78.12 kHz
b) 1st order phase loop integrator coefficient: 15.2613
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> c 
new value -> .02577256 

a) loop sample frequency: 78.12 kHz
b) 1st order phase loop integrator coefficient: 15.2613
c) 2nd order phase loop integrator coefficient: 0.0256
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> d 
new value -> 1.30163847 

a) loop sample frequency: 78.12 kHz
b) 1st order phase loop integrator coefficient: 15.2613
c) 2nd order phase loop integrator coefficient: 0.0256
d) amplitude loop integrator coefficient: 1.3015
e) maximum amplitude: 200 %
z) return to main menu

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> [00][00][00][00]






























########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> g 

a) sensored or sensorless: SENSORED
b} sensorless startup: SELF START
c} e-rpm limit sensorless self start: 6723
d} e-rpm reached before transition: 86 %
e} minimum current push start: 0.9 A
f} push start current, error allowed: 8 %
g] erpm sensored to sensorless transition: 500
h] transition time sensored to sensorless: 299 milli-sec 
i) return to motor start below 150 erpm
j) controlled slowdown for direction change: YES
k) phase current for controlled slowdown: 74.9 A 
l) motor maximum, forward: 255.08 k-erpm 
m) motor maximum, reverse: 205.41 k-erpm 
n) motor standstill voltage threshold: 0.29 V
o) enable low side pulsing in drive 0: YES
p) low side pulsing rate: 26 Hz
q) low side pulsing width: 20 usec
z) return to main menu

------> g 
new value -> 1000 

a) sensored or sensorless: SENSORED
b} sensorless startup: SELF START
c} e-rpm limit sensorless self start: 6723
d} e-rpm reached before transition: 86 %
e} minimum current push start: 0.9 A
f} push start current, error allowed: 8 %
g] erpm sensored to sensorless transition: 1000
h] transition time sensored to sensorless: 299 milli-sec 
i) return to motor start below 150 erpm
j) controlled slowdown for direction change: YES
k) phase current for controlled slowdown: 74.9 A 
l) motor maximum, forward: 255.08 k-erpm 
m) motor maximum, reverse: 205.41 k-erpm 
n) motor standstill voltage threshold: 0.29 V
o) enable low side pulsing in drive 0: YES
p) low side pulsing rate: 26 Hz
q) low side pulsing width: 20 usec
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> zx 

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

------> [00][00]






























########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> g 

a) sensored or sensorless: SENSORED
b} sensorless startup: SELF START
c} e-rpm limit sensorless self start: 6723
d} e-rpm reached before transition: 86 %
e} minimum current push start: 0.9 A
f} push start current, error allowed: 8 %
g] erpm sensored to sensorless transition: 1000
h] transition time sensored to sensorless: 299 milli-sec 
i) return to motor start below 150 erpm
j) controlled slowdown for direction change: YES
k) phase current for controlled slowdown: 74.9 A 
l) motor maximum, forward: 255.08 k-erpm 
m) motor maximum, reverse: 205.41 k-erpm 
n) motor standstill voltage threshold: 0.29 V
o) enable low side pulsing in drive 0: YES
p) low side pulsing rate: 26 Hz
q) low side pulsing width: 20 usec
z) return to main menu

------> g 
new value -> 2000 

a) sensored or sensorless: SENSORED
b} sensorless startup: SELF START
c} e-rpm limit sensorless self start: 6723
d} e-rpm reached before transition: 86 %
e} minimum current push start: 0.9 A
f} push start current, error allowed: 8 %
g] erpm sensored to sensorless transition: 2000
h] transition time sensored to sensorless: 299 milli-sec 
i) return to motor start below 150 erpm
j) controlled slowdown for direction change: YES
k) phase current for controlled slowdown: 74.9 A 
l) motor maximum, forward: 255.08 k-erpm 
m) motor maximum, reverse: 205.41 k-erpm 
n) motor standstill voltage threshold: 0.29 V
o) enable low side pulsing in drive 0: YES
p) low side pulsing rate: 26 Hz
q) low side pulsing width: 20 usec
z) return to main menu

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> [00][00]






























########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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 

a) PWM frequency: 40kHz
b) deadtime: 599ns
c) dutycycle testsignal: 50%
d) toggle high side polarity, now active HIGH
e) toggle low side polarity, now active HIGH
f) test PWM signals
z) return to main menu

------> a 

new value -> 30 

a) PWM frequency: 30kHz
b) deadtime: 599ns
c) dutycycle testsignal: 37%
d) toggle high side polarity, now active HIGH
e) toggle low side polarity, now active HIGH
f) test PWM signals
z) return to main menu

------> c 

new value -> 50 

a) PWM frequency: 30kHz
b) deadtime: 599ns
c) dutycycle testsignal: 50%
d) toggle high side polarity, now active HIGH
e) toggle low side polarity, now active HIGH
f) test PWM signals
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> e 

a) loop sample frequency: 78.12 kHz
b) 1st order phase loop integrator coefficient: 15.2613
c) 2nd order phase loop integrator coefficient: 0.0256
d) amplitude loop integrator coefficient: 1.3015
e) maximum amplitude: 200 %
z) return to main menu

------> a 
new value -> 58 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 15.2613
c) 2nd order phase loop integrator coefficient: 0.0256
d) amplitude loop integrator coefficient: 1.3015
e) maximum amplitude: 200 %
z) return to main menu

------> b 
new value -> 20.5241954 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0256
d) amplitude loop integrator coefficient: 1.3015
e) maximum amplitude: 200 %
z) return to main menu

------> c 
new value -> .04570775 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3015
e) maximum amplitude: 200 %
z) return to main menu

------> d 
new value -> 1.31285949 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> zx 

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

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> [00][00]






























########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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 

a) PWM frequency: 30kHz
b) deadtime: 599ns
c) dutycycle testsignal: 50%
d) toggle high side polarity, now active HIGH
e) toggle low side polarity, now active HIGH
f) test PWM signals
z) return to main menu

------> a 

new value -> 40 

a) PWM frequency: 40kHz
b) deadtime: 599ns
c) dutycycle testsignal: 66%
d) toggle high side polarity, now active HIGH
e) toggle low side polarity, now active HIGH
f) test PWM signals
z) return to main menu

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> e 

a) loop sample frequency: 58.02 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> a 
new value -> 78 

a) loop sample frequency: 78.12 kHz
b) 1st order phase loop integrator coefficient: 20.5240
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> b 
new value -> 15.2614507 

a) loop sample frequency: 78.12 kHz
b) 1st order phase loop integrator coefficient: 15.2613
c) 2nd order phase loop integrator coefficient: 0.0456
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> c 
new value -> .02577256 

a) loop sample frequency: 78.12 kHz
b) 1st order phase loop integrator coefficient: 15.2613
c) 2nd order phase loop integrator coefficient: 0.0256
d) amplitude loop integrator coefficient: 1.3127
e) maximum amplitude: 200 %
z) return to main menu

------> d 
new value -> 1.30163847 

a) loop sample frequency: 78.12 kHz
b) 1st order phase loop integrator coefficient: 15.2613
c) 2nd order phase loop integrator coefficient: 0.0256
d) amplitude loop integrator coefficient: 1.3015
e) maximum amplitude: 200 %
z) return to main menu

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> [00][00]






























########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> g 

a) sensored or sensorless: SENSORED
b} sensorless startup: SELF START
c} e-rpm limit sensorless self start: 6723
d} e-rpm reached before transition: 86 %
e} minimum current push start: 0.9 A
f} push start current, error allowed: 8 %
g] erpm sensored to sensorless transition: 2000
h] transition time sensored to sensorless: 299 milli-sec 
i) return to motor start below 150 erpm
j) controlled slowdown for direction change: YES
k) phase current for controlled slowdown: 74.9 A 
l) motor maximum, forward: 255.08 k-erpm 
m) motor maximum, reverse: 205.41 k-erpm 
n) motor standstill voltage threshold: 0.29 V
o) enable low side pulsing in drive 0: YES
p) low side pulsing rate: 26 Hz
q) low side pulsing width: 20 usec
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> d 

a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 89.9 A
d) maximum battery current, motor use: 29.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 6.2 A
g) maximum shutdown error current, proportional: 6.2 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> c 
new value -> 100 

a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 99.9 A
d) maximum battery current, motor use: 29.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 6.2 A
g) maximum shutdown error current, proportional: 6.2 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> d 
new value -> 40 

a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 99.9 A
d) maximum battery current, motor use: 39.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 6.2 A
g) maximum shutdown error current, proportional: 6.2 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> f 
new value -> 20 

a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 99.9 A
d) maximum battery current, motor use: 39.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 19.9 A
g) maximum shutdown error current, proportional: 6.2 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> g 
new value -> 20 

a) number of current sensors: 2
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 99.9 A
d) maximum battery current, motor use: 39.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 19.9 A
g) maximum shutdown error current, proportional: 19.9 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> zx 

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

------> [00][00]
 
LOL I got the cool noise from the motor again. Skip to the 40 sec mark!
[youtube]rr6dhJEZ5Yo[/youtube]
 
Hi,
Teh Stork said:
Hmm, I'm actually quite finished with my controller, but I've hit a major bump.

I employ both Field Oriented Controll and Space Vector Modulation. Both methods are patented. Then again, you would need a electron microscope to read the flash memory on my uC after I blow the programming fuses. When I look up more stuff that my controllers do, there is patents everywhere :( Oversampling, patent. Hall sensor for motor controll, patent. Bemf sampling, patent. ZVS, patent. :| srsly?

Paying royalties would most likely put my controller out of the price range compared to cheap china controllers. I'm not quite sure what I should do, have you given this any thought? I'm not some anonomous chinese being able to hide over the pond. Is this a problem? Now I can speculate as to why Sevcons are damn hard to program and work with.

methods said:
There is no such thing as intellectual property... you cant own an idea. Use whatever method you want to use and enjoy. Do you really think these patent holders are going to find you on the big bad internet... then employ their $500/hour lawyers to jack you up fro selling 5 DIY boards a month? Not likely... Your entire net worth probably would not cover a day in court for them. The Lawyers would yawn.

-methods
In this case I completely agree with you but just because its not cost effective in a specific instance is no guarantee that a patent holder isn't evil enough or greedy enough to come after you. e.g. Monsanto polluting organic farms with their gmo's and suing the organic farmers for patent infringement.
 
Hi Arlo,

Arlo1 said:
So today is a good day! Almost done my dyno :) Just have to paint the frame and rivet the checker aluminum on and balance the roller!

But even better I am getting drive 3!!!!!! One of the main problems was I was running from a powersupply! Now I am using 2 3s pacs in series! and Its AWESOME this motor has never sounded so good!
Great work! Congratulations 8) 8) :D :D :mrgreen:!

You've finally convinced me that the following is a true statement :!:
Arlo1 said:
2012 is the year of Colossus! :)
 
Im realy bad at folowing directions lol. I need to finish setting it up before continiuing but I achived >10000 rpm on colossus and I dont belive its the limit! The no load current is not going up as fast as I thought it would. As a matter of fact it uses less current per volt as you increase to 100v then its a starit line to 160 so the eddy currents are not that bad!

Ok I will finish setting things properly before going to such hi voltages again lol.
[youtube]Q71tqVDyFWc[/youtube]
 
OK so... I went back to the spread sheet and looked at 170v (fully charged 40s) and compared to 84v feed to colossus in the stock wind.
At 10uS im at 211 amps which is way over the 160 phase leg rating of the ixfk230n20t im using. So What pwm and F samp do I need? Im at 40khz PWM and 78khz fsamp.
IN the video. 78khz f samp meens a sample every .00001282 seconds which meens if its ok on sample it has 12.82uS to let current build till the next sample doesnt it?
Edit: Oh and not to mention the 3-5uS delay in the current sensor responce.
 
Got my controller working again. The drive from the phase C which is the one that blew the 2 fets seems to have the ir2113 driver pulsing both Hi and LOw at the same time.... It was very weird because I could get the motor to run kinda ok with either the Hi or Low imput hooked up to the driver it self but when both were hooked up it was trying to turn them both on.

SO. I proceeded and tested the dead time and a bunch of other things. Dead time with my set up is set at 600nS I made a chart from 2 tests. And this is with 12v running to the powerstage instead of 15 which will meen I can test dead time again.

As well I tried to calibrate the currnet sensors but after I go into the menu and turn off option j in the current settings it gets stuck in drive3 and even when the motor stops it makes a noise and will not start again but drive 3 led is still on.
Code:
########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> d 

a) number of current sensors: 3
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 99.9 A
d) maximum battery current, motor use: 39.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 19.9 A
g) maximum shutdown error current, proportional: 19.9 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> j 

a) number of current sensors: 3
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 99.9 A
d) maximum battery current, motor use: 39.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 19.9 A
g) maximum shutdown error current, proportional: 19.9 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: NO
k) restore default calibration
z) return to main menu

------> zx 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------>  

a) write variables to EEPROM
b] reverse direction and write variables to EEPROM
z) return to main menu

------> [00][00][00]






























########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> d 

a) number of current sensors: 3
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 99.9 A
d) maximum battery current, motor use: 39.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 19.9 A
g) maximum shutdown error current, proportional: 19.9 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: NO
k) restore default calibration
z) return to main menu

------> j 

a) number of current sensors: 3
b) current sensor transimpedance: 10.00 mV/A
c) maximum motor phase current: 99.9 A
d) maximum battery current, motor use: 39.9 A
e) maximum battery current, regen: 4.9 A
f) maximum shutdown error current, fixed: 19.9 A
g) maximum shutdown error current, proportional: 19.9 A
h) IIR filter coefficient: 5
i) use additional comb filter: YES
j) use offset calibration: YES
k) restore default calibration
z) return to main menu

------> z 

########################################
#   (c)opyright 2012, B.M. Putter      #
#   Adliswil, Switzerland              #
#   bmp72@hotmail.com                  #
#                                      #
#  version 1.01                        #
#  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

------> zx 

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

------> [00][00]
 

Attachments

  • 001_renamed_320939.JPG
    001_renamed_320939.JPG
    39.2 KB · Views: 2,402
OK here is a cool clean demo on the sensorless transition demo with just 4s
[youtube]ijrYrEZCbTU[/youtube]
 
Ok.... So I spent some time and made some bus bars for the positve and negative feeds. Then I swaped out my bootstrap diodes and got it all running again. I played with sensorless push start thinking it was wrong then I tried self start and saw it spins backwards.... LEBOWSKI I think there is a flaw in your code... You said get it to spin in sensorless push start and I did but I have to push it backwards from the way I calibrated the halls and the coils. SO I swaped 2 phase wires and it spins the right way but then If I try sensored its all messed up!

Does this meen I have to run it on the dyno on sunday in reverse?

Oh BTW I get 23% more rpm at the same current in TRUE sensorless whats up with that?
 
Sensored and sensorless are totally unrelated so it is well possible they give opposite directions. For
pure sensorless running the motor is fed with pure sine waves with a fixed 120 degree relation between
them. For sensored it uses the back emf as sampled with menu b. There is a 50-50 change the sampled
back-emf has the same phase relation as the sensorless. What you can do is go into setup and save with
direction reversed (do this only once). I think then sensored and sensorless should both have the same forward
direction.

It is well possible the rpm's are higher in sensorless. It means the sampled back-emf (used in sensored) is not
as good as the pure sine waves (used in sensorless).
 
Thanks lebowski. I tried the reverse direction thing it doesnt work it makes sensored and sensorless both backwards. I will see if i can get a better sample so sensorless and sensored start will give the same kv.
 
Ok man I tried 2000 samples for option A in the coil position menu and used a drill to get it as smooth as possible and Its no different. Its still way better in sensorless. I will run it on the dyno under load tomorow and let you know more.
 
Made some great progress today. Man its quiet.
Here is the first run ever!
[youtube]5QGI8JjOKCs[/youtube]
And our best run so far (remember its only 6 fets)
[youtube]lWSJaghYnOk[/youtube]

And blowing up at 32s got another pass through but it might have been a mechanical failure due to a peice of something loose rolling where it wasnt suposed to be.
[youtube]5TsqzTcFicQ[/youtube]
 
This software you wrote lebowski definaly makes a motor very quiet and seems like it has a lot of potential.
 
OK So I think I found one of my main problems. I posted about it in my powerstage thread but I had the phase voltages running through the ribbon wire to the brain board then though the resistors and diodes there. So this caused to much current and Way to much voltage between the wires in the ribbon cable.
I think this is the cause of my last failure and seems to become apparent when I go over 100v. http://endless-sphere.com/forums/viewtopic.php?f=30&t=35387&start=195
 
Back
Top