GearHeads Corner
June 02, 2020, 03:44:19 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 ... 11 12 [13] 14
  Print  
Author Topic: Arduino based Laser Control  (Read 61410 times)
0 Members and 2 Guests are viewing this topic.
DanL
Sr. Member
****
Posts: 362


View Profile
« Reply #180 on: December 10, 2014, 04:52:38 PM »

art engrave and diag work fine it switches from diag to pwm ok.

pwm does not work at all

I have pwm set at 50 Hz it keeps going to 12 Hz if I toggle pwm in pwm mode it does nothing if I toggle in engrave its fine.

also for some reason the pot will only go to 65% on arduino screen

I have tried having the pwm on the G540 and MB-06 makes no differenc es its set up correct. so I don't have a clue what's wrong

as long as engrave work its not a problem to I get a bigger laser
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5634



View Profile
« Reply #181 on: December 10, 2014, 05:22:30 PM »

Hi Dan:

>>art engrave and diag work fine it switches from diag to pwm ok.

  Good. Does the unit automatic ally switch from Diags to CNCMode when you turn on a PWM spindle in Mach4?

>>pwm does not work at all
>>I have pwm set at 50 Hz it keeps going to 12 Hz if I toggle pwm in pwm mode it does nothing if I toggle in engrave >>its fine.

 The frequency should read 25 inside darwin when its a 50hz PWM signal. This is for technical reasons. Setup a spindle output signal. Done worry about the frequency of it, Darwins plugin will set it up when you turn on the spindle with a M3. Toggling the signal inside Darwins config doesnt do much, it has no reference speed to set the pwm to. Only test the PWM output by using an M3 or pressing the spindle on button in Mach4.

>>also for some reason the pot will only go to 65% on arduino screen

  This can only be a bad pot, or a bad connectio n. OR.. the 5 volts powering the board is pulling down to a lower voltage due to current restricti ons. Measure the voltage at pin 4 to ground, it should go from 0 to 5 volts or very close. See if its limiting to a lower voltage.. . like 3.5volts. . 65% woudl be pretty low so Im suspectin g a bad connectio n or pot..

>>I have tried having the pwm on the G540 and MB-06 makes no differenc es its set up correct. so I don't have a >>clue what's wrong
>>as long as engrave work its not a problem to I get a bigger laser

   Im not really sure where your at at this point. Does the Laser Pin9 PWM now work properly and adjust when your in NGrave mode and running M4? Is it just PWM nonlaser mode that dosnt work now?

Art
Logged
DanL
Sr. Member
****
Posts: 362


View Profile
« Reply #182 on: December 10, 2014, 05:33:22 PM »

Hi Dan:

>>art engrave and diag work fine it switches from diag to pwm ok.

  --Good. Does the unit automatic ally switch from Diags to CNCMode when you turn on a PWM spindle in Mach4?
yes

>>pwm does not work at all
>>I have pwm set at 50 Hz it keeps going to 12 Hz if I toggle pwm in pwm mode it does nothing if I toggle in engrave >>its fine.

 --The frequency should read 25 inside darwin when its a 50hz PWM signal. This is for technical reasons. Setup a spindle output signal. Done worry ----about the frequency of it, Darwins plugin will set it up when you turn on the spindle with a M3. Toggling the signal inside Darwins config doesnt do ---much, it has no reference speed to set the pwm to. Only test the PWM output by using an M3 or pressing the spindle on button in Mach4.

ok

>>also for some reason the pot will only go to 65% on arduino screen

  --This can only be a bad pot, or a bad connectio n. OR.. the 5 volts powering the board is pulling down to a lower voltage due to current restricti ons. --Measure the voltage at pin 4 to ground, it should go from 0 to 5 volts or very close. See if its limiting to a lower voltage.. . like 3.5volts. . 65% -------woudl be pretty low so Im suspectin g a bad connectio n or pot..

will do


