Comments (10)
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.
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.
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.
@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.
@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.
I got it, thanks!!
from bldc.
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.
@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.
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.
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)
- Feature Request: Disable Field Weakening at compile HOT 2
- Current control tuning HOT 1
- make qt_install failed
- Adding MakerX hardware HOT 1
- Lisp app-adc-override wrong values HOT 16
- TCP connection for VESC tools is unavailable when uart connection is established with Lisp
- Unexpected sensor port voltage on VESC 6 75V HOT 1
- Traction control on dissimilar motors. HOT 2
- CAN bus spamming
- Suport UART commands VS LispBM commands HOT 2
- Bug in release 6.02, in COMM_GET_IMU_DATA command handler, controller_id is never sent
- I ran into an error using make qt_install in Windos_PowerShell
- I ran into an error using make qt_install in Windos_PowerShell
- I ran into an error using make qt_install in Windos_PowerShell
- I ran into an error using make qt_install in Windos_PowerShell
- Support for bipolar BLDC motors?
- Feature request: updating c_libs interface header HOT 3
- Reverse Driving - Negative Duty Cycle Problem HOT 1
- make arm_sdk_install issues on windows HOT 1
- Get ESC faults via CAN HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bldc.