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

TRQ_MODE overshooting. #455

Open
Blue186 opened this issue Dec 9, 2023 · 7 comments
Open

TRQ_MODE overshooting. #455

Blue186 opened this issue Dec 9, 2023 · 7 comments
Labels
question Further information is requested

Comments

@Blue186
Copy link

Blue186 commented Dec 9, 2023

Variant

USART

Control type

FOC

Control mode

None

Description

Hello, I have been trying to implement control mode switching through serial messages using SERIAL_START_FRAME. I observed that when in USART+FOC_CTRL+SPD_MODE/VLT_MODE, everything works fine, and the mode switch is successful. However, when attempting USART+FOC_CTRL+SPD_MODE/TRQ_MODE, after switching to TRQ_MODE, there are no errors, but when I slightly change command_in->steer or command_in->speed, the motor speed increases directly to the maximum.When I use the TRQ_MODE mode alone, the same issue occurs when combined with serial communication. I have tried reading through the code but haven't identified the issue. I would greatly appreciate your help if you could assist me in resolving this problem.

image
image

@Blue186 Blue186 added the question Further information is requested label Dec 9, 2023
@Candas1
Copy link
Collaborator

Candas1 commented Dec 10, 2023

Hi,

It's hard to follow you.
If it's happening with torque mode only, why share all the unrelated details about changing the mode?

This is how torque mode works without load.

Changing the mode is already covered with a different protocol if you read the wiki.

@Blue186
Copy link
Author

Blue186 commented Dec 11, 2023

Thanks a lot, yes I found it. I found through issues that the torque mode is not linear and not very adjustable, so can I control the input of the torque mode through PID? Calculate the speed difference of the controlled variable, then I can control the speed in the torque mode, so as to better adjust the torque? (Not FOC speed mode) I will try that later.

@Candas1
Copy link
Collaborator

Candas1 commented Dec 11, 2023

This project is unfinished but you might be able to use the protocol piece.

For the non linearity, I think it's more a scale problem, it's mentioned on those issues.

@Blue186
Copy link
Author

Blue186 commented Dec 11, 2023

Ok,thanks!
I'll try to adapt it.
In addition, I would like to ask, when I use a motor with a reduction ratio of 1:4.4 and 10 pole pairs, everything is normal when the motor rotates in the forward direction, but when it rotates in the reverse direction, it will stall and cannot start. ,what could be the problem? Of course, I also modified n_polePairs: 10 in the BLDC_controller_data.c file, and also tried to increase r_errInpTgtThres and t_errQual.

@Blue186
Copy link
Author

Blue186 commented Dec 11, 2023

Ok,thanks! I'll try to adapt it. In addition, I would like to ask, when I use a motor with a reduction ratio of 1:4.4 and 10 pole pairs, everything is normal when the motor rotates in the forward direction, but when it rotates in the reverse direction, it will stall and cannot start. ,what could be the problem? Of course, I also modified n_polePairs: 10 in the BLDC_controller_data.c file, and also tried to increase r_errInpTgtThres and t_errQual.

This happens from time to time.

@Candas1
Copy link
Collaborator

Candas1 commented Dec 11, 2023

Are the phases/halls correct ?

@Blue186
Copy link
Author

Blue186 commented Dec 11, 2023

Yes, correct. In the above situation, the motor gets stuck when it rotates reversely, and it needs a little external force to help it rotate normally. Once it rotates, everything is normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants