mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-23 09:03:40 +08:00
Merge pull request #656 from odriverobotics/sphinx-docs-update
bold table, eqn formatting, homepage, CAN msgs
This commit is contained in:
@@ -59,8 +59,14 @@ For example, an Axis ID of :code:`0x01` with a command of :code:`0x0C` would be
|
||||
|
||||
:code:`0x01 << 5 | 0x0C = 0x2C`
|
||||
|
||||
Messages
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. csv-table:: CAN Messages
|
||||
:file: figures/can-protocol.csv
|
||||
:header-rows: 1
|
||||
.. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
All multibyte values are little endian (aka Intel format, aka least significant byte first).
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -31,11 +31,10 @@ Position Control Loop
|
||||
--------------------------------------------------------------------------------
|
||||
The position controller is a P loop with a single proportional gain,
|
||||
|
||||
.. math::
|
||||
.. code::
|
||||
|
||||
\text{pos_error} &= \text{pos_setpoint} - \text{pos_feedback},
|
||||
|
||||
\text{vel_cmd} &= \text{pos_error} * \text{pos_gain} + \text{vel_feedforward}.
|
||||
pos_error = pos_setpoint - pos_feedback,
|
||||
vel_cmd = pos_error * pos_gain + vel_feedforward.
|
||||
|
||||
|
||||
Velocity Control Loop
|
||||
@@ -43,13 +42,11 @@ Velocity Control Loop
|
||||
|
||||
The velocity controller is a PI loop where
|
||||
|
||||
.. math::
|
||||
.. code::
|
||||
|
||||
\text{vel_error} &= \text{vel_cmd} - \text{vel_feedback},
|
||||
|
||||
\text{current_integral} &+= \text{vel_error} * \text{vel_integrator gain},
|
||||
|
||||
\text{current_cmd} &= \text{vel_error} * \text{vel_gain} + \text{current_integral} + \text{current_feedforward}.
|
||||
vel_error = vel_cmd - vel_feedback,
|
||||
current_integral += vel_error * vel_integrator gain,
|
||||
current_cmd = vel_error * vel_gain + current_integral + current_feedforward.
|
||||
|
||||
|
||||
Current Control Loop
|
||||
@@ -57,15 +54,12 @@ Current Control Loop
|
||||
|
||||
The current controller is also a PI loop,
|
||||
|
||||
.. math::
|
||||
.. code::
|
||||
|
||||
\text{current_error} &= \text{current_cmd} - \text{current_feedback},
|
||||
|
||||
\text{voltage_integral} &+= \text{current_error} * \text{current_integrator gain},
|
||||
|
||||
\text{voltage_cmd} &= \text{current_error} * \text{current_gain} + \text{voltage_integral} + ...
|
||||
|
||||
& ... + \text{voltage_feedforward} \textbf{ (when we have motor model)}.
|
||||
current_error = current_cmd - current_feedback,
|
||||
voltage_integral += current_error * current_integrator gain,
|
||||
voltage_cmd = current_error * current_gain + voltage_integral + ...
|
||||
... + voltage_feedforward (when we have motor model).
|
||||
|
||||
.. note::
|
||||
`current_gain` and `current_integrator_gain` are automatically set according to :code:`motor.config.current_control_bandwidth`
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
#,Label,GPIO_MODE_DIGITAL,GPIO_MODE_ANALOG_IN,GPIO_MODE_UART_A,GPIO_MODE_UART_B,GPIO_MODE_PWM,GPIO_MODE_CAN_A,GPIO_MODE_I2C_A,GPIO_MODE_ENC0,GPIO_MODE_ENC1,GPIO_MODE_MECH_BRAKE
|
||||
0,not a pin,,,,,,,,,,
|
||||
1,GPIO1 (+),general purpose,analog input,UART_A.TX,,PWM0.0,,,,,mechanical brake
|
||||
2,GPIO2 (+),general purpose,analog input,UART_A.RX,,PWM0.1,,,,,mechanical brake
|
||||
3,GPIO3,general purpose,analog input,,UART_B.TX,PWM0.2,,,,,mechanical brake
|
||||
4,GPIO4,general purpose,analog input,,UART_B.RX,PWM0.3,,,,,mechanical brake
|
||||
5,GPIO5,general purpose,analog input (*),,,,,,,,mechanical brake
|
||||
6,GPIO6 (*) (+),general purpose,,,,,,,,,mechanical brake
|
||||
7,GPIO7 (*) (+),general purpose,,,,,,,,,mechanical brake
|
||||
8,GPIO8 (*) (+),general purpose,,,,,,,,,mechanical brake
|
||||
9,M0.A,general purpose,,,,,,,ENC0.A,,
|
||||
10,M0.B,general purpose,,,,,,,ENC0.B,,
|
||||
11,M0.Z,general purpose,,,,,,,,,
|
||||
12,M1.A,general purpose,,,,,,I2C.SCL,,ENC1.A,
|
||||
13,M1.B,general purpose,,,,,,I2C.SDA,,ENC1.B,
|
||||
14,M1.Z,general purpose,,,,,,,,,
|
||||
15,not exposed,general purpose,,,,,CAN_A.RX,I2C.SCL,,,
|
||||
16,not exposed,general purpose,,,,,CAN_A.TX,I2C.SDA,,,
|
||||
1,GPIO1 (+),general purpose,analog input,**UART_A.TX**,,PWM0.0,,,,,mechanical brake
|
||||
2,GPIO2 (+),general purpose,analog input,**UART_A.RX**,,PWM0.1,,,,,mechanical brake
|
||||
3,GPIO3,general purpose,**analog input**,,**UART_B.TX**,PWM0.2,,,,,mechanical brake
|
||||
4,GPIO4,general purpose,**analog input**,,**UART_B.RX**,PWM0.3,,,,,mechanical brake
|
||||
5,GPIO5,general purpose,**analog input (*)**,,,,,,,,mechanical brake
|
||||
6,GPIO6 (*) (+),**general purpose**,,,,,,,,,mechanical brake
|
||||
7,GPIO7 (*) (+),**general purpose**,,,,,,,,,mechanical brake
|
||||
8,GPIO8 (*) (+),**general purpose**,,,,,,,,,mechanical brake
|
||||
9,M0.A,general purpose,,,,,,,**ENC0.A**,,
|
||||
10,M0.B,general purpose,,,,,,,**ENC0.B**,,
|
||||
11,M0.Z,**general purpose**,,,,,,,,,
|
||||
12,M1.A,general purpose,,,,,,I2C.SCL,,**ENC1.A**,
|
||||
13,M1.B,general purpose,,,,,,I2C.SDA,,**ENC1.B**,
|
||||
14,M1.Z,**general purpose**,,,,,,,,,
|
||||
15,not exposed,general purpose,,,,,**CAN_A.RX**,I2C.SCL,,,
|
||||
16,not exposed,general purpose,,,,,**CAN_A.TX**,I2C.SDA,,,
|
||||
|
@@ -248,7 +248,7 @@ Hopefully you got your motor to spin! Feel free to repeat all of the above for t
|
||||
PWM Input
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
If you want to drive your hoverboard wheels around with an RC remote control you can use the :ref:`RC PWM input <rc-pwm>`. There is more information in that link.
|
||||
If you want to drive your hoverboard wheels around with an RC remote control you can use the :ref:`RC PWM input <rc-pwm-doc>`. There is more information in that link.
|
||||
Lets use GPIO 3/4 for the velocity inputs so that we don't have to disable UART.
|
||||
Then let's map the full stick range of these inputs to some suitable velocity setpoint range.
|
||||
We also have to reboot to activate the PWM input.
|
||||
|
||||
@@ -3,11 +3,25 @@
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
.. include:: getting-started.rst
|
||||
================================================================================
|
||||
ODrive Documentation
|
||||
================================================================================
|
||||
|
||||
Welcome to the ODrive V3.6 documentation homepage!
|
||||
|
||||
This project strives to bring high performance motor control to makers, all of the source code is
|
||||
open source and available on github `here. <https://github.com/odriverobotics/ODrive>`__
|
||||
|
||||
.. note::
|
||||
|
||||
This documentation is specifically for V3.6, for ODrive Pro Beta click `here. <https://betadocs.odriverobotics.com/>`__
|
||||
|
||||
`ODrive Robotics homepage. <https://odriverobotics.com/>`__
|
||||
|
||||
Table of Contents
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
:maxdepth: 1
|
||||
:caption: General
|
||||
|
||||
@@ -22,7 +36,6 @@
|
||||
ground-loops
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
:maxdepth: 1
|
||||
:caption: Tutorials
|
||||
|
||||
@@ -32,7 +45,6 @@
|
||||
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
:maxdepth: 1
|
||||
:caption: Interfaces and Protocols
|
||||
|
||||
@@ -55,7 +67,6 @@
|
||||
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
:maxdepth: 1
|
||||
:caption: For ODrive Developers
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ ODrive v3.x Pinout
|
||||
.. ODrive v3.x
|
||||
.. --------------------------------------------------------------------------------
|
||||
|
||||
.. csv-table:: Table Title
|
||||
.. csv-table:: Pinout Table
|
||||
:file: figures/pinout.csv
|
||||
:header-rows: 1
|
||||
|
||||
@@ -30,7 +30,7 @@ Notes
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
* Changes to the pin configuration only take effect after :code:`odrv0.save_configuration()` and :code:`odrv0.reboot()`
|
||||
* Bold font marks the default configuration.
|
||||
* **Bold font** marks the default configuration.
|
||||
* If a GPIO is set to an unsupported mode it will be left uninitialized.
|
||||
* When setting a GPIO to a special purpose mode (e.g. :code:`GPIO_MODE_UART_A`) you must also enable the corresponding feature (e.g. :code:`<odrv>.config.enable_uart_a`).
|
||||
* Digital mode is a general purpose mode that can be used for these functions: step, dir, enable, encoder index, hall effect encoder, SPI encoder nCS.
|
||||
|
||||
Reference in New Issue
Block a user