Home › Forums › TinyG › TinyG Support › Motion suspend or stop when the switch is on & TinyG communication programming
- This topic has 9 replies, 4 voices, and was last updated 9 years, 1 month ago by Bill.
-
AuthorPosts
-
September 24, 2015 at 2:47 am #8774BillMember
Hello everyone,
I am doing a project using TinyG V8. According to the project requirement, we will design a cabin as the work station, TinyG board and motors are put in this cabin. There is a door for this cabin, When we open the door, the switch is pressed on, the motors suspend working or can’t work. When we close the door, the switch is released off, the motors resume working or ready to work. In this project, we use axis X, Z and A, only axis Y is free now. So could we use Y min or max switch as the door switch to control the motion? If we can do such, how can we do and what kind of operation we need do?
We think it is not convenient for Coolterm and Chillipeppr to send GCode file to TinyG during mass production. We need just like a very simple window that only has one button, when this button is clicked, a set of motion is completed one time, if clicked again, the motion is done again. Can Coolterm and Chillipeppr do it? If they can’t do it, I have to program to communicate with TinyG, what kind of tool and development environment you recommend?
Thanks!!
Best regards
Bill
September 24, 2015 at 7:05 am #8776cmcgrath5035ModeratorOn quick read, your project is more like a CAM layer application than a machine control application, which is tinyG’s role in life.
Give this Wiki item a good readCurrent FW for tinyGV8 is FV=0.97.
tinyG2, the next generation, implements an evolving (daily) implementation of FV=0.98. Some of the FV=0.98 functionality is being back-ported to tinyG, if the hardware can do it, but perhaps not in your time frame.Your challenge is that switch I/O on tinyGV8 is somewhat limited. Limit switch operation is treated like a fatal error, shutting down the processing.
Be aware that the tinyGFW uses most available physical memory space and cpu cycles, so extensive reworking FW code might be challenging. The broadly supported command interface is Gcode. Many folks have or are developing scripted interfaces via python code or ChiliPeppr Macros.
It is also possible to build a new widget in CP that leverages all the resource management available in the current application.September 24, 2015 at 10:52 pm #8777BillMemberThanks for your answer!!
When are you going to release the TinyG2 and firmware 0.98?
If we use LabView as interface developing tool, is it possible?
September 25, 2015 at 5:33 am #8778aldenMemberThe g2 code base is available now on the Synthetos github, g2 repo. Currently there is no Synthetos board for sale that runs it, but it runs on the Arduino Due. A gShield will provide 3 motors, but all 6 axes are available on the Due.
The 0.98 version is available for TinyG v8 boards, but it is still in the edge branch and should be considered under development.
September 25, 2015 at 7:20 am #8779cmcgrath5035ModeratorBill
If tinyG2 running on a DUE plus a shield meets your project criteria, it will likely be a much more development friendly experience.
The G2 development environment is well documented, the DUE has more flexible I/O and you can easily prototype using Arduino/Atmel tools.LABview ? I’m not all that familiar with it’s interfaces and capabilities.
Most developers here work in C/C++ (tinyG2) and/or JS (Chilipeppr), plus many are doing personal CAMs using python and other scripting .Review the G2 Wiki at
September 28, 2015 at 1:54 am #8783BillMemberThanks for your answer!!
I am testing the limit switch of Y axis. The configuration are following:
$YSN=2
$YSX=2
the other parameters use the default value.When I send single command, for example:
G1 X100 Z100 A90 F400I turned on the Y limit switch(I use a switcher to simulate) during the motors are driving. All the motors can stop and the LED of SpDir on board can flash. It looks like normal. Then I send a text file that contains 25 GCode commands(the samiliar as the above command), I turn on the Y limit switch after around 5 seconds, the SpDir LED is not flashing and the board doesn’t go to the Reset status, the GCode is still executed and the motors is still running.
I feel very strange, it looks like the firmware doesn’t respond the limit switch during the batch commands executed. Could you please give me any suggestion?
Thanks!!
Bill
September 28, 2015 at 6:57 am #8786cmcgrath5035ModeratorWhat you describe does sound strange.
When I send single command, for example:
G1 X100 Z100 A90 F400I turned on the Y limit switch(I use a switcher to simulate) during the motors are driving. All the motors can stop and the LED of SpDir on board can flash. It looks like normal.
What steps do you take to bring tinyG back to an operating state?
A reset?
Are you using tinyGV8 or tinyG2?
If tinyG2, a reminder that parameter changes are not persistent, a board reset is same as a $defa=1 command when running tinyGV8. Therefore, when running tinyG2, when recovering from alarm/limit state, all parameter changes must be reentered.Then I send a text file that contains 25 GCode commands(the samiliar as the above command), I turn on the Y limit switch after around 5 seconds, the SpDir LED is not flashing and the board doesn’t go to the Reset status, the GCode is still executed and the motors is still running.
September 28, 2015 at 3:43 pm #8788jlauerMemberWhy don’t you just use Serial Port JSON Server (SPJS), which is what ChiliPeppr uses, and then bind in direct to SPJS over a websocket from your favorite language like Java, Python, etc. Then just send commands into the websocket like:
open COM7 115200 tinyg
when the door is open, send pause
“send COM7 !”when the door is closed again, send resume
“send COM7 ~”September 28, 2015 at 7:21 pm #8789BillMemberWhat you describe does sound strange.
A: I think the strange is I send one GCode command and a batch of GCode commands, the result is different when I trigger the limit switch. When I send one command, it can act correctly, but a batch of commands, it can’t.What steps do you take to bring tinyG back to an operating state?
A reset?
A: I will press the reset buttonAre you using tinyGV8 or tinyG2?
A: I am using TinyG V8, firmware is 0.97, the tool is cooltermSeptember 28, 2015 at 8:10 pm #8790BillMemberWhy don’t you just use Serial Port JSON Server (SPJS), which is what ChiliPeppr uses, and then bind in direct to SPJS over a websocket from your favorite language like Java, Python, etc.
A: for one reason, this tool is for worker in factory, the same operation need repeat lots of time a day. So we need only one window and one button for this project. Another reason, the other tools the factory are using are also developed by LabView, we prefer the same language.open COM7 115200 tinyg
when the door is open, send pause
“send COM7 !”
when the door is closed again, send resume
“send COM7 ~”
A: is this is TinyG commands or JSON server commands?Thanks for your answer!!
-
AuthorPosts
- You must be logged in to reply to this topic.