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

Feature Request- Position Control #30

Open
h2omatt opened this issue Aug 17, 2021 · 1 comment
Open

Feature Request- Position Control #30

h2omatt opened this issue Aug 17, 2021 · 1 comment

Comments

@h2omatt
Copy link

h2omatt commented Aug 17, 2021

I'm trying to something a bit different with the VESC. I want to try to use it like a servo drive and be able to do positional control. The motor I'm using has hall sensors and the VESC performs very well at slow speed because of the hall sensor feedback.

My goal is to do position hold but with current limiting. if the torque is higher than the current limit the motor will "slip" and the reset its new position its position hold.

I had previously wrote you asking about speed control using current input. I got this working very well using a PID loop on my Arduino to modulate setCurrent based on UART.data.rpm. This makes me think I can do the same thing for a position hold. User would enter the max current force allowed. then the motor will try to maintain that position unless a greater force is applied causing it to "slip" the reset it will reset is new position as "zero". I will probably have some deadband error range for the position hold so that it only resets home when a major slip even happens.

what's your thoughts? Is there an easier way to do this built into the VESC using maybe one of the two following commands?

case COMM_SET_POS:
	ind = 0;
	mc_interface_set_pid_pos((float)buffer_get_int32(data, &ind) / 1000000.0);
	timeout_reset();
	break;

case COMM_SET_HANDBRAKE:
	ind = 0;
	mc_interface_set_handbrake(buffer_get_float32(data, 1e3, &ind));
	timeout_reset();
	break;
@h2omatt h2omatt changed the title Feature Request Feature Request- Position Control Aug 17, 2021
@WackoKacko
Copy link

I'm actually trying to do something similar.

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

2 participants