Comments (6)
Hi Benjamin, bump about this one. We need a way to support different current sensor gains, I just would need to know how should I move forward, if with many binaries or with user config.
Thanks
from bldc.
I thought about it a bit, and one simple way would be to add a terminal command to configure the gain and store it in a hw-specific place in emulated EEPROM. I just added the following functions to the code:
/**
* Read hw-specific variable from emulated EEPROM.
*
* @param v
* The variable to read the result from.
*
* @param address
* Mapped address in EEPROM. Range 0 to 63.
*
* @return
* true for success, false if variable was not found.
*/
bool conf_general_read_eeprom_var_hw(eeprom_var *v, int address);
/**
* Store hw-specific variable to emulated EEPROM.
*
* @param v
* The variable to store the result in.
*
* @param address
* Mapped address in EEPROM. Range 0 to 63.
*
* @return
* true for success, false if something went wrong.
*/
bool conf_general_store_eeprom_var_hw(eeprom_var *v, int address);
I haven't tested the code, so there might be some errors.
The idea would be that you try to load the variable at boot, and if it fails use a default value. Then you can update the variables with terminal commands. The advantage of this is that you can add custom features to hardware without impacting the rest of the code base. The disadvantage is that the terminal interface might be less intuitive.
Can you give it a try and see if it works?
from bldc.
Thanks Benjamin, I get it and its a promising feature to implement many other things. I can see a user forgetting to send the command after upgrading the firmware so I hope in the future we can expose the current gain to vesc tool. Perhaps a way to hide settings from vesc tool. Anyway, wishlist stuff.
I will give it a test ride right after finishing the PR I'm working on.
from bldc.
Persistent settings between updates would be useful if they are a bit hidden. I will look into storing the settings in RAM before the reboot at the firmware update, and attempt to load them back from there if reading the emulated eeprom fails. Then the function can have an argument that tells if the parameter is loaded from ram, and what the firmware version was when it was stored. Then your hardware file can decide if it is still compatible and store it back if it is. I can probably do something similar for the motor and app settings, and decide if they are compatible based on the signature.
from bldc.
Persistent settings would be great for all users, saves some clicks on the GUI :)
from bldc.
I tested it today and the store/read functions work well. I have a terminal command that sets the current sensor gain, thanks! This commit is sitting on top of a branch not yet merged, it has to wait for a couple of pull requests.
from bldc.
Related Issues (20)
- $ make **WARNING** ARM-SDK not in D:/Work/Nazarite/FOC/VESC/bldc-master/tools/gcc-arm-none-eabi-7-2018-q2-update Please run 'make arm_sdk_install'
- [LispBM] Programmatically delaying the shutdown event HOT 4
- [LispBM] Registering an extension that doesn't start with "ext-" silently passes HOT 5
- It needs more default number HFI start samples to resolve the initial ambiguity HOT 1
- Feature Request: add option to invert wake up switch function from normally closed to normally open button
- Better support for digital/ switch-based brakes HOT 3
- Waiting for vesc suport step/dir interface!
- Feature Request:How to customize my VESC firmware?
- Can 1 STM32F drive 2 mosfet Driver? HOT 4
- I want to drive two mosfet drivers with one stm32f like foCbox unity. I'm going to use two DRV8301's. I don't know if VESC allows 1 STM32F to receive SPI from two Mosfet Drivers. Is there anyone who can help me with the PROJECT? HOT 2
- [LispBM] Shutdown event issues HOT 6
- Feature request: Redundant analog signals for throttle and brake
- 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
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.