You are here

Torque control with PWM at 10kHz for LinuxCNC + MESA + AC servo

7 posts / 0 new
Last post
antonchromjak
Offline
Last seen: 10 months 57 min ago
Joined: 2017-09-05 13:47
Posts: 57
Torque control with PWM at 10kHz for LinuxCNC + MESA + AC servo

Hi, I was thinking about using VESC in my next project. Control AC servo with quadrature encoder connected to VESC. LinuxCNC MESA card conected to VESC with ppm input. Servo thread with PID will be on PC and VESC will be responsible for torque control based on PWM duty.

My question is if VESC use on PPM input hardware counter and if it is possible to have good resolution at about 10kHz ( of course with firmware change ).

I assume if it use hardware than at 10kHz there are 16800 steps to play with.

Next if it can handle 2500 steps/rev(10000 resolution) quadrature encoder at 3000 rpm. That is 500kHz.

This could open new field for VESC because for CNC is better to have PID on PC with torque control then using STEP/DIR and VESC has good brain for this.

Maybe next board will be 220V 20A?

thanks in advance
Anton

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

With step/dir I assume that you want to control the motor in the same way as a stepper motor, right? Then you are actually running position control and not torque control. The difference is that stepper motors kind of run position control in open loop while the VESC runs position control in closed loop, which is much more efficient and gives higher power density compared to using stepper motors.

Connecting the encoder to the VESC should be no problem. The encoder goes to the timer hardware, so handling 2500 pulses/revolution (10k steps) at 3000 RPM is easy, as long as the cables are routed nicely to prevent most noise. The step/dir interface has to be implemented after that, but the hardware should support it and the software should be quite straight forward to write. I actually have a small 6040 cnc running linuxcnc in my garage, so I might also have some use for it :-)

I have added the step/dir app to the TODO list:

https://vesc-project.com/node/110

antonchromjak
Offline
Last seen: 10 months 57 min ago
Joined: 2017-09-05 13:47
Posts: 57

No, I want to control it like AC servo with torque input.

For step dir I think you need another hardware timer like encoder has and compare values in some pid thread but that is not what I want to do.

I want to control motor torque with PWM at 10kHz. For example I want at 10% pwm -10A current and at 90% pwm +10A, 50% pwm 0A. VESC has PPM input and I want to know if it is connected to hardware timer that is capable to convert this pwm at 10kHz to some integer +- 1000 so I can run torque control on VESC and position control on PC with linux/mesa.

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

Alright, now I get what you mean :-)

The PPM input uses a hardware timer that runs at 1 MHz, so if you use it as it is you should get a resolution of 100 steps across the range with 10 kHz input rate. It should be enough to change the pulselength start, end and center settings in the PPM app settings. It is possible to run the timer at even higher rate, but I don't think it gives any benefits because noise will give more jitter than the extra resolution helps anyway.

One thing you have to do to run PWM input at that rate is to change or remove the low pass filter on the PCB.

antonchromjak
Offline
Last seen: 10 months 57 min ago
Joined: 2017-09-05 13:47
Posts: 57

Thanks! I think MESA card will have very little jitter.

Artabotak
Artabotak's picture
Offline
Last seen: 7 months 16 hours ago
Joined: 2022-12-07 12:46
Posts: 3

    

Artabotak

Artabotak
Artabotak's picture
Offline
Last seen: 7 months 16 hours ago
Joined: 2022-12-07 12:46
Posts: 3

Is there currently an addition to step/dir??? because vesc is really good, i really appreciate it. if vesc supports step/dir it has a wider reach in the cnc world. i really want to use vesc to control the pmsm servo ac. compared to buying the driver. but i can't find a way to communicate with it. step dir on vesc. I hope this will happen soon. thank you🙏

Artabotak