mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-21 06:23:07 +08:00
Merge branch 'devel' into liveplotter
This commit is contained in:
@@ -35,7 +35,7 @@ float vbus_voltage = 12.0f;
|
||||
|
||||
// TODO stick parameter into struct
|
||||
#define ENCODER_CPR (2048 * 4) // Default resolution of CUI-AMT102 encoder
|
||||
#define POLE_PAIRS 7
|
||||
#define POLE_PAIRS 7 // This value is correct for N5065 motors and Turnigy SK3 series.
|
||||
const float elec_rad_per_enc = POLE_PAIRS * 2 * M_PI * (1.0f / (float)ENCODER_CPR);
|
||||
|
||||
#if HW_VERSION_MAJOR == 3
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ It may be helpful to know that the entry point of each of the motor threads is `
|
||||
### Mandatory parameters
|
||||
You must set:
|
||||
* `ENCODER_CPR`: Encoder Count Per Revolution (CPR). This is 4x the Pulse Per Revolution (PPR) value.
|
||||
* `POLE_PAIRS`: This is the number of magnet poles in the rotor, divided by two. You can simply count the number of magnets in the rotor, if you can see them.
|
||||
* `POLE_PAIRS`: This is the number of magnet poles in the rotor, **divided by two**. You can simply count the number of permanent magnets in the rotor, if you can see them. Note: this is not the same as the number of coils in the stator.
|
||||
* `brake_resistance`: This is the resistance of the brake resistor. If you are not using it, you may set it to 0.0f.
|
||||
* `motor_type`: This is the type of motor being used. Currently two types of motors are supported -- High-current motors (`MOTOR_TYPE_HIGH_CURRENT`) and Gimbal motors (`MOTOR_TYPE_GIMBAL`).
|
||||
|
||||
|
||||
@@ -43,8 +43,9 @@ Baud rate: 115200
|
||||
Pinout:
|
||||
* GPIO 1: Tx (connect to Rx of other device)
|
||||
* GPIO 2: Rx (connect to Tx of other device)
|
||||
* GND: you must connect the grounds of the devices together. Use any GND pin on J3 of the ODrive.
|
||||
|
||||
To enable UART mode for the GPIO, please see [Setting the GPIO mode](Firmware/README.md#configuring-parameters).
|
||||
To enable UART mode for the GPIO, please see [Setting the GPIO mode](Firmware/README.md#communication-configuration).
|
||||
|
||||
### Setting up Step/Direction
|
||||
Pinout:
|
||||
@@ -52,11 +53,12 @@ Pinout:
|
||||
* GPIO 2: M0 dir
|
||||
* GPIO 3: M1 step
|
||||
* GPIO 4: M1 dir
|
||||
* GND: you must connect the grounds of the devices together. Use any GND pin on J3 of the ODrive.
|
||||
|
||||
Please note that GPIO_3 and GPIO_4 are NOT 5v tolerant on ODrive v3.2 and earlier, so 3.3V signals only!
|
||||
ODrive v3.3 and onward have 5V tolerant GPIO pins.
|
||||
|
||||
To enable step/dir mode for the GPIO, please see [Setting the GPIO mode](Firmware/README.md#configuring-parameters).
|
||||
To enable step/dir mode for the GPIO, please see [Setting the GPIO mode](Firmware/README.md#communication-configuration).
|
||||
|
||||
There is also a new config variable called `counts_per_step`, which specifies how many encoder counts a "step" corresponds to. It can be any floating point value.
|
||||
The maximum step rate is pending tests, but it should handle at least 16kHz. If you want's to test it, please be aware that the failure mode on too high step rates is expected to be that the motors shuts down and coasts.
|
||||
|
||||
@@ -33,7 +33,7 @@ if (args.verbose):
|
||||
printer = print
|
||||
else:
|
||||
printer = lambda x: None
|
||||
|
||||
printer = print
|
||||
|
||||
# Connect to device
|
||||
if not args.usb is None:
|
||||
|
||||
@@ -252,7 +252,7 @@ def find_dev_serial_ports(search_regex):
|
||||
return []
|
||||
|
||||
def find_pyserial_ports():
|
||||
return [x.name for x in serial.tools.list_ports.comports()]
|
||||
return [x.device for x in serial.tools.list_ports.comports()]
|
||||
|
||||
def find_serial_channels(printer=noprint):
|
||||
"""
|
||||
@@ -270,11 +270,7 @@ def find_serial_channels(printer=noprint):
|
||||
macos_usb_serial_ports = find_dev_serial_ports(r'^tty\.usbmodem')
|
||||
|
||||
for port in real_serial_ports + linux_usb_serial_ports + macos_usb_serial_ports:
|
||||
try:
|
||||
yield channel_from_serial_port(port, 115200, False, printer)
|
||||
except serial.serialutil.SerialException:
|
||||
printer("could not open " + port)
|
||||
continue
|
||||
yield channel_from_serial_port(port, 115200, False, printer)
|
||||
|
||||
|
||||
def find_all(consider_usb=True, consider_serial=False, printer=noprint):
|
||||
|
||||
Reference in New Issue
Block a user