Giter VIP home page Giter VIP logo

Comments (10)

nitrousnrg avatar nitrousnrg commented on July 18, 2024 1

I think that the speed is not surging because of the regen algorithm. When you do one-pedal driving it will naturally produce that behavior, whilst still controlling the motor torque.

You can try my implemetantion of it to see if thats what you're after. https://github.com/luna-cycle/vesc_pkg/tree/one_pedal_driving/one_pedal_driving

from bldc.

nitrousnrg avatar nitrousnrg commented on July 18, 2024 1

Ah, that LISP is ugly for my eyes :)

Oh for sure. Try installing that vesc package, it includes a graph that shows what it does.

from bldc.

nitrousnrg avatar nitrousnrg commented on July 18, 2024 1

That's a secondary feature for systems constrained by battery current. Imagine a motor that can flow 400Apk but with a battery rated for 50Adc. In those cases at very low speed your phase current gets limited by battery current.

At high speed your throttle range would be 0-400A, but the controller won't drive more than 50Amps or so. That feels bad, as 75% of the throttle range does nothing at high speed.
Kind of similar situation happens for the regen. The whole point of this is to have a smooth "one-pedal-driving" experience.

In any case, give the vesc package a try and see if you like it

from bldc.

casainho avatar casainho commented on July 18, 2024

@nitrousnrg I appreciate your answer. I must say that I did took as reference the EBike app for Bafang M600, on the VESC firmware, thank you. I did the same for my Bafang M500, but using Pyhton firmware instead -- see here: https://opensourceebike.github.io/

Ah, that LISP is ugly for my eyes :)
So I am using an ESP32 board running Pyhton firmware and interfacing with VESC by UART.

I just did the pull request to add the command I was looking for. I tested in a few testing rides on the street and it seems to work well. Well, anyway, I replicated a CAN command that was already setting only the motor max current.

from bldc.

casainho avatar casainho commented on July 18, 2024

@nitrousnrg , I am being trying to understand your algorithm. Why do you relate battery current and motor current??

What I am struggling to understand is only this part: 1-Calculate max braking and accel current for the current speed

Thank you.

from bldc.

casainho avatar casainho commented on July 18, 2024

I got it, thanks!!

from bldc.

Gabrielerusso avatar Gabrielerusso commented on July 18, 2024

That's a secondary feature for systems constrained by battery current. Imagine a motor that can flow 400Apk but with a battery rated for 50Adc. In those cases at very low speed your phase current gets limited by battery current.

At high speed your throttle range would be 0-400A, but the controller won't drive more than 50Amps or so. That feels bad, as 75% of the throttle range does nothing at high speed. Kind of similar situation happens for the regen. The whole point of this is to have a smooth "one-pedal-driving" experience.

In any case, give the vesc package a try and see if you like it

simply use the same current fro battery and phase and you will get almost the same response on the complete rpm range of the motor. I think the problem of the issue creator is non-existent as common automotive systems don't use such approach, the maximum they do in modern control systems is to provide a limit for the acceleration of the wheels, but you can do that in VESC too by tuning varius parameters, a simply way to smoothen this out could be to tune rising time of throttle

from bldc.

casainho avatar casainho commented on July 18, 2024

@Gabrielerusso , thanks for the feedback. I am using VESC only to control the motor, and an external board to read the sensors, control things as the lights, the battery BMS switch, send the motor commands to VESC and control the display - and I do all this in ESP32 Pyhton firmware, including wireless communication with the display and battery BMS switch.

And I am playing with the VESC speed controller PID values to see if it is enough for my needs, and maybe you are correct.

from bldc.

nitrousnrg avatar nitrousnrg commented on July 18, 2024

simply use the same current fro battery and phase and you will get almost the same response on the complete rpm range of the motor.

If your throttle controls directly the battery current, at zero rpm you can do 400 phase amps with like 10% throttle, its impossible to control torque.
I think I could dynamically reference the the adc end to battery current max if that happens only when modulation is maxed out.

casainho probably saw the same behavior that I saw, you give little throttle to an scooter and it doesn't shoot to max rpm like the default vesc does, and he thought there is a speed limiter in place. I thought the same at that time, until I recently realized that the behavior is 100% related to the regen algorithm.

from bldc.

Gabrielerusso avatar Gabrielerusso commented on July 18, 2024

simply use the same current fro battery and phase and you will get almost the same response on the complete rpm range of the motor.

If your throttle controls directly the battery current, at zero rpm you can do 400 phase amps with like 10% throttle, its impossible to control torque. I think I could dynamically reference the the adc end to battery current max if that happens only when modulation is maxed out.

casainho probably saw the same behavior that I saw, you give little throttle to an scooter and it doesn't shoot to max rpm like the default vesc does, and he thought there is a speed limiter in place. I thought the same at that time, until I recently realized that the behavior is 100% related to the regen algorithm.

Nope, vesc in FOC mode allows you to limit the phase current and battery current separately, so if you put the same current limit for battery and phase you will get an almost constant torque response. As said commercial vehicles also do this and use acceleration limits to prevent unwanted or dangerous situations.
Providing a rpm limit for the given throttle it's not usefull at all as it will give problem during real use with wheels on the ground.
You can write a small LISP script to do so my reading the rpm, deriving it to obtain radial acceleration and create a small acceleration controller that will limit the phase/battery current. I've an escooter myself running 240A battery and 700A phase and on the road by having all parameters properly tuned i've not got any problem (yes i'm using current control)

from bldc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.