- add DM_Feedforward_Init_Config_s with Kp and dir fields
- replace plain DM_Feedforward_Kp in DM_Motor_Init_Config_s
- apply direction flag in DMMotorControl to negate feedforward when reverse
- set yaw feedforward: Kp=0.9, dir=REVERSE
- host 0xA9 frame → master_machine decode → robot_cmd publish
via gimbal_feedforward topic → gimbal subscribe → yaw_motor.feed_input
- add DM_Feedforward_Controller_s with Kp and feed_input fields
- add feedforward term (Kp * feed_input) to motor control output
- add DM_Feedforward_Kp to motor init config
Change 0xA5 frame from 2-float (error_x, error_y) to 4-float
(measure_x, ref_x, measure_y, ref_y) so PIDCalculate receives
actual measurement and reference values internally computing error.
- Vision PID: increase Kp to 100, zero Ki/Kd, tighten CoefA/B
- Gimbal angle PID: reduce to P-only (Kp=1), lower IntegralLimit,
remove derivative/output filters, unify MaxOut to 2000
- Manual mode: hold last velocity command on lost frames instead of
stopping
- Debug mode: reset debug_updated flag on mode switch
- Remove stale .vscode settings copy
Manual mode now receives angular velocity (degrees/s) via 0xA6 frame instead of
absolute angle reference. The firmware integrates velocity * dt into gimbal angle ref.
Motors are no longer auto-enabled at DMMotorInit — they stay disabled until a mode
switch out of DEBUG. Extract ROBOT_CMD_DELAY macro to replace magic number.
Fix "volity" typo → "velocity" and update docs/protocol comments accordingly.
- Add .dma_buf section in RAM_D1 for DMA-accessible USART instance pool.
DTCM (0x20000000) is not reachable by DMA on STM32H7, causing bus errors
(TE) when DMA writes to malloc'd buffers placed in DTCM by the XG linker
script.
- Replace malloc with static pool (usart_pool[]) placed in .dma_buf section.
- In RxEventCallback, set recv_buff_size from Size so module callbacks know
how many bytes were actually received.
- Use USART_RXBUFF_LIMIT (256) as the DMA transfer size instead of per-module
recv_buff_size. The actual buffer is always 256 bytes.
- Remove recv_buff_size from USART_Init_Config_s; it is now set at runtime.
- Flush RDR, clear error flags, and clear stale DMAR in error callback to
prevent residual conditions from re-triggering errors on DMA restart.
- Switch Vision module from UART10 to UART1.
Replace compile-time orientation enum/macro approach with a general
3x3 rotation matrix IMU2BODY_ROTATION. User fills in the matrix
according to actual IMU mounting orientation. Matrix must be a proper
rotation (det = +1) to preserve right-handed coordinate system.
Support NORMAL, YAW_180, ROLL_180, PITCH_180 presets selected at compile
time by IMU_MOUNT_ORIENTATION macro. Replaces direct BMI088-to-INS
assignment with IMU_Mount_Correct() for sign flip and axis swap.
- Add DEBUG mode (parallel to AUTO/MANUAL) for real-time PID parameter tuning
- New 0xA8 debug frame: 12 floats for vision/motor angle PID tuning params
- DMMotorSetMode: send zero-velocity before disable, clear PID to prevent jumps
- motor_enable topic: pub from robot_cmd, sub in gimbal, controls motor on/off
- motor_pid topic: pub from robot_cmd, sub in gimbal, updates motor angle PID
- Rename DM motor enums (DM_CMD_ENABLE_MODE/DISABLE_MODE, DM_Motor_Ctrl_Mode_e)
- SwitchToAuto/Manual: re-enable motors when switching back from DEBUG mode
- Static-allocate enable_msg/pid_tune in GimbalTask to avoid stack churn
- Add docs/host_comm_guide.md with Python Tkinter tuning GUI example
- Remove ARCHITECTURE.md
- DM motor send functions now fill txconf.Identifier from tx_id before CANTransmit
(MIT=tid, PosVel=tid+0x100, Velocity=tid+0x200, SetMode=tid)
- Enable motor task with stack size 1024 1000Hz
- Increase FDCAN1 StdFiltersNbr from 1 to 14
- Comment out INS temperature log, DM error handling and PID for testing
- Remove test_robot_cmd.c
- Replace osThreadDef/osThreadCreate/osThread with osThreadNew/osThreadAttr_t
- Replace osSignalWait with osThreadFlagsWait
- Change osThreadId to osThreadId_t, osPriority to osPriority_t
- Increase daemon task stack from 128 to 512 to fix stack overflow HardFault
- Cast BMI088.Temperature float to int before %d format to fix va_list misalignment
The old approach used memcpy to copy PID_Init_Config_s into PIDInstance,
relying on identical struct layout at the beginning. This is fragile and
confusing. Now assigns each field explicitly.
- Remove RC_ctrl_t and RemoteControlInit from robot_cmd.c
- Delete GIMBAL_ZERO_FORCE, gimbal_mode_e, Robot_Status_e from robot_def.h
- Remove EmergencyHandler and robot_state from robot_cmd.c
- Remove emergency commands from master_machine.h
- Remove remote_control and can_comm from CMakeLists.txt
UpdateCount was only used as a first-time-initialization flag for the
accel low-pass filter, not as a real counter. Replaced with a simple
uint8_t flag and moved the set to the first-update path.