Sorry, I explained that badly. I put those signal at 126-128 so that users wouldnt change them form what I set their names to. YOu CAN use them, I do so they should work. If enabled and set to pins you should see them work. In the case of the step flag for example, you should see it pulse whenever a step is taken, no matter if its port 1 or 2. This should work for anyone , even if unlicensed. You cannot use the toggle button on the setup to test it though, the step flag will only work when steps are actually taken by a motor. The Serial CLK output will also work but canot be tested with toggle either..and it will only work when laser mode is on, spindle is on, a spindle speed is set from 0 - 100 ( with range set 0 - 100) and steps are taken. SO it too is hard to test..
Serial data is the same, unless your actually using it properly setup , its hard to test..
So stepflag is the easiest to test, just run any program and watch that it toggles, it should pulse on any step from any motor.. so its a great fire trigger..
Cant find your post.. ( Was it deleted? ). I ll recreate it here as I think it needs a public answer..
Original Post:
In Darwin pp driver I open a .bmp image, set the size, arduino laser mode etc. then create and save the .dim file. I then link the image which creates the Mach4 raster. So far so good. When I run the Gcode (Cycle Start) having set M3 S50 I seem to get the correct signals on StepFlag and SerialClo ck but the SerialDat a is just a 460uS square wave. What am I doing wrong please ??
The protocol of the serial data transmission is a bit odd.. this is due to my system being a bit noisy, but also because the arduino is too slow for all the activity at high speeds. Ive found a max of 30Khz here simply due to all the interrupt traffic. So I implemented the protocol in a fairly weird way, one that likely should be modified when more of us do it.
In Darwin ( like most plugins) a cycle time tells M4 how much data to send each waypoint. ( update loop of the plugin). M4 sends darwin no more than 16 steps at a time , thats at full speed at any frequency. Darwin then tacks on a Power level when appropriate to that packet. It tags the power word with a frame to indicate to the driver that its a power command. This looks in hex like this.. 0xfnnf , where nn is the power word from 0 - 100. This entire word is sent to the arduino and when the arduino see's 0xfnnf it will accept the nn part as a power command only if the word is framed by f's, AND it is repeated twice. This is also slowed so the serial is sent at 1/2 kernal frequency. This too was done to try to make the interrupts work better in the arduino.. ( it didnt help much so I may go back to full frequency sending after more experiments. ).
So the end result is a power word that will control typically every 64 steps. In my system I do 250 steps per mm, so thats a base resolution of .25mm per power word. If we go back to the full kernal frequency that will make it .125mm
per power word on my system. Ill wait on that till there are more users of this to improve the protocol..
So if your scoping, the data stream will be 0xfnnf with nn being power. This will be zero when not in an image or when in a white part of an image, it will be 0-100 representing 0-255 of the image data.
Since shifting any f's serially would create a false reading in the nn section , any power divisable by 16 will be bumped by 1 to ensure the protocol is as error free as it can be. Its my thinking a bump of 1 level will be unseen so I havent tried to come up with a tighter protocol. My servos inject a bit more noise than Id like so stepper users should find a higher speed works fine. This is a primary area that needs improving.. so hopefully we'll get some hardware guys with better ideas..
Yes, I deleted the original post - I was too hasty - after Mach4 had been running longer and got further into the image then the serial data in the waveform became evident so my post became redundant. I should have chosen an image where the detail meets all the edges.
Np, its good to have the protocol listed as someone else may want to build an interface far different than my arduino...beagle board maybe, or TI boards. Ill keep no secrets on how things operate and try very hard to get other motion devices to accept such a protocol..or adapt mine to match one the community decides on.
sorry if this sounds a bit daft but her goes
I am a bit confused about what output to use I am using a G540 so only have 3 outputs and one of them is pwm what is 50Hz so I am just unsure what to use for what
A G540 wouldnt work I dont think. Its outputs are prescribed.
Id add a second printer port and use only that for the laser outputs. Thats probably the best solution..
Just tested some new power routines, heres that lighthouse on a granite tile, 300mm x 200mm , with a power gradient of 5% to 70% , it probably should have been a bit lower power.. but its all coming together.
Art
You do not have the required permissions to view the files attached to this post.