Skip to content

Advanced Motor Control - #15

Open
ParthivS20 wants to merge 9 commits into
fsm_integrationfrom
motor_adv
Open

Advanced Motor Control#15
ParthivS20 wants to merge 9 commits into
fsm_integrationfrom
motor_adv

Conversation

@ParthivS20

Copy link
Copy Markdown

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors motor command calculations by extracting them from FSMTask into a dedicated motor driver, introducing configurable max-current modes (steps or piecewise linear segments) and handling current ramping and rollover speed limiting. Feedback on the implementation highlights two issues with the pedal deadzone logic: in motor_get_pwr_current, checking the deadzone after scaling the pedal value artificially inflates the deadzone threshold and causes a sudden torque step; in motor_get_drive_current, exceeding the deadzone threshold results in a step discontinuity instead of a smooth transition. Both issues can be resolved by applying the deadzone directly to the raw pedal input and using a smooth linear mapping.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread Firmware/Drivers/Src/motor.c
Comment thread Firmware/Drivers/Src/motor.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants