You are here

Best practice for controlling VESC with high speed PWM

2 posts / 0 new
Last post
arsenix
Offline
Last seen: 5 months 2 weeks ago
VESC Free
Joined: 2018-09-25 19:30
Posts: 3
Best practice for controlling VESC with high speed PWM

I am working on a project adding a 4th axis to a CNC mill. The CNC controller spits out a 25khz PWM signal to control the axes. This is designed to near-directly control the switching FETs driving brushed DC motors. 50% duty = stationary, <50% is one direction, >50% the other. I've fitted my 4th axis with a brushless motor and jogging it around with VESC works nice. So I want to glue these together. Wanted to solicit opinions on best way to do this.

1. I could try to feed the 25khz directly into VESC (probably need a custom input application). The update rate is much higher than it needs to be and might be a problem.

2. Just use an RC to filter/scale the PWM into an analog control signal (0-3.3v)

3. Use some digital circuit to turn the 25khz duty into a standard RC PPM, or some other lower rate digital control signal. Small FPGA or hack something together with discrete logic chips.

This axis isn't moving incredibly quickly, but I am a little concerned about added latency relative to the way this system was originally designed to work (direct PWM->FETs vs PWM->VESC SW). I presume a few hundred hz update rate will be adequate (I believe the CNC controller updates the command at some similar rate).

Would be interested to hear if folks had any other ideas. There are a handful of threads about folks doing similar things, but at lower rates and also with no definitive conclusion/success followup!

 

James

skyline1970
Offline
Last seen: 1 year 3 weeks ago
VESC Free
Joined: 2017-09-07 22:28
Posts: 232

An uC could be used to get the servo info from the CNC controller, and extracts the position data and apply it on an output as a normal servo ppm .

Or just have a look at Odrive.