FOC Torque control

I am using some functions of your simple foc library that i have downloaded from github. I do have understanding of FOC and right now developing a pmsm control. I will implement a velocity control in the end but right now my main concern is to drive the bldc in low rpm <10rpm. For that i am trying to get a smooth drive in torque control first. I am using inline current sensors. I have my own hardware build for this.
FOC freq: 15kHz
polepair: 4
min RPM: <10
max RPM: 3500
Max Torque: 14Nm
Max Power: 5kW
I have it all setup and working. Right now i just command it to a torque ref with direction and motor regulates that torque at whatever rpm is necessary. for 1Nm it find outs the current as i know torque per ampere of my motor (which i calculated in experiments). As soon as i decrease set torque or try to slow it down, it doesn’t remain smooth <50rpm and stops spinning after jittering under 30rpm.
I have tried velocity control but had same issues in low rpm so i though digging it and finding out what is the main cause.
I tried my best to explain as much i can but will answer more questions, just needed a community with people experience in foc motor driving.

Hi @Zain_ur_Rehman , welcome to SimpleFOC!

What type of sensor are you using?

To get smooth motion at low speeds can be tricky with some kinds of motors. Low pole count motors are usually designed for speed rather than slow rotation. Do you have a link or Datasheet for the motor you’re using?

I am using quadrature encoder 10000 counts per cycle
I have encoder pulse and i reset the count using HALL input, since i dont have a index signal. Do you have any suggestion regarding this?

Its a custom motor and trust me i have seen this motor driven at low rpm.

I feel like i have tuned torque control. And i am using 1ms loop to find out pulses for velocity measurement. Should i call velocity PID every 1ms too? And right now lets say at 100rpm motor starts/stops and doing it in continuous pattern.

Hey,

You mean with current sensing?

How about torque-voltage mode, what are your results with that? For torque voltage mode all you need is a well working sensor, really.

A 10000 CPR encoder is quite enough for smooth low speed control. So the question is for example whether the resets from the hall sensors are working well and you get a nice linear output signal from the sensor?

Velocity mode tends to make things worse if torque mode is not working well, so I would definitely focus on torque mode first…

When your turn your motor by hand while it is unpowered, is it easy to turn? Or can you feel the magnets (cogging) strongly as you turn it?

Hi,

Have you tried to tune the PID at the low RPM only and see if the PID coefficients at high RPM are different that the low RPM coefficients?

Also as @runger mentioned, 4-pole pair is rather low for smooth low RPM run, usually those motors have at lease 12 or higher pole pairs. I mean, you may be able to make it work by dynamically changing the PID coefficients depending on the RPM but the motor is probably not fit to be used in this scenario.

This is just a guess, without knowing the driver and motor I’m only spitballing.

Cheers,
Valentine

I am using inline current sense.

What you mean by torque voltage mode? Just put Vq and set Vd=0?

Torque control works as in, I am able to regulate torque.

For the reset or index using hall sensor, i still have to explore that. My idea is not skip start up sequence. As i know offset and natural direction. All i need is index and i want to skip this finding index thing as it doesn’t suit my application. And i want to know if someone has done this.

Okay, now i am able to operate the motor in velocity mode in low speed i.e. 5rpm but its a bit you can jerky if you really focus. And when i speed it up, it starts this cycle of starting stopping, and jerks.

If i Lower my current gains then i can operate velocity mode pretty much smoothly. Of course it takes time to settle and all but it works.

In my opinion i should tune currents such that it regulates torque as fast as possible.

Now what you guys want me to do first?

In velocity control, when i tune current gains to low values it works for high rpm. But to run in low rpm i have make foc current gains high. What if they are different, what do i do then?

Motor is to be used for high starting torque, thats why it has low poles and high slots.

And kindly tell me if you have worked with hall and encoder without index signal. As i want to skip startup sequence.

I cannot say as I don’t have your setup, it seems everything is custom built and advice is very difficult for me without hands on site.

Cheers,
Valentine

Yes,
But just tell me to check this that, or something like this.
How to check if torque control is fine!?!
@Valentine

You can’t skip the index search if you want to skip the initialization.

The system has to know the electrical zero point. This can be calibrated once and stored if you have an absolute sensor. By searching for the index you make the encoder absolute.

If you don’t have an index you don’t have an absolute position. Each time you reset the system you start at a different physical zero position, and have to calibrate the electrical zero relative to this new physical zero.

Because we don’t really know about your software, I am not sure we can help you there very specifically.

Generally speaking, you want torque control to allow you to control the motor in terms of setting a current (or voltage) in Q axis. More Q axis current should give you more torque.

You can graph your systems response to help you tune the PID parameters for current control and velocity control.

So what i can do is just run motor one electrical cycle in block commutation and then switch to foc. As it won’t require need for index search.

Generally speaking, how you tune your velocity control loops? I will plot torque control response and share it with you guys.

Seems like my torque control isn’t stable. I am looking at q current controller outpost first. It has oscillations and q current controller isn’t stable.