Position Control

Discussions regarding the Field Oriented Control (FOC) implementation on the VESC.
erwincoumans
Posts: 25
Joined: 16 Dec 2015, 02:16
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Position Control

Postby erwincoumans » 17 Feb 2016, 07:05


benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Position Control

Postby benjamin » 18 Feb 2016, 12:33

The current control loop also runs at half the switching frequency. The dead time has not much to do with the control loops, it is just a short delay that is inserted between swithcing off a high side FET and switching on a low side FET (or the other way) to prevent cross conduction. The DTc field in the FOC tab does not affect the dead time, but it adds a compensation to the modulated voltage calculation for the dead time effect, which helps the observer track better at low speeds (which is where dead time distortion has the largest effect).

erwincoumans
Posts: 25
Joined: 16 Dec 2015, 02:16
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Position Control

Postby erwincoumans » 18 Feb 2016, 16:28

Great, thanks for the reply. The maximum switching frequency allowed to enter in the bldc-tool GUI is 99.9 kHz, so that would imply the maximum current control loop is around 50kHz.

Is this a hard limit of the VESC, or would it be possible to increase the maximum switching frequency even further (say to 160 or 200 kHz)?
Thanks!
Erwin

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Position Control

Postby benjamin » 22 Feb 2016, 10:53

The 99 KHz limit is in BLDC Tool, but even running that fast might not work. Based on the computational requirements, it is currently possible to run at 120 KHz switching frequency (60 KHz for the control loops). However, driving the FETs that fast is not possible, and as far as I can tell it does not make sense to switch that fast. The system won't become more quiet after 40 KHz and the control loops are more than fast enough based on the motor time constants for most outrunners I have tested.

michael_wintergarden
Posts: 85
Joined: 10 Aug 2016, 16:14
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Position Control

Postby michael_wintergarden » 27 Aug 2016, 14:26

Hi guys,

where did the "VESC_encoder.bin" go? I want to do some position control but the file is no longer there as seen on the video at the first post...
I also can't find it on Github.

Thanks.

michael_wintergarden
Posts: 85
Joined: 10 Aug 2016, 16:14
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Position Control

Postby michael_wintergarden » 14 Sep 2016, 07:18

Hi,

what type of actual-value sensor-encoder do you use at 6:54 in your video of your first post?

kitewinder
Posts: 19
Joined: 29 May 2017, 20:47
Location: Bordeaux
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Position Control

Postby kitewinder » 02 Oct 2018, 12:26

Hi guys, just starting working on position control with VESC and hall sensor motor.

I try to control the VESC using arduino and UART and so far it's working pretty well with other command ( set speed, setcurrent brake, set duty ).

So I update the librairies like this :

added in VescUart.cpp

void VescUartSetPos(float pos) {
int32_t index = 0;
uint8_t payload[5];

payload[index++] = COMM_SET_POS;
buffer_append_int32(payload, (int32_t)(pos), &index);
PackSendPayload(payload, 5);
}

added in VescUart.h :

void VescUartSetPos (float pos);


then I just have to send the command on the arduino. Altough it worked ( the motor is positionning and holding with respect to PID setting ) , it only works for VescUartSetPos(0) ? I can put whatever number I want, the value is ignored and the motor is only positionning at 0° angle.

Does anyone can help on that issue ?

Olivier

pf26
Posts: 310
Joined: 28 Mar 2016, 14:37
Location: FR Valence
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Position Control

Postby pf26 » 03 Oct 2018, 12:49

Seems like an issue in float to int32 conversion ? I think you only cast your float as an int32 when you should convert the float value to an int value.
Something like : (int32_t)(pos * 1)... would be better probably.

kitewinder
Posts: 19
Joined: 29 May 2017, 20:47
Location: Bordeaux
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: Position Control

Postby kitewinder » 10 Oct 2018, 14:35

hello pf26. thnaks for the help and also for past helps ;) .

it does not works, tried with integer instead if fkoat, same effect. now I'm stuck .. Grrrrr :twisted: :evil:


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Return to “FOC”

Who is online

Users browsing this forum: No registered users and 1 guest