Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The motor won't run in "Profiled_Position" mode when using "generic_ec_cia402_drive" #84

Open
ZorroStardust opened this issue Oct 12, 2023 · 5 comments

Comments

@ZorroStardust
Copy link

I have already successfully made the motor run in "Cyclic_sync_position" mode, which is the defaut mode. Now I'm trying to run in "Profiled_position" mode, so I wrote "1" in the xacro file, and the motor switched on in "Profiled_position" mode indeed. But when I run the command_publisher which send the target_position to the controller, the motor didn't move, I checked the target position of the motor and found that the value didn't change into the value I sent. This is the first question.

And the second question is that, we know that in "Profiled_position" mode, we need to write the control_word"0x1f" after writing a new target position to the motor to enable it, but I didn't find this process in the "generic_ec_cia402_drive", does it mean I need to modify the code ? If so, how am I suppose to do it?

@CaPlasberg
Copy link

Had the same issue. For now, I'm not happy with this proposed solution. Changing line 63/64 in generic_ec_cia402_drive.cpp helped:
pdo_channels_info_[index].override_command = false
This basically always writes the value of the position interface to the corresponding register, regardless of which mode you are using. Probably, adding the PROFILED_POSITION Mode to the exceptions to not overwrite the position value would also solve your problem.

@mcbed
Copy link
Member

mcbed commented Oct 31, 2023

Hi, the driver was in fact intended to work in cyclic sync mode, as it is the best suited mode for ros2_control. Any contribution to make it more generic is however welcome !

@ZorroStardust
Copy link
Author

I have already solved my problem, I was too naive that I thought the "generic_ec_cia402_drive" includes all mode of operation.
I later modified the code so that it could run in profiled_position mode. I will post my code here later. Thanks!

Hi, the driver was in fact intended to work in cyclic sync mode, as it is the best suited mode for ros2_control. Any contribution to make it more generic is however welcome !

@JensVanhooydonck
Copy link
Contributor

I have already solved my problem, I was too naive that I thought the "generic_ec_cia402_drive" includes all mode of operation. I later modified the code so that it could run in profiled_position mode. I will post my code here later. Thanks!

Hi, the driver was in fact intended to work in cyclic sync mode, as it is the best suited mode for ros2_control. Any contribution to make it more generic is however welcome !

Hi, can you post your solution?

@JensVanhooydonck
Copy link
Contributor

I've added a PR which adds a basic form of PP-mode. #95

This sets the New Target Position bit when receiving a new value in PP-mode. And also reset's this afterwards.

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

No branches or pull requests

4 participants