Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Andre007 on August 29, 2012, 02:55:18 AM

Title: PWM signal not showing correctly
Post by: Andre007 on August 29, 2012, 02:55:18 AM
Hi All

I have been at this problem for weeks now. My laser switches the beam either on 100% or off , there is no control of the laser intensity when i use S10, S100 , S1000.
The signal coming out of the selected pwm pin (1 in my case) , does not show on my scope as a square wave at all. When the signal switches on to fire the laser, it just show the trace on the scope screen to jump up a few notches ...still as a straight line and the amp meter shows 30MA. That is all that happens. I have played with the base frequency and kernel speed, but the same results keep showing. Basically the GCODE only responds to the on/off code (M11p1 & M10p1)...there is no control by using any 'S' command. My question now :

How difficult is it to see a square wave pwm signal on the scope (My scope is capable of signals up to 20 megaherts)  ? I have played with all the knobs trying to see any signal, but nothing, i mean the square wave should show up quite easily  ..?? ???

The other thing that is worth mentioning is that the printer port cable is about 2 metres long running all across the machine to the other side where i have found a nice place for it to sit inside the machine....can this possiblly cause problems with the pwm signal ? ???

I know that i should have a clean pwm signal before i look for the problem down further. Why would the trace on the scope only show a shift in the trace line itself instead of a square wave ?? ??? I have played around with the base frequency from 5 all the way up to 9999999 , in which case mach3 make it 41666 or something like that.

Should i be bothered by the pwm signal not showing correctly, or am i totally on the wrong track here ? ???

Any help would be greatly appreciated as i`m not sure where to go from here.

Andre
Title: Re: PWM signal not showing correctly
Post by: Hood on August 29, 2012, 03:44:21 AM
Are you commanding a M3 with your S word?
Maybe Tweakie will have more of an idea as he uses the laser quite a bit.
Hood
Title: Re: PWM signal not showing correctly
Post by: Andre007 on August 29, 2012, 03:50:46 AM
Hi

No, i have used the code as described by other laser users. No M3 command , just the M commands followed by a axis movement as described in other threads. ..below is an example :

11 G0X0Y0Z2
21 G1Z-2F100
25 S100
31 M11P1 (laser on)
41 G1X10Y10
51 M10P1 (laser off)
61 G0Z2
Title: Re: PWM signal not showing correctly
Post by: Hood on August 29, 2012, 03:55:36 AM
well worth a try putting a m3 on the S100 line to see

Hood
Title: Re: PWM signal not showing correctly
Post by: Andre007 on August 29, 2012, 04:00:00 AM
I`m willing to try anything that i have not done before inside the GCode..

THanx will give this a try when i get home..

Andre
Title: Re: PWM signal not showing correctly
Post by: Tweakie.CNC on August 29, 2012, 06:13:49 AM
Hi Andre,

You are possibly looking in the wrong place with your oscilloscope. The PWM signal is on the Spindle Step Pin (as set up in Ports and Pins / Motor Outputs).

Tweakie.
Title: Re: PWM signal not showing correctly
Post by: Andre007 on August 29, 2012, 07:29:05 AM
Wel, i 1st had pin 16 as the output pwm pin , then changed it to pin 1 to make sure it was not something on that specific pin. When i disconnect the pin, i get no laser output ..or if i make it the wrong pin number, it also stop the laser to work, so it has to be the correct pin. I even removed the wire that goes to the controller unit to make sure it wasnt that, but nothing changed.

I`m really confused.

But i have another plan. I`m going to take one of my radio control esc`s and use a pwm generator unit that they use for testing servos. This will generate a pwm signal on the input of the controller unit. This should show when i run the laser , but obviously it will use the pwm singal of the servo tester. This should work right ?
The servo tester generates a nice pwm signal. I have scoped this before to get an idea of the pwm signal.

But i `m still confused for now  ???
Title: Re: PWM signal not showing correctly
Post by: Tweakie.CNC on August 29, 2012, 07:38:37 AM
Are you now seeing the PWM square wave from Mach3 on your scope ??

Tweakie.
Title: Re: PWM signal not showing correctly
Post by: Andre007 on August 30, 2012, 07:23:56 AM
No, nothing yet.
Last night i hooked up my scope to a radio control receiver to view the pwm output. I can see the square waveform ,only parcially , which make me believe that the pwm on mach3 might be more difficult to view than i expected. After playing around and taking everything into consideration, i hooked up the servo tester board to try adjusting the pwm signal manually ...basically same as all the other testing circuits i have seen , but adjusting the power level manually. This obviously works, which make me believe that the problem might be at the Homann controller itself.

