You are here

Setting PI / PID controllers in VESC for very low speeds. For CNC

10 posts / 0 new
Last post
K@RLSON
Offline
Last seen: 3 years 11 months ago
Joined: 2019-11-09 10:08
Posts: 3
Setting PI / PID controllers in VESC for very low speeds. For CNC

I want to apply VESC as a servo controller for a CNC machine. I am sure that many people have already done this.

But I need to control the speed of the servo motor. Because I want to control the position above the level in the brain of the CNC machine.

My problem is that I can’t get the “perfect” speed control at very low speeds. From 1-2 rpm (30-60 ERPM). There are constant fluctuations, which are small in value, but large in% of the assignment (tens of percent).

The controller has a lot of PID controllers and some factors are not very clear to me.

I have a motor + ABI encoder (2500 cpr / 10 '000 ppr)

On the FOC tab. There are 2 PI controls.

1.On the general tab (Current KI, Current KP).

2.1 On the Advanced tab (Speed ​​Tracker Kp, Speed ​​Tracker Ki)

2.2 Odds Current Injection Duty, Factor

Tab: PID controllers.

Speed ​​PID Kd Filer

Does everyone affect the quality of speed control? (I configured everything except Current KI, KP).

Tell me where to read on the fine tuning of very low speeds to reduce oscillations?

Or what effect do the above regulators with coefficients have on speed control?

Sorry for my English

pf26
Offline
Last seen: 5 days 18 hours ago
VESC FreeVESC Silver
Joined: 2018-12-04 08:44
Posts: 53

Did you try running at low speed using dutycycle mode (just to check everything is fine hardware wise) ?  Then, in speedControl mode, I think you need to play with Speed trackers KP and KI..  Ideally, having more ERPM for the same job (ie: gearing) would make it easier, provided you still could reach the max velocity your wish.

 

K@RLSON
Offline
Last seen: 3 years 11 months ago
Joined: 2019-11-09 10:08
Posts: 3

 

Unfortunately, I did not understand how to insert a picture. I configured the PID using the PID controller tab. Speed ​​mode. As a result, I get + -1 ERPM with a low emission frequency. In duty mode it works much softer, but also constant oscillations

K@RLSON
Offline
Last seen: 3 years 11 months ago
Joined: 2019-11-09 10:08
Posts: 3
But I clearly hear the unevenness of the sound of increasing current in the windings. What the DUTY mode clearly demonstrates
cchart
Offline
Last seen: 3 years 6 months ago
Joined: 2018-12-07 15:34
Posts: 2

I'm also trying to use FOC at low ERPM. The VESC6 MkIII is capable of low torque rotation at very low duty cycle, but I thought my motor was stuck with a minimum of 900 ERPM, which was frustrating. I will be tuning the PID first thing tomorrow thanks to this thread.

no time like the present

medocco1985
Offline
Last seen: 3 years 6 months ago
Joined: 2020-11-02 08:08
Posts: 2

Hi all, I'm new to the forum.
I've been playing with the VESC recently and I love the product!
I have an issue though that maybe someone can help me with:
I'm trying to run my motor at very low speed. I need a position control with very high torque, but a speed control with high torque at low speed will work fine. My motor is a prototype motor hence I don't have hall sensors, and I am trying to control it with FOC - duty cycle. 

My problem: at very low speeds (duty cycles <10%) the motor is coughing and has very little torque.
This is strange to me because when I run the detection of the hall sensors (which I don't have), the motor is rotated very slowly and the torque it generates is quite high! This is exactly the behavior I am looking for. I tried to look at the source code of the VESC firmware to understand what parameters are being used during the hall sensor identification phase but with no results.
Does anyone now what configuration is applied to the VESC when the hall sensors are being detected? Is there a way I can configure and control the motor to achieve the same controllability and torque the automated procedure achieves?

Thanks in advance for your support! 
 

MrShocko
Offline
Last seen: 1 year 9 months ago
Joined: 2020-11-25 07:41
Posts: 4

Does anyone now what configuration is applied to the VESC when the hall sensors are being detected? Is there a way I can configure and control the motor to achieve the same controllability and torque the automated procedure achieves?   

Hello, I am working through an application for low speed high torque with a highly variable load - a cam action drive.   In response to your query:

VESC tool 2.06 ad firmware 5.1  for VESC4 and VESC6  (sensorless) with VESC connected.

Go to VESC Terminal.  type "help" in the command bar.

A list of available commands for the terminal are displayed.

To operate your motor in the same way as the detection algorithms, you have two options:

foc_openloop xx yy   where xx = current and yy = erpm

foc_openloop_duty  xx yy where xx = duty [0.xx] and yy  =erpm 

I have ben driving motors in this mode and it is encouraging that they can sustain dramatic load changes, forward and reverse toque, while holding what seems to be a tight speed.

The down side is the current draw in my case is high and sustained through regions where it is not needed.  Everything heats up too quickly. 

I am trying to find the handles to enable the current to much more dynamically respond to demand by the speed control.

So far I have found that foc mode in current mode and duty mode invoke the foc_openloop operations.  You manipulate that by adjusting the Openloop_ERPM found in the Sensorless tab of the FOC  area.  By setting this value equal to your target speed, I find the duty mode and current modes meet that speed.  

If I set a speed target however, the motor attempts to start , (there is low torque at the bottom of the cam, rapidly rising with angle,) gives up, and tries again with progressively increasing current, ramping up to 10 amps or so, but not the 20 amps needed.   

Referring to K@rslon's query above, I have tried to increase the current responsiveness in speed control mode,.  Can anyone suggest what parameters I should be adjusting so at low speed, the current can be leading demand more in speed control mode?

 

 

Luke264
Offline
Last seen: 1 week 6 days ago
VESC Free
Joined: 2020-09-30 19:46
Posts: 10

@MrShocko

Thanks for your reply to me about serial tricks on the machine lathe thread!

I have found several things that might help, but it is very difficult on my motor to get satisfactory smoothness in pid speed control mode, and I've done an awful lot of tuning. Duty just seems smoother, but still not as smooth as foc openloop, which obviously cooks your motor!

1. Set current limits first, in particular, reduce brake current during tuning. It just plays havok with tuning, causes stuttering.

2. Minor effects worth trying: on advanced tab, disable back emf (to unlink current from observer) just use cross detection, use HFI, use encoder, hall and use current injection. Set all throttle ramp times to as small as possible. Also, I use 60khz because it makes the motor quieter, easier to listen.

3. But the main strategy I use is very very slow. Start with only current Kp, then zero out everything on the pid screen. Tune position first, slowly add kp until you get a response. Then slowly add Ki current and ki position. Then slowly bring in Kd to dampen. Then once you get a feel for it, do speed. Look for overshoot and oscillations. It is worth it in the end!

 

MrShocko
Offline
Last seen: 1 year 9 months ago
Joined: 2020-11-25 07:41
Posts: 4

Thank you your advice @Luke.  I will explore as you suggest.

Luke264
Offline
Last seen: 1 week 6 days ago
VESC Free
Joined: 2020-09-30 19:46
Posts: 10

Just updated to VESC Tool 3.0 and Firmware 5.2, re-ran all detection and re-calibrated. It now works much more out of the box with speed and position PID control, and a small hall sensor motor. Well done Ben, and whoever else contributed!