You are here

Positional Control, Hall Sensor

5 posts / 0 new
Last post
wdaehn
Offline
Last seen: 3 years 2 months ago
Joined: 2017-09-12 17:26
Posts: 65
Positional Control, Hall Sensor

I can't wrap my head around the current situation - do you have an idea? FOC with Hall Sensor, LRP Dynamic 8 1600kv Inrunner motor.

I have set KI and KD to zero for positional control and KP to the lowest value possible 0.001. With that the motor is not moving but its holding force is low. But as soon as I increase the values just a little, it start to vibrate significantly. With KD the expected high frequency movement, with KP a low frequency but high amplitude. And when I set KP and KI to 0.001 it holds fine but when turning the motor manually over 30° it starts to spin at max speed.

At the moment I am lost. How should positional control even work with a PID loop when the Hall Sensor resolution is so low? 

wdaehn
Offline
Last seen: 3 years 2 months ago
Joined: 2017-09-12 17:26
Posts: 65

From the Vesc Tool, how do I use

COMM_SET_POS

versus

COMM_SET_SERVO_POS

?

The first is the angle setting in the control box left bottom, isn't it? But how do I use the second?

Or in other words, would it work to send the RPM Speed of zero and then use the servo pos command to hold the position until a speed command is sent again? To simulate a solid handbrake?

 

benjamin
Offline
Last seen: 5 days 14 hours ago
VESC FreeVESC OriginalVESC Platinum
Joined: 2016-12-26 15:20
Posts: 490

The SET_SERVO_POS command is for setting the position of a PWM controlled RC servo with the servo_out firmware. The SET_POS command should work for holding a position as a handbrake.

wdaehn
Offline
Last seen: 3 years 2 months ago
Joined: 2017-09-12 17:26
Posts: 65

Okay. But then I can't get the Positional PID to work, as said.

wdaehn
Offline
Last seen: 3 years 2 months ago
Joined: 2017-09-12 17:26
Posts: 65

I assume I found the answer in the code: No encoder - no FOC position control. Makes sense.

/**
 * Use PID position control. Note that this only works when encoder support is enabled.
 *
 * @param pos
 * The desired position of the motor in degrees.
 */
void mcpwm_foc_set_pid_pos(float pos) {

https://github.com/vedderb/bldc/blob/master/mcpwm_foc.c