Comments (4)
The network may contain other UAVCAN nodes, not only ESC. We need to restrict the enumeration process so that only ESCs are affected. One possible solution is to define a vendor-specific message/service for that (only ESC will be able to recognize it), but generally it is preferred to reduce the number of vendor specific data types when possible to improve cross-vendor compatibility.
So I propose a generic approach based on a single new standard message. It is suitable for any node that can receive some confirmation from the user (e.g. motor turn, button press).
Here's the new message uavcan.protocol.EnumerationRequest
:
uint8 timeout_sec
uint7 node_id
Let the default node config contain an invalid Node ID, so the node starts in passive mode (i.e. it can listen the bus but can't transmit anything). If the node is in passive mode, it subscribes to uavcan.protocol.EnumerationRequest
and is ready to get a new Node ID. The node shall not subscribe to that message if it is already configured to avoid spurious reconfiguration.
The algorithm then (essentially it's just a variation of your proposed approach):
- The main node (e.g. a Pixhawk) performs network discovery to find all ESCs that are already configured (unconfigured ESC will not be discovered).
- Each discovered ESC is reset to default config (using
uavcan.protocol.param.*
) and restarted, so it enters passive mode and awaitsuavcan.protocol.EnumerationRequest
. Now all ESC are unconfigured and are ready for enumeration. - For i=0..N (where N is provided by the user):
- Pixhawk broadcasts
uavcan.protocol.EnumerationRequest
withnode_id
set to an appropriate value. - The user turns the motor; ESC assigns itself the requested Node ID, saves the config, and restarts (not in passive mode this time).
- Pixhawk makes sure that ESC is now online with proper Node ID.
- Pixhawk broadcasts
- Enumeration is done now; however, the ESC are not ready to work yet because we need to assign motor indices. This is done automatically with no attention from the user. For each ESC:
- Set the config param
uavcan_esc_index
. - Set the config param
uavcan_light_index
(optional, for RGB LED control). - Save the config params into the non-volatile memory.
- Restart this ESC.
- Set the config param
- Make sure that all N ESCs are online and have status code OK.
Note that this algorithm can be safely restarted from any stage.
from sapog.
@pavel-kirienko The user will need to identify the ESCs not only in their order, but also regarding their position - therefore assigning an ID and a position is linked (since the flight code has a fixed mapping of ID to position). So step 3+4 will happen at the same time.
from sapog.
@LorenzMeier Yes, essentially it doesn't matter whether 3&4 happen at the same time or subsequently. It's just important to realize that Node ID and motor index are not the same thing.
A new idea: since we're asking user to turn the prop, we could also ask them to turn the prop in the right direction (CW/CWW) so we can configure the direction of rotation automatically too. It shouldn't be hard to implement.
from sapog.
Done.
from sapog.
Related Issues (20)
- Increase the space allocated for bootloader to 16K HOT 3
- Shorten parameter names in order to comply with PX4 limitations
- Build failure: Unable to checkout 'chibios @ e7a5b54' in submodule path 'firmware/chibios' HOT 4
- Temp sensor autodetect
- sapog development environment HOT 6
- [Feature request]Add support DSHOT signal input HOT 4
- segfaults during linking HOT 1
- undefined reference to `main' HOT 7
- esc_setpoint_raw is offset from rpm feedback. HOT 7
- Compile Error HOT 6
- On which pin UART2 isοΌ HOT 1
- Myxa ESC issues HOT 5
- Why do I compile so many errors with UBUNTU?
- Python 3 syntax error on filter(lambda (x, y): ) HOT 3
- Support UAVCAN v1.0 HOT 6
- Enable CAN acceptance filters
- Configurable Telemetry Rate HOT 1
- Maximum RPM Command Rate HOT 1
- What other processors are already coded for this HOT 1
- Missed mid-flight rotation feature HOT 4
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 sapog.