build your very own Lebowski controller !

Electric Motors and Controllers

Re: build your very own Lebowski controller !

Postby liveforphysics » Sat Jan 07, 2017 1:57 am

Speed control works only on things with pathetic power/weight and acceleration capabilities.

For anything high performance, it needs to be torque control, but with a mix of maximum speed ramp rates so when the tire lifts the ground for a split second it doesn't spin it up to peak RPM instantly.
Each carcinogen vapor exposure includes a dice roll for cancer.

Each mutagen vapor exposure includes a dice roll for reproductive genetic defects in your children.

Each engine start sprays them into a shared atmosphere which includes beings not offered an opportunity to consent accepting these cancer experiences and defective genetics life experiences.

Every post is a free gift to the collective of minds composing the living bleeding edge of LEV development on our spaceship.
User avatar
liveforphysics
100 GW
100 GW
 
Posts: 14368
Joined: Wed Oct 29, 2008 1:48 am
Location: Santa Cruz, CA, USA

Re: build your very own Lebowski controller !

Postby Lebowski » Sat Jan 07, 2017 3:36 am

FelixSphere wrote:Really an amazingly great job Lebowski. I am pulling my hat. But I still have a question. Maybe I was just too stupid to find it in the posts, but....how does the controller behave ? Is it a pure torque control or speed control ? I am currently using a Kelly KBX which also claims to support "torque", but in reality it is not a real torque mode. As I am using it in an electric trial bike the following happens: Open throttle -> Motor accelerates (so far not too bad :-)) Close throttle completely, motor runs freewheel (perfect). But if I do not close the throttle completely the controller brakes the motor. Before I start to build a controller, I want to be 100% sure that the controller behaves 100% torque controlled. Means Opening the throttle accelerates, closing the throttle has no braking effect. Thanks a lot for any experience or feedback.


It is 100% torque control with no braking effect for partial throttle or throttle closed (partial throttle just gives partial torque, throttle closed gives 0 torque).

Arlo1 has a second throttle just to add engine braking effect...
Last edited by Lebowski on Sat Jan 07, 2017 3:38 am, edited 1 time in total. View post history.
User avatar
Lebowski
1 GW
1 GW
 
Posts: 3076
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Postby Arlo1 » Sat Jan 07, 2017 12:21 pm

liveforphysics wrote:second it doesn't spin it up to peak RPM instantly.



This isn't a problem in most cases. My sevcon in my Zero has a max rpm/s/s gain setting which I have been meaning to play with.

I think lebowski has something as well and might be able to go into it further.

But in my car if the wheels are in the air then I have a bigger problem to worry about :)
My Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer
User avatar
Arlo1
100 GW
100 GW
 
Posts: 8449
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: build your very own Lebowski controller !

Postby FelixSphere » Sat Jan 07, 2017 12:58 pm

Thanks guys for your quick answers :-) This is what I was hoping for
FelixSphere
10 mW
10 mW
 
Posts: 34
Joined: Fri Apr 18, 2014 4:16 am

Re: build your very own Lebowski controller !

Postby pguk » Tue Jan 10, 2017 9:02 am

On the back of this torque vs speed control, what do folks think about cruise control? For high power trail bike, obviously not required, but for a low power commuter I think I'll miss the ability to lock in at a certain speed at the push of a button and sit there till the next red light. For a normal upright bike, I found it an ache when the cc button on my xiechang controller packed up - I fixed it before my wrist/thumb got too sore. Reading a little of kingfish's road trip yesterday - his cc button failed just after he set off - he managed to fix it a few miles down the road.

Perhaps something external would work: a small micro in the throttle line?
6pence spot welder https://endless-sphere.com/forums/viewtopic.php?f=31&t=81274
"It is all nice and proper, but only an idiot would think that the father is sixpence to the good on the transaction." C.S. Lewis' Mere christianity
User avatar
pguk
100 W
100 W
 
Posts: 101
Joined: Fri Mar 16, 2012 4:30 pm
Location: North England, birthplace of the Industrial Revolution

