Hi everyone, Complete newb here. I have Spark Concepts xPro v4 board. I am using the motor to do a basic 6" linear movement then come back to the start. All I want to be able to do is connect a button to the 'start/play' button on the board and have the program execute. I am able to run the program from OpenBuilds control and the motor will turn. However, when I press the button, nothing happens. I do get a notification in the console that the button was pressed, but the code doesn't execute. Any ideas? I have posted the G-code below. ; GCODE Generated by cam.openbuilds.com on 2019-06-11 G21 ; mm-mode ; Operation 0: CNC: Vector (no offset) ; Tool Diameter: 6.35 G0 Z0 G0 F1000 X0.0000 Y0.0000 G0 Z0 G1 F300 Z-1.0000 G1 F15000 X150.0000 Y0.0000 Z-1.0000 S1000 G1 F15000 X150.0000 Y0.0000 Z-1.0000 S1000 G1 F15000 X0.0000 Y0.0000 Z-1.0000 S1000 G1 F15000 X0.0000 Y0.0000 Z-1.0000 S1000 G1 F15000 X0.0000 Y0.0000 Z-1.0000 S1000 ; retracting back to z-safe G0 Z0
Interesting. It doesnt start the job, but it will resume a paused job. While job is running is wont pause a job. @Peter Van Der Walt what say ye?
Grbl's cycle start needs something in Grbls own queue 'to start'. Ie Resume, not really Start as you'd imagine. So typically youd preface the gcode with a feedhold or M0 Start sending gcode (it sits in hold status) Walk up to machine and hit Cycle Start to begin processing if you want to use is as a start. As per gnea/grbl
Thanks guys. So, I put a feed/hold (!) at the start. The program paused, and the start button worked. Now, is there a way to repeat the program? I would like it, once it completes its cycle, to start running the code again, encounter the feed/hold, then wait for the start/resume. I am using this on a carriage, where the start/resume is controlled by a PLC. Thus, I need the program to be able to cycle continuously. Thanks again!
If your use case is Automation, i'd skip Grbl and GCode and just use Arduino? OpenBuilds/ArduinoStepperDriver for example if its just one axis
Normally, yes, we would use a different stepper with a controller that has built in programming capabilities. However, we decided to buy the whole kit, with the linear slide, for a prototype. If I'm not able to do a program loop, I'll probably have to go back to a different controller/motor.
The XPRO is just an arduino with onboard steppers. You can change that example sketch above only slightly (run only if triggered, not inside the loop) Arduino Button Tutorial could be adapted to react to the input from the PLC Next up, define the step/dir/enable pins according to the pinout from gnea/grbl (Whichever axis you are using for your slide) Upload to the XPRO (May need the atmgea328pb board type installed: MCUdude/MiniCore