Commit Graph
675 Commits
Author SHA1 Message Date
Samuel Sadok 9155edfb17 Fix a numerical issue in the trajectory planner that could cause sudden jumps of the position setpoint.
If certain inputs were passed to trajectory planner, an expression inside the trajectory planner which is an argument to sqrtf() could become negative due to finite floating point accuracy.
This led to Vr_ == NaN and then Tf_ == 0, causing the trajectory to jump to the final setpoint instantaneously. To the user, this manifested as a sudden increase in velocity (limited by controller.config.vel_limit) and/or an overcurrent fault.

This bug was likely to show up when constantly sending trajectory setpoints while moving in the negative direction.

See also: https://discourse.odriverobotics.com/t/move-to-pos-not-works-well/4626
2020-05-06 19:25:39 +02:00
Samuel Sadok 484c5ab9da clarify comments 2020-05-06 11:23:46 +02:00
Unknown bf6d47f950 Add some missing reference & symbols 2020-05-05 21:37:47 -04:00
Unknown 7290e55525 Convert Axes to a std::array 2020-05-05 20:30:03 -04:00
Samuel Sadok 50ecdef860 move DC overcurrent/undercurrent checks to update_brake_current()
The checks now take into account the brake current.
Expose ibus on fibre.
2020-05-05 18:16:06 +02:00
Samuel Sadok 1dc420a76d various changes to update_brake_current:
- cleaner implementaiton of the overvoltage ramp with config variables separate from other functions
 - explicit enable flag for overvoltage ramp (disabled by default)
 - reinstate brake duty cycle NaN error
 - add informational flag for brake resistor saturation
2020-05-04 12:54:34 +02:00
Oskar Weigl edb6a1611c changed max brake duty to 95 pct 2020-05-01 17:11:47 -07:00
Oskar Weigl d002a74d24 rename psu current fault levels 2020-05-01 16:37:20 -07: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
Samuel Sadok f84ff36c74 only enable vbus_voltage clamping if dc_bus_overvoltage_trip_level > nominal_voltage 2020-04-30 11:44:14 +02:00
Samuel Sadok 4cfbb2c3e4 fix various issues with SPI encoder implementation
- Remove logic that would inhibit error detection until the first value is received. This logic posed a risk when no encoder is connected at all.
 - check error flag in AMS mode
 - Make CUI mode work. Only tested with emulated CUI encoder.
 - only go to ready-state if a successful value was received _and_ the offset was already pre-calibrated
 - enable pull-up on MISO so that a disconnected AMS encoder can be detected
 - update encoder documentation
2020-04-29 16:18:55 +02:00
Unknown 3d2d0f0e1a Clean up and modernize axis task_chain 2020-04-27 15:27:43 -04:00
Unknown 659bcaaa2c Merge branch 'RazorsFrozenTesting' into RazorsEdge 2020-04-27 12:49:46 -04:00
Samuel Sadok 8cd673363c Reboot on erase_configuration().
This avoids unexpected behavior of a subsequent `save_configuration()`
call, since the configuration is only erased from NVM, not from RAM.
2020-04-27 15:19:32 +02:00
Unknown baa6e4b5dc Set default configuration of endstops to configuration 4 2020-04-26 00:25:19 -04:00
Unknown 9ef3d0c6a1 Store the result of get_inverter_temp to a member variable 2020-04-25 22:38:53 -04:00
Samuel Sadok c45ef8934b Change wrap_pm to be based on fmodf
Before this commit, bad user input could cause the device to hang,
that is, no longer respond on USB (other side effects are likely,
though not tested for).

An example of such an input is:

odrv0.axis0.encoder.config.cpr = 10
odrv0.axis0.encoder.config.offset = 20000
2020-04-23 14:38:50 +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
Samuel Sadok 237a50bfc9 add step/dir input tests 2020-04-21 15:57:26 +02:00
Unknown e6f95d4d47 Make sin/cos encoder pins configurable. 2020-04-09 18:53:53 -04:00
Samuel Sadok 37c4fe337a allow configuring motor parameters without reboot 2020-04-08 16:26:15 +02:00
Samuel Sadok 746e142fc2 fix encoder direction find procedure 2020-04-08 16:25:29 +02:00
Unknown 8a7a5aac4d Remove VBUS_OVERVOLTAGE_LEVEL because it's not being used 2020-03-29 21:10:38 -04:00
Unknown db890b0d5c Use brake_current as a true FF 2020-03-28 00:58:32 -04:00
Unknown 163ce7d21a Change Interval to Increment 2020-03-28 00:50:44 -04:00
Unknown a8d47894ca Add additional test types and fix missing template argument 2020-03-28 00:40:00 -04:00
Unknown f5f9514bfc Fix comment 2020-03-28 00:20:28 -04:00
Unknown 128ae3935c Make Timer generic, add comments 2020-03-28 00:15:21 -04:00
Unknown 31fb65b86c Improve braking logic 2020-03-27 21:30:32 -04:00
Unknown c231928619 Merge branch 'feature/brake_current_fix' into RazorsFrozenTesting 2020-03-27 21:24:49 -04:00
Unknown fb46103498 Add doctest, fix drv8301 warning 2020-03-27 21:22:04 -04:00
Unknown 8a0a22eb6f Revamp Endstop timers 2020-03-27 21:11:39 -04:00
Unknown 33317eb4df Add Timer class 2020-03-27 21:05:27 -04:00
Unknown cb534ae372 Move gpio helper functions 2020-03-27 21:05:16 -04:00
Unknown 42b6effedd Implement a better brake resistor current handler 2020-03-26 17:20:32 -04:00
Unknown 7d00c4181d revert timer overflow check 2020-03-09 21:16:43 -04:00
Unknown 17bcb43dd6 Improve debounce resolution 2020-03-09 21:15:45 -04:00
Unknown a498a1f984 Convert endstop debounce_ms to a uint32 to avoid potential overflow bug 2020-03-09 21:08:49 -04:00
Unknown f9b4c78667 Merge remote-tracking branch 'madcowswe/devel' into RazorsEdge 2020-01-30 21:30:34 -05:00
Oskar Weigl d60362470d Merge branch 'devel' into rollo 2020-01-30 16:16:48 -08:00
Oskar Weigl 8cbc09e168 feed watchdog on enter closed loop 2020-01-30 16:16:39 -08:00
Paul Guenette c5f06845c2 Allow for regen current before braking 2020-01-30 12:36:51 -08:00
Unknown 930de28de9 Clean up static analysis warnings 2020-01-08 22:59:57 -05:00
Unknown 1bdea53ec8 Improve testability 2020-01-08 22:11:50 -05:00
Unknown 75808abce4 Fix merge issue with ACIM code 2020-01-01 22:13:44 -05:00
Unknown 37ee8ae184 Fix compile errors 2020-01-01 22:13:08 -05:00
Unknown 7a756c1761 Merge branch 'devel' into RazorsEdge 2020-01-01 21:45:41 -05:00
Unknown 62654ed966 Fix avoid transients at startup 2020-01-01 21:38:17 -05:00
Unknown 4ee55aaed4 Only configure encoder SPI at startup 2020-01-01 21:37:55 -05:00