Re: build your very own Lebowski controller !

Postby Arlo1 » Tue Jan 10, 2017 11:12 am

If you need cruise control you are going to slow.
My Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer
User avatar
Arlo1
100 GW
100 GW
 
Posts: 8449
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: build your very own Lebowski controller !

Postby Animalector » Tue Jan 10, 2017 3:09 pm

Cycle analyst will still work just fine and allow quick changing of the current settings speeds etc.

Edit... I think....
Last edited by Animalector on Tue Jan 10, 2017 3:20 pm, edited 1 time in total. View post history.
Animalector
10 kW
10 kW
 
Posts: 782
Joined: Sat Mar 17, 2012 4:50 pm
Location: Mareeba - Queensland

Re: build your very own Lebowski controller !

Postby marcexec » Tue Jan 10, 2017 7:47 pm

Arlo1 wrote:If you need cruise control you are going to slow.

:D put that in your signature mate :lol:
A motorcyclist is never late, Frodo Baggins. Nor is he early. He arrives precisely when he means to.
My Suzuki RF400 build: now with Enertrac MHM602 and 6kWh AESC modules protected by a Zephyr BMS
Renault Equation modded to 10S6P recycled laptop 18650s & 1kW controller.
Master of Electric Motor Selection: "Adopt a motor" (PM me if you have trouble editing)
All the gear, all the time!
User avatar
marcexec
1 kW
1 kW
 
Posts: 407
Joined: Tue Mar 10, 2009 8:20 am
Location: Dublin, Ireland

Re: build your very own Lebowski controller !

Postby pguk » Thu Jan 12, 2017 6:42 am

Animalector wrote:Cycle analyst will still work just fine and allow quick changing of the current settings speeds etc.

Edit... I think....


I could use my Cycle Analyst, sure. Set max speed/current. You're still hanging onto the throttle all the time tho' - a pushbutton solution would be best IMO.

Some thoughts about coding (thinking aloud):
Unless push button pressed, output follows input.
When push button pressed:
1. Log speed.
2. Monitor speed.
3. If speed falls, increase throttle to achieve logged speed.
4. If speed increases, back off throttle to achieve logged speed.

Actually this is a PID sytem. There are some PID libraries to choose from on the arduino boards. They need some tuning for a particular application as I understand. My elementary coding is limited to arduino IDE so it'd take me an age to develop. I don't even know if a 16Mhz chip running arduino code would be fast enough.
I hope this isn't off topic - Be like sitting on the autobahn in a Mercedes. (I imagine..)

Edit: I've been thinking on this a little more. For a more authentic cycling feel, it would perhaps be better to have a throttle hold rather than cruise control. This way we keep the feel of cycling requiring more effort to keep speed on an incline, but obviously less than without any electric assist. Easier to code also.
Last edited by pguk on Mon Jan 16, 2017 12:19 pm, edited 1 time in total. View post history.
6pence spot welder https://endless-sphere.com/forums/viewtopic.php?f=31&t=81274
"It is all nice and proper, but only an idiot would think that the father is sixpence to the good on the transaction." C.S. Lewis' Mere christianity
User avatar
pguk
100 W
100 W
 
Posts: 101
Joined: Fri Mar 16, 2012 4:30 pm
Location: North England, birthplace of the Industrial Revolution

Re: build your very own Lebowski controller !

Postby FelixSphere » Mon May 22, 2017 12:27 pm

Hi all, just received my chips from Lebowski :-) will start building a controller next week once the pcbs touch down. I read myself through the manual and the thread but could not find help on the CAN options. Usually with CAN you call or write to receivers and their registers. In this case I guess this is somehow serial over CAN ? What I would like to achieve is to read some values like rpm, amps, etc and control throttle. So....what else offers the CAN interface (e.g braking, reverse ?) Or can I even write acceleration curves to it, kinda "configuration" ? Or ... has anybody built an e.g Arduino (Duo supports CAN) sample application ? Appreciate any input :-) As I am coming from hardware and software engineering I would love to share a project for a CAN/Bluetooth/WiFi/Display/Whatever unit with you.
Thanks in advance.
FelixSphere
10 mW
10 mW
 