I was thinking that the controller might be adjusted to high on the output side , so it will output a high power level all the time...not sure, but i have not checked this closely enough yet.

If i fail to get it all working and the problem is not the homann board level adjustment, i will then revert to the next thing that i have though about.

By using  a 3rd stepper motor on the z-axis , i can adjust the trimmer pot manually by building a unit that will turn the trimmer up and down by setting the GCode on the z axis. I have read some comments bout this , but have not actually seen it in the workings.
This works correctly as i have played around with the little controller board , but then i was thinking how on earth would i control the trimmer pot automatically if i have to turn it by hand now.

The z-axis should work fine for this, but the only thing that i wonder about is if the z-axis will turn the pot fast enough to adjust the power level correctly. I cannot remember the amount of trimming required to adjust the level, but i think this is the way to go and i should come up with a very workable solution. Once i have played around with the amount of turning that is required for the different power levels, the idea should work great.

It would be fantastic to hear from someone that has done this already.

Comments anyone ?

Title: Re: PWM signal not showing correctly
Post by: Tweakie.CNC on August 30, 2012, 08:11:14 AM
Hi Andre,

I am pleased to hear that you are making progress.

Just out of curiosity I thought I would take a look at the Mach3 PWM waveform (the setup was with a maximum pulley speed of 100).

The following pics show a 25% PWM as produced with the S25 command and a 75% PWM with the S75 command.

Tweakie.
Title: Re: PWM signal not showing correctly
Post by: Andre007 on August 30, 2012, 08:18:33 AM
Wow, ...what are the scope settings on ?  I had my scope dialed to .1 and .2mv on both knobs...if that makes sense. Is a 20mhz scope sufficent to see these waveforms ?

Yes, i can say again, that i get nothing even close to this out of mach3..and all of this is why i cannot get the laser to output to different power levels.
The other thing i was thinking of is that the version i installed is too old maybe ? The version i have dont have the pulley ratio boxes on the ports and pins settings popup..its on a separate link lower down , and the speed of the spindle box is also not on the front screen as i have seen on others ...might this be why i have all of these problems ?
Title: Re: PWM signal not showing correctly
Post by: Andre007 on August 30, 2012, 09:00:54 AM
No, mine is not even anything close to the pwm screengrab that you have attatchd. I`m starting to think that my version of mach 3 is very old. I have seen that the ports and pins setup tab dont have the pulley setups on it. This can only be seen by clicking another link further down from ports & pins. Also the spindle speed is not on the 1st screen either. I have looked for this box to try see what the spindle is running at, but its nowhere to be seen. This version was installed over a year ago, which make me believe that the pwm section might have not been working correct in this version.

I`m 1st going to try to see if i cant get all to work by tackling the easy things first before i try the z axis motor option. The pwm seem to be working great if it works with the s word commands in the gcode.

Can you possibly tell me what your scope settings were ?

Thanx again for your time and input.
Much appreciated
Andre
Title: Re: PWM signal not showing correctly
Post by: Andre007 on August 30, 2012, 09:01:49 AM
Sorry, i have sort of double posted my message
Title: Re: PWM signal not showing correctly
Post by: Hood on August 30, 2012, 10:00:49 AM
Should your scope not be on 5v/div?
Unless of course you have a 10x probe.
Hood
Title: Re: PWM signal not showing correctly
Post by: Tweakie.CNC on August 30, 2012, 11:56:06 AM
Hi Andre,

My scope was set...

Y = 0.5 V/cm (10x Probe)
x = 0.5 mS/cm

(The PWM waveform is 5 Volt peak to peak with a pulse repetition frequency of 1 kHz).

Tweakie.

