build your very own Lebowski controller !

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.
 
FelixSphere said:
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...
 
liveforphysics said:
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 :)
 
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?
 
If you need cruise control you are going to slow.
 
Animalector said:
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.
 
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.
 
I have a CAN project I could use help with. PM me. I'm going to use a Arduino and a sheild
 
Arlo1 said:
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 :)
 
FelixSphere said:
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/DeviceDoc/70070D.pdf
 
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 said:
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.
 
ok, but ..... how do you sync two controllers: one turns clockwise and the other one counterclockwise ?
 
couple of things;
1) my SMD version of lebowski's circuit includes all you need to slave controllers together using CAN
https://endless-sphere.com/forums/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...?
 
bobc said:
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"
 
FelixSphere said:
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.
 
FelixSphere said:
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:
https://endless-sphere.com/forums/viewtopic.php?f=30&t=72692
 
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-universal-motor-controller/
 
hal2000 said:
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-universal-motor-controller/

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).
 
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
    62.5 KB · Views: 3,589
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)
 
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
 
Back
Top