Posts: 34
Joined: Fri Apr 18, 2014 4:16 am

Re: build your very own Lebowski controller !

Postby Arlo1 » Mon May 22, 2017 1:24 pm

I have a CAN project I could use help with. PM me. I'm going to use a Arduino and a sheild
My Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer
User avatar
Arlo1
100 GW
100 GW
 
Posts: 8449
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: build your very own Lebowski controller !

Postby marcexec » Mon May 22, 2017 3:02 pm

Arlo1 wrote:I have a CAN project I could use help with. PM me. I'm going to use a Arduino and a sheild


Sorry if OT, but you might want to consider the ESP32 (SJA1000 CAN), & there's a CAN driver now: https://hackaday.io/project/20204-esp32-can-driver (no shield, WiFi & loads of power).
Just checked the price, they're down to ~$8 US :)
A motorcyclist is never late, Frodo Baggins. Nor is he early. He arrives precisely when he means to.
My Suzuki RF400 build: now with Enertrac MHM602 and 6kWh AESC modules protected by a Zephyr BMS
Renault Equation modded to 10S6P recycled laptop 18650s & 1kW controller.
Master of Electric Motor Selection: "Adopt a motor" (PM me if you have trouble editing)
All the gear, all the time!
User avatar
marcexec
1 kW
1 kW
 
Posts: 407
Joined: Tue Mar 10, 2009 8:20 am
Location: Dublin, Ireland

Re: build your very own Lebowski controller !

Postby Lebowski » Tue May 23, 2017 4:50 am

FelixSphere wrote:Hi all, just received my chips from Lebowski :-) will start building a controller next week once the pcbs touch down. I read myself through the manual and the thread but could not find help on the CAN options. Usually with CAN you call or write to receivers and their registers. In this case I guess this is somehow serial over CAN ? What I would like to achieve is to read some values like rpm, amps, etc and control throttle. So....what else offers the CAN interface (e.g braking, reverse ?) Or can I even write acceleration curves to it, kinda "configuration" ? Or ... has anybody built an e.g Arduino (Duo supports CAN) sample application ? Appreciate any input :-) As I am coming from hardware and software engineering I would love to share a project for a CAN/Bluetooth/WiFi/Display/Whatever unit with you.
Thanks in advance.


The CAN bus is used for sharing throttle information between different (similar) controller IC's. 3 words (6 bytes) are transmitted and received, 2 containing throttle infor of the 2 throttles and the 3 word, only one bit is used for forward/reverse. It does not confirm to any higher CAN automotive protocol or anything like that. You cannot read out registers or anything like that, some info is available though via the RS232 (motor speed, voltages, current etc).

To get an understanding of CAN I found this very useful (sections 23.4 onwards)
http://ww1.microchip.com/downloads/en/D ... 70070D.pdf
User avatar
Lebowski
1 GW
1 GW
 
Posts: 3076
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Postby FelixSphere » Tue May 23, 2017 10:28 am

OK, got you. I guess the throttle values will become negative when I go into reverse, right ? So it seems I need to get/set the values from serial, which is not a big deal technically. But it looks like I can's get the rpms, Will continuous reading of the serial affect any other tasks of the controller ?
FelixSphere
10 mW
10 mW
 
Posts: 34
Joined: Fri Apr 18, 2014 4:16 am

Re: build your very own Lebowski controller !

Postby Arlo1 » Tue May 23, 2017 10:33 am

FelixSphere wrote:OK, got you. I guess the throttle values will become negative when I go into reverse, right ? So it seems I need to get/set the values from serial, which is not a big deal technically. But it looks like I can's get the rpms, Will continuous reading of the serial affect any other tasks of the controller ?

No negative throttle = regen.
My Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
My YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
RC and most types of Lithium batteries you MUST know your individual cell voltages charging and discharging.
Don't keep them were you cant afford smoke or fire!
Never above 4.2v never below 2.7v EVER!!!
HI power controller design. Game Changer
User avatar
Arlo1
100 GW
100 GW
 
