Home › Forums › TinyG › TinyG Projects › TinyG for Android
Tagged: android, android accessory, Arduino, TinyG
- This topic has 54 replies, 5 voices, and was last updated 8 years, 2 months ago by mcgyvr.
-
AuthorPosts
-
March 5, 2013 at 5:14 am #3864aldenMember
Matt,
Good progress. Have you tried the bootloader in dev? You might also consider reflashing your mkii with a new firmware.
Alden
April 23, 2013 at 12:48 pm #4048mcgyvrMemberMatt, (or others who know already)
Just wondering if this Android app will work for my application.. Not sure where Matt stopped or if he is even currently still developing it but I just now saw the video and thought it would be perfect for my machine. My machine is a cnc controlled staking machine where you place a circuit board on the cnc controlled xy table, place a few standoffs into specific holes in the circuit board and then hit go.. The machine will move the circuit board so the first standoff is under a pneumatic cylinder and then the cylinder is triggered and will “flare” the standoff securing it to the circuit board.. Then the machine moves to the next xy position and repeats the process again and again till done..
But my questions so far are…
#1-Do you need to have an arduino ADK board for this app to work? Or is just the TinyG and a tablet all that is needed.. I was a little confused about what hardware was required or if the Arduino board was for “other features” or something. I just want the ability to walk up to the machine, plug in the tablet to the tinyg board, load a gcode file and hit run.. (then run again..then again and again and again). So can the app talk directly to the tinyG board or is an intermediate arduino adk board needed and for what?
If I need an android adk board then fine but wasn’t sure what it was needed for if at all.
#2- Does the current app thats up on the app store have this basic functionality working already? Just load a gcode file that is saved on the tablet and be able to run it?
This is for a “professional” in-house project that I will not have hours and hours to rewrite/fix code,etc.. I basically need a plug and play solution (a little tinkering is fine) but in general I won’t have the luxury of spending days fiddling with stuff/hoping you release an update,etc…
I did download the app and it looks like its “in working order” but wasn’t sure if most of that is just “pretty button placeholders” waiting for it to be finished. Like I said I ONLY need homing, and the ability to load gcode and hit run.
April 23, 2013 at 1:29 pm #4049greyhound716Membermcgyvr,
Your timing is perfect, since I just sat down to review were things stand with the app. I have about a 3 week lull in another project, so I’m cycling back to TinyG.
Part of the confusion stems from my demo videos being for several different projects. Let me try to answer your questions:
#1. No, Arduino ADK board is not required for the app to work. What works and has been tested with the app thus far is using the Android in USB host mode (using a “on the go” cable, or with a tablet that has a USB-A female connector), or using a network link to a serial-to-network interface (a PC, an old network printer interface, whatever).
#2. Most of what you want is working right now. I’ve been pretty happy with the gcode streaming thus far, but the UI needs some work. For example, there isn’t a good way right now to interrupt the streaming for a gcode file, or to measure progress. When changing system settings, there is sometimes a need to exit and reenter the app to get the new state. But if all you’re looking for is repetitive gcode pushing, it does the job. What it doesn’t have is an option to initiate a homing cycle.
I’m willing to work with you to add the homing capabilities if you want to give it a shot. You’ll need to judge if the system is to the point where you want to invest the money to test it out.
There’s one other option that you might want to consider, and that’s using an AVR board as a very simple gcode streamer. One of my videos essentially does that for a different project. If you don’t really need any status info and you just want to push gcode, pulling that off of an SDcard and pushing out a wired serial interface to TinyG is super easy. You don’t even need the tablet in this case, and you can use a very simple AVR board. If you want to kick that around more or talk about your specific project, you can email me at stock@bexkat.com.
April 23, 2013 at 2:06 pm #4051mcgyvrMemberwow.. cool… excellent work by the way.. (noticed I didn’t say that in my first post) “Tablets” are the wave of the future..Everything is on them now.. Labview/sesnor networks/machine status,etc.. its all moving to a portable tablet type device so cnc control going that way is right on track IMO.. You sir.. are ahead of the game even.. I just showed the app to our Haas CNC machinist and he would LOVE to be able to sit down and program like that versus the giant clunky Haas programming console.
There is a “home” button on the app.. Does that not work now? Or is that just to go to what it thinks is 0,0 and not perform an actual homing process.
We all use tablets here to get drawings/work instructions,etc.. so the ability to just use the same tablets and walk over to this machine and “drive” it from the same tablet would be the direction I want to go versus something else..
We have about 20 x Asus Transformer 101 tablets that we all use. They do not have usb ports but I have an accessory that allows you to have a USB 2.0 port where the asus specific connector goes.. (this is what I have.. http://www.amazon.com/ASUS-External-Adapter-Transformer-Series-Tablets/dp/B005PAINXQ/ref=sr_1_1?ie=UTF8&qid=1366739320&sr=8-1&keywords=epad+usb+extension#productDescription )
We originally bought it to allow external webcams to work with the tablets..(and it does perfectly).
So I suspect I can simply use that to connect to the TinyG board..
I believe homing is a must for me though.. I believe the operators will need to turn the machine on then perform a homing procedure somehow to get started.. I do not want to attach this to a regular computer at all.. My first thought was to use “gecko” drivers and run it all from an arduino/chipkit board but then I saw TinyG and your app and obviously am now headed in this direction.
I’m far from a programmer so I can’t help there (a little php/asp/jquery/arduino stuff here and there but thats it..enough to be dangerous) .. but I plan to have hardware (tinyg/linear guides/steppers,etc..) in the next week or so and can do any physical testing needed once it all arrives..
So yes.. I really want to continue in the tablet direction and would be willing to help/offer suggestions,etc.. on whatever I can.
April 23, 2013 at 2:41 pm #4052greyhound716MemberThat interface should work fine. In fact, I need to pick on up myself to play with…
If I recall correctly (I need to pull up the app and start cleaning things up tonight), there is a “zero” button that sets the current position to the origin, and the “home” button does a g0x0y0z0 move. What I haven’t implemented/tested is the homing operation using the limit switches from an unknown start state.
It’s funny that you say your CNC guy wants to use the software… I’m working on some commercial projects to potentially do just that. The interfacing software I’m putting together has the potential to work for more than just TinyG.
When you get your hardware, shoot me an email. In the meantime I’ll work on some code cleanup.
-MattMay 1, 2013 at 11:16 am #4073aldenMemberThere are a number of things you might want to do for “Homing”. depending on what you need.
Going to G0x0y0z0 is fine if your machine is already referenced to zero, but does not actually reference it.
Doing G28.2x0y0z0 will actually reference the machine to zero using the homing switches – assuming you have that all set up
Going G28.3×0 will set the current point as absolute 0 (brrr) for X. G28.3x0y0z0 for all 3 axes, or G0x50 will set the current to 50, etc.
G28.2 and G28.3 are “non-standard” extensions to Gcode to handle these cases. Look at G28 and G28.1 (and G30/G30.1) to see how they are used. They also set and return to specific points.
See https://github.com/synthetos/TinyG/wiki/TinyG-Homing
Alden
- This reply was modified 11 years, 8 months ago by alden.
May 2, 2013 at 11:49 am #4075mcgyvrMemberJust throwing out some requests to add to the TinyG Console App..
#1-Homing button (actually performs the homing process w/limit switches)
#2-Spindle On/Off button (I guess a speed slider and direction toggle too)
#3-Coolant On/Off button
#4-A button for each axis to set the current position to 0
#5-Feed Hold button
#6-TinyG reset (is there a command line function for that??)
#7-Jog lock button (Its a HAAS thing I believe but really nice to have)
You press the jog lock button then press an axis jog button and it moves the axis in a continuous motion without the need to hold down the axis key. Another press of JOG LOCK stops jogging motion. Not positive how limit switches in tinyG function but on our Haas if you just leave jog lock running it will simply hit the limit switch and stop..Not sure if TinyG automatically resets when a limit switch is hit. I’d hope not as IMO it should just issue an error (or just stop when jog lock is used) and not reset completelyOthers..
A text area (with a send button or something) to manually enter a G code (single line/function) and send it.- This reply was modified 11 years, 8 months ago by mcgyvr.
May 2, 2013 at 12:00 pm #4077aldenMemberThanks for the input. Some comments – although I’m not the one actually coding the UI, so consider it guidance.
#1-#4 should all be quite doable with the current command set
#5 You will also need a Cycle start button to get it out of feed hold. Probably best not to just toggle a button, as a misfire could have bad consequences. CNC pro’s know what Feed Hold and Cycle Start are. People new to the domain may not know. I’ve see this labeled as “Pause” and “Resume” in 3D printer-land. No satisfying everybody. Labeling is an open question.
#6 Reset from software is control X, aka CAN (cancel), aka 0x18 in hex.
#7 Interesting. If you leave it on and it hits a limit switch it will put the machine in shutdown – which is what limit switches are supposed to do – all bets are off. If you don’t have limit switches it will continue to grind away at your machine / motors.
#8 Text area is very useful to send configs or query position or configs manually. But now you are into terminal emulator mode. Just saying. You also need to be mindful of text_mode / JSON_mode switches. These transition automatically based on the first characters of the line. See the wiki for details.
–Alden
May 2, 2013 at 12:35 pm #4078greyhound716MemberThese are great suggestions.
I will look at adding #1-6. I don’t have limit switches on my current test setup (I’m thinking about replacing it, but no time to design), but I can implement the functionality for you to try out.
#8 I was planning to do as well, simply because I’ve had to interact with the device on occasion and I didn’t have a button that I could press. To address some of Alden’s concerns, I was looking to use that text box as pure gcode input – it would be wrapped JSON and sent. I probably would not have it be used for config changes, at least without more input checking.
-MattMay 2, 2013 at 12:44 pm #4079greyhound716MemberOh, regarding #7… I can easily add the capability, but I wonder if it should only be available if the system is configured for limit switches. Alden, do you think I could query the limit switch configuration to determine that? Or are the default values have them “enabled?”
-MattMay 2, 2013 at 12:50 pm #4080aldenMemberYou don;t need to wrap Gcode in JSON. The input parser figures that anything that’s not already accounted for must be a Gcode command and runs it as Gcode (Technically, if you are in JSON mode the parser wraps the Gcode for you then runs it as JSON Gcode. That way the responses com back in JSON wrappers). It’s written this way so that UIs don’t need to wrap Gcode from a file – it can just be streamed.
You can query limit switches (or any other parameter) using JSON. For example, {“xsn”:””} returns the X min limit switch setting.
–ALden
- This reply was modified 11 years, 8 months ago by alden.
May 2, 2013 at 12:59 pm #4082greyhound716MemberI realize you don’t have to, but if you DO wrap it in JSON explicitly, most of those text mode/JSON mode issues and error parsing things go away, don’t they? I want to rely on the existing JSON parser for the UI to figure out SR information, error codes, etc. If sending raw gcode text doesn’t kick it out of JSON mode, I guess I’m fine either way.
-MattMay 2, 2013 at 1:15 pm #4083aldenMemberIt could be done either way. The switch between JSON and text mode is automatic and is meant to be as seamless as possible. But if you wrap your own JSON as you suggest it ensures that when you do drop back from the terminal to streaming Gcode you will get JSON responses back; so it’s a good idea for your application.
May 2, 2013 at 1:21 pm #4084greyhound716MemberOh, I realize we’re thinking about the use of this “text box” differently. You’re thinking of it as more like a mode – you’re either in raw text mode or not, and I’m thinking of it as a line by line operation, without any responses from TinyG. In other words, you type in “g0x-40y33” and hit send/enter, but the GUI is what gets and parses all of the responses. The text box is cleared of your initial input, and you are free to type something else in or press a different control button.
Both styles are valid, I just wanted to avoid all of the terminal-like issues you mentioned by keeping it simple.
Anyone have an opinion on what they’d rather see?
-MattMay 2, 2013 at 1:28 pm #4085aldenMemberYou can eliminate most of the uses for a text line/box if you have controls in the UI. What are you doing for configuration? One nice way is a grid of all 6 axes by parameter available for display and typing – with the unused parameters greyed out depending on what the axis supports. The JSON back and forth is just handled reactively (event driven). Do the same for motors, and then handle system params and with that and #1 – #7 you have almost all cases covered in the native UI. I assume you are already doing position readouts. You can use SRs to do real-time path drawing as well.
–Alden
-
AuthorPosts
- You must be logged in to reply to this topic.