Hello Guest it is April 19, 2024, 10:50:21 AM

Author Topic: PWM output for Spindle  (Read 11195 times)

0 Members and 1 Guest are viewing this topic.

PWM output for Spindle
« on: October 18, 2012, 03:57:59 AM »
Gents,

Pokeys56U running fine, in and outputs are working fine, but i want to use the pokeys to output the PWM signal to drive the spindle frequency converter ( 0- 5 Vdc ). It would be nice to get a 10kHz PWM signal instead of the  mach3 PWM signal of 200Hz.

Opened the pokeys configuration, PWM tab, selected pin 17..... then you have to make select a DRO that i can guess but are not clear to me. Ive tried 10 or so but no result.  I guess i have to select the option "DRO in %" first and than the right DRO that sends the % PWM to the output ?

(Ive tested the PWM signal on the scope and in the "fixed" setting it worked) 

what am i missing ?

Thanks, 


Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: PWM output for Spindle
« Reply #1 on: October 18, 2012, 07:48:04 AM »
Hi, Seklom

The PWM settings for PoKeys devices offer a wide array of possibilities and may therefore seem not clear at first.

PWM works by comparing a counter (running at 25 kHz) with a predefined PWM period value and resetting to zero when the counter reaches the PWM period. This defines the frequency of the PWM signal. In PoKeys devices, this frequency is adjustable and is shared among all PWM outputs.
Besides comparing the counter with the PWM period, the counter also is compared with PWM duty cycle for each output separately. The ratio between PWM duty and PWM period is usually called PWM duty cycle and is specified in %. 100 % means the signal is on all the time, 0 % that the signal is off all the time, while the 50 % means that the signal is on for half the PWM period and off for the other half.

So, why is there option to map the PWM output to 'DRO' only and to 'DRO in %'? The first option defines the value for the PWM duty directly and user must take care that the value is in the range from 0 to the value of the PWM period. 'DRO in %' simplifies this by expecting the DRO value from 0 to 100.
Because the user has usually no control on the range of the DRO values, we introduced a multiplication factor in the latest plugin release that allows you to multiply the DRO value by a custom factor, producing a value in the range from 0 to 100 for 'DRO in %' mapping.

Regards,
Matevž
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: PWM output for Spindle
« Reply #2 on: October 18, 2012, 09:09:34 AM »

Matevž,

Thank you for your clear explanation. This give a bit more understanding than the manual.

to give it a test:  So If i want to get a 0-100% PWM signal on my pin 17 i have:
For example : Pulley 0-4000rpm => PWM 0-100 =>multiplier 40 so if i set 2000 RPM my PWM should be 50%. But not in mach3:

1) map pin 17 in %
2) select the correct DRO : DRO#817: "Spindle requested DRO" ?
2) find its range : assume 0 40000 assume
3) divide the range to correspond to to 0-100%: assume 40

so if we insert 2000 in the MDI it should work...lets try tonight

Is it this straightforward or should this be in a brain

thanks..

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: PWM output for Spindle
« Reply #3 on: October 18, 2012, 09:52:51 AM »
Seldom

The DRO value gets multiplied by the multiplier, not divided by! In your case, the multiplier should be 1/40 = 0.025
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: PWM output for Spindle
« Reply #4 on: October 18, 2012, 04:46:51 PM »

I am not smart enough for this..

to be sure checked again pin 17: fixed PWM at 50% works as a clock.

and then...in PWM tab...pin 17.... Map to DRO in %         DRO 817: Spindle request DRO   Multiplier 0.01   pulley 0-100

when i open Mach3, pin 17 : 0-VDc, as soon as i enter a value in the box "Spindle speed " pin 17 goes to a stable 2Vdc no PWM signal at all,
closing mach3 en restart Mach3 again is the only way to get it back to zero again.

Tried a dozen DRO en multipliers, so it must be something else.

I just want to select the PWM duty cycle signal that mach calculates ?

thanks

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: PWM output for Spindle
« Reply #5 on: October 19, 2012, 01:59:13 AM »
Please export the PWM configuration and post it here.
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: PWM output for Spindle
« Reply #6 on: October 19, 2012, 03:57:09 AM »
Neo,

Thanks see attached

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: PWM output for Spindle
« Reply #7 on: October 19, 2012, 04:00:52 AM »
Will check it next week when I'll have access to my machine.
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: PWM output for Spindle
« Reply #8 on: October 19, 2012, 08:14:43 AM »

stupid, it was me.....thought i was fully up do date but i had to update the firmware on the pokeys....

now it work like a clock with the same setting only multiplier 1

sorry guys, (should have checked it)


Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: PWM output for Spindle
« Reply #9 on: October 19, 2012, 01:36:51 PM »
Don't be sorry, glad you got it sorted and it's good for this to be here for others to see.

Thanks for updating us on your progress-

Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)