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

Issue with trajectory_angular_displacement using Pico-SDK and cpp Module #11

Open
siddharth-mandaliya opened this issue Jan 16, 2024 · 0 comments

Comments

@siddharth-mandaliya
Copy link


Description:
I am currently working on a project involving the use of the cpp module on rpi-pico to control the Vertiq 23-06 220kv motor for a gimbal application. I have encountered an issue with the smoothness of the motor movement using two different approaches, and I am seeking assistance to resolve it.

Issue with Code-1:
I initially used the following code (Code-1) with the pico-sdk, and while it functions properly, there is an undesirable jerk when the motor starts moving. angleRadian is a float type variable.

surface_ctrl.ctrl_angle_.set(com, angleRadian);

Issue with Code-2:
To address the jerkiness, I implemented a second method (Code-2) that provides a smoother trajectory using the following commands:

surface_ctrl.trajectory_angular_displacement_.set(com, 3.14f);
surface_ctrl.trajectory_duration_.set(com, 2.0f);

However, when attempting to use Code-2 with the pico-sdk and cpp module, the rpi-pico crashes, and no output is observed on the serial monitor. It's important to note that I am specifically interested in using pico-sdk with the cpp library, not the Arduino adaptation, as other connected devices perform better with direct cpp and pico-sdk integration.

Request for Assistance:
I seek guidance on how to prevent the crash when using trajectory_angular_displacement or alternative approaches to ensure a smooth trajectory without jerky motor movements. Given that the motor is intended for a gimbal application, where small angle changes are crucial, achieving smooth operation is paramount.

Additional Information:

  • I have already attempted to break down large movements into multiple small angles, but this did not result in the desired smoothness.
  • I successfully replicated the smooth trajectory (code-2) using the Arduino IDE and the IQ-Module headers for Arduino but encountered issues when attempting the equivalent with pico-sdk.

Any insights or recommendations on optimizing the code for smooth motor control in both directions would be greatly appreciated.

Thank you in advance for your assistance.

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

1 participant