addition...   This post may be of interest to you http://www.machsupport.com/forum/index.php/topic,12444.msg155403.html#msg155403
Title: Re: PWM signal not showing correctly
Post by: Andre007 on September 03, 2012, 01:20:48 AM
No progress. I have been at it all last week, but i just cannot get a nice pwm signal. Now i know i `m getting some kind of signal out of the pwm pin, as i do get a trigger to fire the laser. When i disable the pin output, the laser stops working, so i`m at the right pin.
I dont want to stare myself blind on the pwm signal as it is propably working correctly as i do get an output, but it will be nice to know that it does work and i can look further down the line. I dont think my scope can read the signal correctly. Its already more than 15 years old , so it might be faullty. I`m going to try and dowmload  pc scope software and see if that doesnt work....i`m becoming obsessive of the pwm signal :-)

Another thing that lead me to believe that the scope is faulty, is the fact that i`m also battling to see a normal radio control pwm signal....i can parcially see it , like only half of it ..never a nice clear all the way across the scope, but just enough to know that its there.. :-(

Thanx for all the feedback and info so far.
A
Title: Re: PWM signal not showing correctly
Post by: Tweakie.CNC on September 03, 2012, 03:56:31 AM
Hi Andre,

It's just a thought but are you able to adjust the laser intensity (set different current settings) from your GCode by using say S25 and S75 etc. ??

Tweakie.
Title: Re: PWM signal not showing correctly
Post by: Andre007 on September 03, 2012, 04:28:45 AM
Hi

No, doesnt work. I have tried it ...always 100%  ...although the spindle speed box is showing the correct speed as picked up by the cnc code, but the laser output is not responding to it ...always just 100%

The other thing i`m thinking of is that the hobbyCNC board might be the problem. I have sent mail to Dave Rigotti to ask him bout it. I dont know how the signals work inside the pc printer port, but it might be that the board interferes with the pwm signal inside the pc.

THX
A
Title: Re: PWM signal not showing correctly
Post by: Tweakie.CNC on September 03, 2012, 05:56:59 AM
Sounds to me like you do not have a PWM signal on that particular pin of else you have a conflict of pins.
If you attach your .xml file (Mach folder - the profile you are using - [usually Mach3Mill.xml] but it must be renamed to post - I suggest Andre.xml) I will take a look.

Tweakie.
Title: Re: PWM signal not showing correctly
Post by: Andre007 on September 03, 2012, 06:03:03 AM
Hi

I will download the file and post tomorrow. I have actually read the file that report on the status of the ports and pins. There it had some error messages on the step pins, but the motors ran fine, so i assumed it meant nothing. Also, i had followed the setup instructions from the hobby cnc documentation on what pins to use. It specifically stated what pins to use for the direction and step.

Thanx
Andre
Title: Re: PWM signal not showing correctly
Post by: Andre007 on September 04, 2012, 12:45:56 AM
Its Working ....YIPEE !!!!

I had a missing wire from my hobbycnc earth to my Homann controller earth/ground/common...
I could not believe that i had no picked this up before. After hooking my multimeter up to the output on pin 1 and the printer port ground, the output started to change as i was inserting the speed into the spindle speed box ...i was extatic..

I still dont know how i missed this wire ...i was sure i had it ...well, it works, and now i can move on to the next level..

I`m sure i will be asking more questions as time goes on.

TWEAKIE AND HOOD, A BIG THANK YOU AND ALL OTHERS WHO CONTRIBUTED..


Andre ;D
Title: Re: PWM signal not showing correctly
Post by: Tweakie.CNC on September 04, 2012, 01:22:08 AM
Hi Andre,

I am pleased that you are on your way. Don't forget to keep us posted with your progress.  ;)

Tweakie.
Title: Re: PWM signal not showing correctly
Post by: bdn123 on January 18, 2013, 12:56:34 PM
hi
using z axis to control automatically a pot will be great (if a linear one selected,coding will be much easier)
but in real world,whould this be enaugh fast ? if not u'll have a spot in start/stop of every pass
another issue : how long can a pot last at this job? (it is mechanical and not designed for such cond)
Title: Re: PWM signal not showing correctly
Post by: Tweakie.CNC on January 19, 2013, 02:49:20 AM
Hi bdn,

Jeff (JJWMACHINECO) initially used a pot, fitted to his Z axis, but as you suspect it was not very long lived.
He then switched to using an encoder and more details of his work are some further links to follow are here;  http://oplaser.co.uk/opsupport/viewtopic.php?f=11&t=491

Tweakie.
Title: Re: PWM signal not showing correctly
Post by: bdn123 on January 19, 2013, 12:41:33 PM
hi tweakie
sorry for that ;)
i didn't note to whole pages!!