Commit Graph

124 Commits

Author SHA1 Message Date
Samuel Sadok
c32cbec58c rename some of the new functions and variables 2020-11-16 21:03:23 +01:00
Samuel Sadok
1f7815459f Merge branch 'devel' into control-loop-refactor 2020-11-03 18:34:08 +01:00
Paul Guenette
a428d08ecd Merge branch 'timing' into devel_fast 2020-10-30 21:26:31 -04:00
Samuel Sadok
7fd0806d49 introduce InputPort and OutputPort, don't use NAN
The InputPort/OutputPort infrastructure facilitates safer
data paths between components: OutputPorts store a value
and the age of the value measured in number of control loop
iterations. InputPorts can be connected to various sources,
for instance an OutputPort. InputPorts expose the values to
consumers in the form of std::optional to reflect the fact
that an InputPort can be dangling or connected to a stale
OutputPort.
2020-09-23 16:20:21 +02:00
Oskar Weigl
fb7d1d2961 change fabsf to std abs 2020-09-04 18:27:14 -07:00
Oskar Weigl
54636c764f implement faster fmodf related functions 2020-09-03 20:03:10 -07:00
Samuel Sadok
5661a3b5ed Refactor control loop.
Please see https://github.com/madcowswe/ODrive/issues/472 for a detailed description.
2020-09-01 00:03:01 +02:00
Unknown
2bb990937a Add TaskTimer class 2020-08-25 21:40:24 -04:00
Samuel Sadok
8d144bd944 Merge branch 'devel' into lowlevel-refactor 2020-08-05 16:28:17 +02:00
PAJohnson
8fcd5e1b30 Merge branch 'devel' of https://github.com/madcowswe/ODrive into counts_to_rads
Merge devel into counts_to_rads (turns) - conflict for the step input callback
2020-07-27 21:36:00 -04:00
PAJohnson
be2d1037e3 Fixed null pointer checks in controller.cpp
Fixed formatting in trapTraj.hpp
Fixed how pos_setpoint is set in axis.cpp to avoid transients on startup so that it will handle circular position setpoints
More unit corrections in the docs: radians -> turns
2020-07-27 21:26:41 -04:00
Unknown
88b3ed4260 Optimize step/dir callback 2020-07-26 16:16:10 -04:00
Oskar Weigl
97469235d7 Add _src to estimate pointers 2020-07-25 20:24:55 -07:00
Samuel Sadok
938f088fc2 make axis allocation static 2020-07-21 13:02:03 +02:00
PAJohnson
e1b1641d70 Changed from radians internally to units of "turns" where a full rotation is 1.0 turn
Changed documentation to reflect the unit change
2020-07-14 20:02:59 -04:00
PAJohnson
a2626889c5 Added pos_circular_ to Encoder for tracking position in a circular space
Corrected docs as they relate to unit changes
Added pos_estimate_linear and pos_estimate_circular to Controller and eliminated pointer switching logic in Controller::select_encoder()
2020-07-14 17:22:39 -04:00
PAJohnson
9d5b2bc6d8 Changed conditions and sources of wrapping for the circular setpoint feature as it related to this unit change. setpoints_in_cpr is still not exposed as an endpoint due to implementation changes when input_mode was introduced. 2020-07-13 23:31:57 +01:00
PAJohnson
aa79b7ebe0 Merge branch 'counts_to_rads' of https://github.com/madcowswe/ODrive into counts_to_rads 2020-07-13 21:05:41 +01:00
PAJohnson
7ce896c2ce In encoder.*pp, XXX_estimate -> XXX_estimate_counts and XXX_est_rad -> XXX_estimate.
Changed HWIL tests to reflect unit change
Corrected sources for position and velocity estimates elsewhere.
2020-07-13 20:59:35 +01:00
Oskar Weigl
4b01f54afb Revert "Un-removed custom setter for input_pos_"
This reverts commit 744bfeb110.
2020-07-11 15:43:07 -07:00
PAJohnson
744bfeb110 Un-removed custom setter for input_pos_
removed explicit casts where variables would be promoted anyway
2020-06-26 19:48:21 +01:00
PAJohnson
9faf46ad47 Changed from counts->radians internally. By default, input positions and velocities are also in radians.
Added multipliers for input pos/vel to allow users to define their own units for those inputs.
2020-06-25 21:39:20 +01:00
PAJohnson
98e9d730f4 Added "shadow" variables for counts_to_rads. Controller::update() tested and working with radian inputs. 2020-06-24 21:40:10 +01:00
pjohnson
a9b1841092 Added Motor::max_available_torque(). Use is to correctly determine torque limit for velocity anti-windup.
Set default value (0.0) for current_setpoint
Units documentation
Removed unused variable thermal_torque_lim_
2020-06-18 13:11:41 -04:00
pjohnson
ceabd24582 Made changes reflecting PR comments.
Added torque_ramp_rate to controller config.
Changed INPUT_MODE_CURRENT_RAMP to INPUT_MODE_TORQUE_RAMP for controller input mode enum.
Torque limits and current limits are now observed seperately. Torque limit is in the controller, current limit is in the motor object.
Fixed torque -> current calculation in motor_update to handle ACIM motors.
2020-06-17 13:15:36 -04:00
pjohnson
d78119e29f Modified docs and communication interfaces to reflect change from A to Nm for motor control input.
Renamed vel_integrator_current_ to vel_integrator_torque_
Removed input_current_ from controller, added input_torque_
2020-06-16 17:10:36 -04:00
pjohnson
e2527ec468 added torque_constant to motor config struct and interface file
changed all instances of current_setpoint to torque_setpoint
modified limitVel() to use torque instead of current units
removed effective_current_lim, added effective_torque_lim()
added torque_lim to motor config struct and interface file
2020-06-16 15:55:18 -04:00
Samuel Sadok
653c4c327e Merge remote-tracking branch 'origin/devel' into feature/interface_autogen_merged 2020-05-22 21:27:58 +02:00
Samuel Sadok
b3912d58c2 revert numerical static_cast to C style casts
As per https://github.com/madcowswe/ODrive/pull/410#discussion_r427725994
2020-05-20 13:26:14 +02:00
Samuel Sadok
3d07325022 remove aligned formatting of assignments 2020-05-20 12:27:28 +02:00
Samuel Sadok
da7f719283 improve naming consistency between code and fibre
Consistent naming makes code autogeneration easier.
This commit does not claim that the exported names of the variables were
more sensible than the in-code names. However changing the exported
names can break external tools and needs to happen in a controlled and
documented way.
2020-05-14 11:16:32 +02:00
Unknown
6863507570 Use std::clamp instead of manual clamping in some spots 2020-05-07 18:04:27 -04:00
Samuel Sadok
90f5c1d0b1 change velocity clamping in input filter mode
as per: https://discordapp.com/channels/369667319280173067/369678934985408524/705227337230188595
2020-05-01 16:32:09 +02:00
Unknown
a5d991e712 Clarify current_setpoint calculation 2020-04-21 20:39:39 -04:00
Unknown
574190e433 Change trap_traj timer to be more robust 2020-04-21 20:39:10 -04:00
Unknown
75808abce4 Fix merge issue with ACIM code 2020-01-01 22:13:44 -05:00
Unknown
7a756c1761 Merge branch 'devel' into RazorsEdge 2020-01-01 21:45:41 -05:00
Oskar Weigl
2a22602e82 add dirty fix for setpoint in cpr 2019-11-02 14:05:22 -07:00
Oskar Weigl
27add54b3f move vel_ramp_enable into controller.config 2019-10-07 16:19:30 -07:00
Samuel Sadok
82e8cd64fb cosmetic changes 2019-09-27 18:01:38 +02:00
Unknown
0153e3509a Fix anticogging 2019-09-24 21:32:50 -04:00
Samuel Sadok
f8ea7d5684 [homing] make separate control mode
[endstops] enable in all control modes
[load encoder] use load encoder more consequently
2019-09-23 12:23:27 +02:00
Oskar Weigl
4015ed09dd add ACIM autoflux 2019-09-23 00:07:45 -07:00
Oskar Weigl
c8c6f6237c finish implementing basic ACIM control 2019-09-22 23:27:40 -07:00
Unknown
9e782cce7b Revert "Formatting pass"
This reverts commit 2b58d15d8d.
2019-09-15 01:15:51 -04:00
Unknown
3f4433f50d Enable rudimentary dual-encoder support 2019-09-01 17:02:15 -04:00
Unknown
e9c8eb6c03 Add mirror_ratio 2019-08-31 19:20:47 -04:00
Unknown
f4e2c3d286 Add mirror mode 2019-08-31 18:03:00 -04:00
Unknown
5df4ceda33 Add current ramping input mode 2019-08-31 17:41:32 -04:00
Unknown
2e3768c329 Start moving casts and math functions to std:: 2019-08-25 17:13:10 -04:00