Hi everyone
for a personal project I need more features via UAVCAN protocol:
- position, velocity and torque control
- status message supplying position, velocity and torque information
- "position limits" such that the vesc will not go beyond a certain rotational positon (throw a fault and disable beyond this position), this is rather ment as a safety feature for servo application
- "homing" of the vesc, such that a mechanichal "zero position" can be set and any positon control setpoints / position limits can be expressed with respect to zero position
- fault code propagation over uavcan, such that, if one vesc in the network faults, it will publish the fault code on the uavcan network and other vescs will fault as well, this is also ment as a safety feature for servo applications
For these changes, I use the uavcan v0 side on the vesc firmware to accept the following messages:
- uavcan/equipment/actuator/1010.ArrayCommand.uavcan
- uavcan/equiptment/actuator/1011.Status.uavcan
- uavcan/protocol/5.Panic.uavcan
- uavcan/equipment/actuator/1013.SetLimits.uavcan (not standard in uavcan v0, for simplicity used here anyways)
I have added the following parameters to the mc_configuration:
- bool si_use_mech_limits
- float si_mech_offset
- float si_mech_pose_limit_max
- float si_mech_pose_limit_min
And in app_configuration:
- bool uavcan_fault_on_panic: vesc faults if uavcan panic is received
To achieve the mechanical end stopps etc. I have added some functionality to mc_interface.h/c
- FAULT_CODE_ABS_MECH_POS_REACHED is triggered when mechanical limits are reached
- mc_interface_reset_home() will set the si_mech_offset to the current position
- mc_interface_set_home_offset(float) will set si_mech_offset to a given position
- mc_interface_get_mech_rpm() returns the actual mechanical rotational velocity
- mc_interface_set_pid_mech_speed() sets rotational velocity pid setpoint (similar to already present function for pid pos)
- I have updated the xml in the gui tool as well and it transmits configs properly for me (based on config 4.02). However, this is probably something that has to go with minor release cycle anyways and incorporated into the gui tool
I have tested the code with the AS5047 encoder and official VESC6 hardware. The build_all script compiles fine
Is anyone interested in UAVCAN v1 since UAVCAN v0 is officially legacy? Is anyone interested in more UAVCAN v0 features?
I also plan to publish some example c++ code (libuavcan) or even a complete ROS2 module for using the these messages with the vesc.
I will make a pull request for firmware and gui-tool (xml) upon approval here...
Best
Henrik
Does anyone have a solution to this problem? !!!
8 ball pool