>>I have tried having the pwm on the G540 and MB-06 makes no differenc es its set up correct. so I don't have a >>clue what's wrong
>>as long as engrave work its not a problem to I get a bigger laser

  -- Im not really sure where your at at this point. Does the Laser Pin9 PWM now work properly and adjust when your in NGrave mode and running ------M4? Is it just PWM nonlaser mode that dosnt work now?

pin 9 works as it should
it just pwm that does not work

Art


I will test all connectio ns I am powering it of my laptop it could be the laptop its stuffed
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5634



View Profile
« Reply #183 on: December 10, 2014, 06:17:28 PM »

Dan:

 Probably the laptop cant provide enough current. You coudl use much higher resistanc e values on all resistors and the pot.. but probably better to use a 5 volt wall wart or something .. the arduino actually uses a fair bit. I tried powering mine off the breakout boards 5vdc .. and it wasnt enough so I used a CPU 5vdc supply..

Art
Logged
DanL
Sr. Member
****
Posts: 362


View Profile
« Reply #184 on: December 10, 2014, 06:26:53 PM »

the pot was bad its getting 5v under logging its come up as a step and direction spindle
Logged
DanL
Sr. Member
****
Posts: 362


View Profile
« Reply #185 on: December 10, 2014, 06:54:11 PM »

pwm mode no work at all done everythin g properly tried all sorts of things nothing worked.

when in engrave mode it work perfect pot changes pwm value instantly .

diag perfect

diag change to pwm when turning spindle on every time

its getting enough power.

it could be the same problem when I had a spindle on the machine I had to have it set to 0 - 15000 to get 5000 rpm   

other than that I don't know what's going wrong
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5634



View Profile
« Reply #186 on: December 10, 2014, 08:07:54 PM »

Dan:

  Well, on the good side, Engrave mode will do everythin g he CNC Mode does.. it just uses the power word instead of the PWM Spindle.

 If you have Darwin setup properly in its Daigs menu, then you should see the report
"Spindle Output PWM detected." in the error log if you aloso turn on debug mode in Darwin.
Do you get that message?

Art
Logged
DanL
Sr. Member
****
Posts: 362


View Profile
« Reply #187 on: December 10, 2014, 08:30:29 PM »

with turning spindle on with button, spindle output pwm detected comes up under it has pwm set 0.00%,count2

useing mdi m3s100 it comes up  spindle output pwm detected under it it has pwm set 0.95% count 3167
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5634



View Profile
« Reply #188 on: December 10, 2014, 09:44:31 PM »

Dan:

  Yes, that sounds correct. With no spindle speed your getting a PWM of 0%, with S100, your getting 95%.
Its programme d that way because the PWM will limit to 95%, usually laser makers recommend you dont run at 100%, it slowly degrades the lasers power.. so the pwm actually goes from 0 - .95 ( or 95%). 

 SO it looks like Darwin is properly sending out the PWM, so if the laser box is in Diags mode, and you press the spindle button, the box shoudl auto switch to CNC mode. The REM: in the upper right will display the power of the spindle , for example REM:50 is 50% is being sent via PWM. This means the biox will actually send 50% of the power dialup up by the pot. So if you have adjusted the pot to 50%, and Darwin sends .5 ( 50%), the REM:50 will display inthe upper right of the laser display, and your PWM out on pin 9 will put out 25% of lasers max power. ( Mach4 requestin g 50% of the dialup up 50% max from the pot. ).
 
  So the REM: display will tell you if the power is getting through.. .

 Art
Logged
DanL
Sr. Member
****
Posts: 362


View Profile
« Reply #189 on: December 10, 2014, 09:50:55 PM »

its doing everythin g its meet to do its just not sending a pwm output in pwm mode it just does the tickle pules

I might try tomorrow to set the spindle range to 0 to 1000 to see if it is the same problem I had when I had a spindle on the machine

engrave mode works fine so I wont worry about it I haven't got a laser yet anyway so it no problem for me
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5634



View Profile
« Reply #190 on: December 10, 2014, 10:01:27 PM »