Posts: 8449
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: build your very own Lebowski controller !

Postby FelixSphere » Tue May 23, 2017 12:09 pm

ok, but ..... how do you sync two controllers: one turns clockwise and the other one counterclockwise ?
FelixSphere
10 mW
10 mW
 
Posts: 34
Joined: Fri Apr 18, 2014 4:16 am

Re: build your very own Lebowski controller !

Postby bobc » Tue May 23, 2017 2:23 pm

couple of things;
1) my SMD version of lebowski's circuit includes all you need to slave controllers together using CAN
viewtopic.php?f=30&t=87104
2) I'd be very interested in what RS232 info is available while running - is that in one of the threads? can someone point to it? If not can lebowski give us a precis? (e.g. baudrate & data description/format) I'm sure I should have seen it somewhere & have simply missed it......
PS thanks for answer below!!!!

felixsphere - sync 'em normally but swap 2 phases on one motor so it goes backwards.... easy. lebowski's software takes care of the hall sensor positions
I'm supposing you have a left motor & a right motor so you want one to run backwards.
Only issue I can see is that at max speed any slight motor difference would pull the steering...?
Last edited by bobc on Wed May 24, 2017 7:25 am, edited 2 times in total. View post history.
bobc
100 kW
100 kW
 
Posts: 1001
Joined: Thu Jan 20, 2011 5:08 pm
Location: Knutsford England

Re: build your very own Lebowski controller !

Postby Wächter » Wed May 24, 2017 3:17 am

bobc wrote:2) I'd be very interested in what RS232 info is available while running - is that in one of the threads? can someone point to it? If not can lebowski give us a precis? (e.g. baudrate & data description/format) I'm sure I should have seen it somewhere & have simply missed it......


You can find some information in the manual, topic "j) CAN Setup", page 21.
I quote:
"During motor use the RS232 is dormant. Normally no information is transmitted but when the controller
receives a single lower-case letter according to the table it will start transmitting 16 bit data at a rate
indicated here under 'RS232 output rate'. Data is outputted as 2's complement with the high byte first.
Transmission will stop once a character not in the table is received.

    a - phi (slide 16)
    b - phi_int (slide 16)
    c - phase current, filtered
    d - phase current, requested from throttle
    e - amplitude (slide 18)
    f - throttle 1 (x1)
    g - throttle 2 (x2)
    h - combined throttle after polynomals (y1+y2)
    i - calibration value current sensor A
    j - calibration value current sensor B
    k - calibration value current sensor C
    l - temperature (*2) reading from sensor 0
    m - sensor 1
    n - sensor 2
    o - sensor 3
    p - sensor 4
    q - sensor 5
    r - sensor 6
    s - sensor 7
    t - Max phase current based on temperature sensors
    u - Field weakening current"
Wächter
1 µW
1 µW
 
Posts: 1
Joined: Tue Dec 11, 2012 7:43 am
Location: Stemwede

Re: build your very own Lebowski controller !

Postby Lebowski » Wed May 24, 2017 6:28 am

FelixSphere wrote:ok, but ..... how do you sync two controllers: one turns clockwise and the other one counterclockwise ?


Two controllers will not be synced, what happens is they share throttle data.

Each of the two analog throttles analog voltage is converted to a 16 bit code representing a range between 0 (throttle closed) and 1 (throttle fully open).

Then with the throttle coefficient in the throttle menu you can build your throttle curve, keeping in mind that when the output of the throttle (after the curve processing) is positive it will generate power and negative will be regen.

For reverse there is a pin for a forward/reverse switch, this info is also shared. Negative phase current has nothing to do with reverse !

Each controller sharing throttle can have its own independent throttle curve, reference direction (by swapping two motor wires, as mentioned by Wally). With different max phase current settings the motors can have different torques (you can have a 2 motor bike with less torque in the front wheel). Motors can also having different speeds (simulating a differential, like you want for a tadpole trike or car).

