× Forum Header

PWM not quite working

More
26 Apr 2012 16:26 #19559 by andypugh
Replied by andypugh on topic Re:PWM not quite working
dieselpilot wrote:

I'm still running the settings I posted last. EMC is set up for running industrial PWM signals using the entire duty cycle, not such a small range that RC gear uses


The problem is that the software PWM generator has a granularity equal to the base period, and that is typically at least 20uS, and often 50uS.
RC servos need a pulse between 1mS and 2mS, so you only have at most 50 possible duty cycles, and possibly as few as 10.

An external PWM generator such as a Mesa card can do 1000x better than this, but if you are in the market for $80 Mesa cards you are probably not using RC servos.

It might be possible to create a circuit (maybe using something as simple as a 555 timer) which can take a PWM, filter to DC voltage, and generate a 0-2mS PWM from that (you would use half the range, as I suspect that a circuit to convert 0 to 5V into 1 to 2 mS is a lot harder than 0-5V -> 0-2mS.

Please Log in or Create an account to join the conversation.

More
26 Apr 2012 18:12 #19563 by dieselpilot
There's more to it than just resolution. Even if EMC2 had the resolution, it won't scale properly to use a 1-2ms pulse width to scale 0-max RPM as I explained previously.

I did tweak my CAM post to give me a S1 and 2 second pause before commanding the spindle speed to allow the ESC to arm.

The previously suggested www.logicnc.com/rcnc.html works, but I'm not going to get one. I've decided to search for a regular servo amplifier after determining I won't need a very high current rating after all. I put hall magnets in the spindle in case it was needed.

If you want to control an RC ESC directly from the parallel port go with the logicnc part, or just expect you'll have only an on/off functionality.

Greg

Please Log in or Create an account to join the conversation.

More
26 Apr 2012 21:12 #19566 by andypugh
Replied by andypugh on topic Re:PWM not quite working
dieselpilot wrote:

There's more to it than just resolution. Even if EMC2 had the resolution, it won't scale properly to use a 1-2ms pulse width to scale 0-max RPM as I explained previously.


That can be fixed with a HAL "scale" component:
linuxcnc.org/docview/html/man/man9/scale.9.html

If you had a 20kHz PWM then 1ms is 1/50th of the frequency.
You could pass the 0-100% spindle command through the scale component, with scale set to .02 and offset 0.02 (If my maths is right)

Please Log in or Create an account to join the conversation.

More
27 Apr 2012 04:00 #19573 by jpka
Replied by jpka on topic Re:PWM not quite working
Hi!
Maybe i do something wrong, but i have no major problems with my ESC and LinuxCNC, and actively use it. At least, scaling always works as expected (i get at least 10 fine steps). My connection currently is still glueless, and nothing was changed in my setup since i show my config and ESC model in posts above. But please take into account that my ESC was reprogrammed (using its official feature) to use 1...2 ms times, rather than standard 1.5...2 ms. I have LinuxCNC version 2.4.7 used from LiveCD.
But i now still look for adding a microcontroller. The reasons for it unfortunately can't be solved even using hardware PWM card or 35 USD gadget. These are: No loopback alarm signal when spindle is not rotated while it must; and, due to 'smart' nature of modern ESCs, these are not start rotating when i change 0% to 10% duty cycle, they think it's a pilot's mistake. To start rotating, i need 0% ->50% -> 10% sequense or so. (stopping works immediately).
I currently can recommend glueless connection only if you really no have any other ways to spin your spindle... I have no idea why sometimes pulses are too coarse, as other people reports. (it is reproduceable by someone else?)
But can recommend using ESCs, they are pretty effective and low-loss devices.
I think to develop tiny atmel's based open source control device for ESCs, hope it will be also useful by someone else :-)

Please Log in or Create an account to join the conversation.

More
27 Apr 2012 12:15 #19583 by andypugh
Replied by andypugh on topic Re:PWM not quite working
jpka wrote:

I think to develop tiny atmel's based open source control device for ESCs, hope it will be also useful by someone else :-)


Thinking about it, somewhere I have a PWM duty cycle shifter for Arduino that I wrote for a problem at work. I will try to find it.

Please Log in or Create an account to join the conversation.

Time to create page: 0.207 seconds
Powered by Kunena Forum