Dan:

 No, if its reporting .95 at S100, then the spindle range is set fine. Does the REM:50 sho up if you do a S50M3 when the dial on the pot is at 100%?

  If so, then its probably all good. If you jog the motors , the PWM will follow whatever the REM:% says. Of course, you may not easily see it, your only getting 1 fire pulse per motor step. Make sue you have 1 dialup up for pulse count as well, if pulse count ios set to zero, then it will also not fire..

Art
Logged
DanL
Sr. Member
****
Posts: 362


View Profile
« Reply #191 on: December 11, 2014, 03:25:15 AM »

rem 50 may show up when pot at 100% it flickers from 50 to 100 or 500, its to fast for me to read it comes up with 1 fire pulse, there is a in cress in pwm but the gape between pulses is very long 1/2 second what may be ok the pwm is not steady

I tested doing the same thing with engrave it worked well S50M3 with setting pulse at 1, pwm change with pot value.
ran a g code it worked very nicely with pwm changing value with pot.

if you wont me to try something else let me know

but its the bees knees in engrave mode.

I will strip out the yun parts in the code and see if there is a change

Logged
ArtF
Administrator
Hero Member
*****
Posts: 5634



View Profile
« Reply #192 on: December 11, 2014, 07:59:44 AM »

Hi Dan:

  Its weird that only the PWM mode is affected. . sounds like Engrave mode is fine. The engrave mode doesnt use th ePWM at all, it uses serial power, so it must be something to do with the actual PWM signal, which sounds right. SO long as its set at 50hz, it should work OK.

     The system can be sensitive to kernal speed, mine is limited to about 35K-40Khz, any higher than that and
the arduino has trouble reading the serial input fast enough.. PWM though should be the easiest one to read
so there must be something dicked up there. Let me know how it runs with the YUN stuff out, mayeb it will help.
If not, we can always make up a test of some kind. Im thinking the interrupt for the pot may be different if your not
using a yun, the PWM relies on interrupt #6 on pin7. In a YUN you attach this interrupt by attaching it to
interrupt #4 which is done by one of two lines in the code...

attachInt errupt( 4, DUMMY, CHANGE ); //reattach the spindle interrupt

   This attachmen t to interrupt #4 actually makes interrupt vector #6 work on a YUN, it IS possibel that if its not a yun, you need to use interrupt 6, so it may be you need to change those two lines to the following two lines as replacmen t for each call to attachint errupt. Generally a leonardo cannot use attachint errupt to gain access to int 6, so the following two lines replace the one call to attachint errut( 4...

EICRB |= (1<<ISC60)|(1<<ISC61); // sets the interrupt type
EIMSK |= (1<<INT6); // activates the interrupt

 Art




Logged
DanL
Sr. Member
****
Posts: 362


View Profile
« Reply #193 on: December 12, 2014, 05:33:24 PM »

I am not quite sure what need me to do

do I replace
//attachInterrupt( 0, DUMMY, RISING ); //pulse external monitor
  //attachInterrupt( 4, DUMMY, CHANGE ); //sets the routine to call..

with
 EICRB |= (1<<ISC60)|(1<<ISC61); // sets the interrupt type
EIMSK |= (1<<INT6); // activates the interrupt

then what do I do with this bit

   //detach the spindle interrupt s.
      //detachInterrupt(4);
      //attachInterrupt( 1, DUMMY, RISING ); //reattach the spindle interrupt

and this as well

  attachInt errupt( 4, DUMMY, CHANGE ); //reattach the spindle interrupt
      detachInt errupt(1);

Logged
ArtF
Administrator
Hero Member
*****
Posts: 5634



View Profile
« Reply #194 on: December 13, 2014, 12:20:16 AM »

Dan:

  I need to read a bit to see if that will work and what needs to change. Leave it for now.. Liek you say, NGrave mode does everythin g one needs anyway.. Smiley

Art
Logged
Pages: 1 ... 11 12 [13] 14
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!