Synching 2 motors to the same speed is not done with the throttle sharing, as it is a torque throttle.
Last edited by Lebowski on Wed May 24, 2017 6:29 am, edited 1 time in total. View post history.
User avatar
Lebowski
1 GW
1 GW
 
Posts: 3076
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Postby Lebowski » Wed May 24, 2017 6:33 am

FelixSphere wrote:OK, got you. I guess the throttle values will become negative when I go into reverse, right ? So it seems I need to get/set the values from serial, which is not a big deal technically. But it looks like I can's get the rpms, Will continuous reading of the serial affect any other tasks of the controller ?


Throttle values are transmitted over CAN, as the CAN bus has error detection for transmission errors. You don't want sudden full power because the RS232 has a read error !

Continuous reading of the RS232 has no impact on the other tasks of the controller. The display in this video is updated via the RS232 funtion:
viewtopic.php?f=30&t=72692
User avatar
Lebowski
1 GW
1 GW
 
Posts: 3076
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Postby hal2000 » Fri May 26, 2017 5:38 pm

Is this work by elis over in diy electric car similar to your brain board, if so could you compare and contrast the two. http://advantics.fr/umc-drive-3-0-unive ... ontroller/
hal2000
1 W
1 W
 
Posts: 59
Joined: Thu Sep 20, 2012 11:04 am

Re: build your very own Lebowski controller !

Postby Lebowski » Sat May 27, 2017 3:01 am

hal2000 wrote:Is this work by elis over in diy electric car similar to your brain board, if so could you compare and contrast the two. http://advantics.fr/umc-drive-3-0-unive ... ontroller/


It doesn't really tell much about the controller capabilities (it says 'FOC algorithm') but not much more. It seems to have hardware current protection with I did not add to my board. My board should be seen as a demonstrator board, like you can buy demonstrator boards for FPGA's and things like that. My board is a fully funtional controller and uses all the capabilities of the controller IC but it does not have additional overcurrent protection or interfaces to commercial power stages.

About the control, I have sensorless, fieldweakening, forward/reverse, regen, the link does not mention any of this for the elis controller (though it probably has regen and forward/reverse). I only have hall inputs, not a resolver input (no pins left on chip for this).
User avatar
Lebowski
1 GW
1 GW
 
Posts: 3076
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Postby FelixSphere » Sat Sep 09, 2017 2:41 am

Hi Lebowski,
I am currently building up the controller. Probably I am just too stupid to find.... but how do I get the values for the R_mo resistors ? See attachment
Thanks for enlightening me :-)
Attachments
R-mo.jpg
R-mo.jpg (116.83 KiB) Viewed 218 times
FelixSphere
10 mW
10 mW
 
Posts: 34
Joined: Fri Apr 18, 2014 4:16 am

Re: build your very own Lebowski controller !

Postby Lebowski » Sat Sep 09, 2017 12:24 pm

The values are given in the KiCad schematic file at the beginning of this thread.

Each of the R_mot resistors should be roughly 70 * V_bat_max.

Three resistors then makes 210 * V_bat_max, so the max current will be roughly (1/210) = 5 mA.

Use 1/4 Watt resistors minimum (with 5mA a 1/4W resistor can handle 50Vdc, or 1/3rd of 150Vdc)
User avatar
Lebowski
1 GW
1 GW
 
Posts: 3076
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: build your very own Lebowski controller !

Postby ThierryGTLTS » Fri Oct 20, 2017 10:37 am

Hi to all,

Just noticed that the new datasheet of the ACS758 said that this device will be obsolete.

ACS770 is proposed as replacement for new designs.

Have a Nice Day.

Thierry
Last edited by ThierryGTLTS on Fri Oct 20, 2017 10:38 am, edited 1 time in total. View post history.
ThierryGTLTS
1 mW
1 mW
 
Posts: 13
Joined: Tue Jan 10, 2017 8:10 am

Previous

Return to Motor Technology

Who is online

Users browsing this forum: Promille and 5 guests