Fiducials, what im I doing wrong?

257 views
Skip to first unread message

Lisandro B

unread,
Jun 2, 2016, 4:52:52 PM6/2/16
to OpenPnP


Jason von Nieda

unread,
Jun 2, 2016, 4:57:41 PM6/2/16
to OpenPnP
Have you look at https://github.com/openpnp/openpnp/wiki/Fiducials? In particular, make sure you've set the units per pixels for your camera and that you have defined the footprint for the fiducial package.

Jason


On Thu, Jun 2, 2016 at 1:52 PM 'Lisandro B' via OpenPnP <ope...@googlegroups.com> wrote:


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/0c5193da-07b0-455d-aa37-60f53a4378d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lisandro B

unread,
Jun 3, 2016, 5:05:11 PM6/3/16
to OpenPnP
That's what been missing, thank you Jason!

Now I have another issue, when I hit the "perform a fiducial check" button, the machine start to travel but it trows the "unable to locate..." message, iven when the machine does not yet reach its final position. I guess this is because the tinyg2  replies "ok" immediately after the G comand was sent, and not when it reach destination...
Any ideas?

g0x200
                                                                         
tinyg
[mm] ok>
                                                               
posx
:0.253,vel:233.19
                                                         
posx
:3.408,vel:1406.74
                                                         
posx
:13.225,vel:3373.25
                                                       
posx
:31.811,vel:5472.03
                                                       
posx
:58.070,vel:6945.98
                                                       
posx
:88.439,vel:7449.81
                                                       
posx
:119.364,vel:7403.76
                                                       
posx
:149.251,vel:6664.70
                                                       
posx
:173.808,vel:4976.52
                                                       
posx
:190.180,vel:2821.86
                                                       
posx
:197.918,vel:1004.79
                                                       
posx
:199.917,vel:101.83
                                                       
posx
:200.000,vel:0.00
     


 

Jason von Nieda

unread,
Jun 3, 2016, 5:09:41 PM6/3/16
to OpenPnP
Lisandro,

Are you using the GcodeDriver or the TinygDriver? If the GcodeDriver, you need to add G4P0 after your G0 / move command. This will cause TinyG to wait to respond until the move is finished. You should probably also turn off position reports with $sv=0 since these will confuse the driver.

If you are using the TinyDriver this should all be handled for you already, so it's possible that something has changed in TinyG. Let me know which you are using and we'll figure it out.

Jasom

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Lisandro B

unread,
Jun 3, 2016, 5:34:34 PM6/3/16
to OpenPnP
txs
disabled the verbosity and added g4p0, same behavior. Im using Gcode as your previous recomendation

<driver class="org.openpnp.machine.reference.driver.GcodeDriver" port-name="COM9" baud="115200" flow-control="XonXoff" data-bits="Eight" stop-bits="One" parity="None" set-dtr="true" set-rts="false" units="Millimeters" max-feed-rate="1000" timeout-milliseconds="5000" connect-wait-time-milliseconds="0">
         
<home-location units="Millimeters" x="0.0" y="0.0" z="0.0" rotation="0.0"/>
         
<command-confirm-regex>.*ok.*</command-confirm-regex>
         
<connect-command>
            $fv
            $clear
            G21
            G90
       
</connect-command>
         
<home-command>
            G28.2 Z0 X0 Y0
            G92 Z0 X0 Y0
       
</home-command>
         
<move-to-command>
         G0 {X:X%.4f} {Y:Y%.4f} {Z:Z%.4f} {Rotation:A%.4f} F{FeedRate:%.0f}
         G4P0
         
</move-to-command>
         
<sub-drivers class="java.util.ArrayList"/>
     
</driver>




2016-jun-03 18:29:55:030 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G28.2 Z0 X0 Y0, -1) => [tinyg [mm] ok>]
2016-jun-03 18:29:55:031 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G92 Z0 X0 Y0, -1)...
2016-jun-03 18:29:55:031 [pool-3-thread-1] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - >> G92 Z0 X0 Y0
2016-jun-03 18:29:56:808 [Thread-7] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - << tinyg [mm] ok>
2016-jun-03 18:29:56:809 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G92 Z0 X0 Y0, -1) => [tinyg [mm] ok>]
2016-jun-03 18:30:23:528 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.vision.ReferenceFiducialLocator  - Chose F4 and F2
2016-jun-03 18:30:23:529 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.vision.ReferenceFiducialLocator  - Locating F4
2016-jun-03 18:30:23:531 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.vision.ReferenceFiducialLocator  - Looking for F4 at (372.346002, 331.451061, -22.000000, 0.111335 mm)
2016-jun-03 18:30:23:532 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G0 X298.1460 Y342.9511  A0.1113 F950, 5000)...
2016-jun-03 18:30:23:532 [pool-3-thread-1] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - >> G0 X298.1460 Y342.9511  A0.1113 F950
2016-jun-03 18:30:23:537 [Thread-7] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - << tinyg [mm] ok>
2016-jun-03 18:30:23:537 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G0 X298.1460 Y342.9511  A0.1113 F950, 5000) => [tinyg [mm] ok>]
2016-jun-03 18:30:23:537 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G4P0, 5000)...
2016-jun-03 18:30:23:537 [pool-3-thread-1] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - >> G4P0
2016-jun-03 18:30:23:540 [Thread-7] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - << tinyg [mm] ok>
2016-jun-03 18:30:23:540 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G4P0, 5000) => [tinyg [mm] ok>]
2016-jun-03 18:30:23:965 [pool-3-thread-1] DEBUG org.openpnp.machine.reference.vision.ReferenceFiducialLocator  - No matches found!
2016-jun-03 18:30:30:241 [pool-4-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G0 X0.0000 Y0.0000   F950, 5000)...
2016-jun-03 18:30:30:242 [pool-4-thread-1] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - >> G0 X0.0000 Y0.0000   F950
2016-jun-03 18:30:30:246 [Thread-7] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - << tinyg [mm] ok>
2016-jun-03 18:30:30:247 [pool-4-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G0 X0.0000 Y0.0000   F950, 5000) => [tinyg [mm] ok>]
2016-jun-03 18:30:30:247 [pool-4-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G4P0, 5000)...
2016-jun-03 18:30:30:247 [pool-4-thread-1] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - >> G4P0
2016-jun-03 18:30:30:250 [Thread-7] TRACE org.openpnp.machine.reference.driver.GcodeDriver  - << tinyg [mm] ok>
2016-jun-03 18:30:30:250 [pool-4-thread-1] DEBUG org.openpnp.machine.reference.driver.GcodeDriver  - sendCommand(G4P0, 5000) => [tinyg [mm] ok>]



Jason von Nieda

unread,
Jun 3, 2016, 5:42:59 PM6/3/16
to OpenPnP
Lisandro,

Judging by the timestamps in the log it seems it's still not pausing to wait for the movement to complete. I know that this worked in the original TinyG, but I can't be sure it works in G2. Maybe G4P1 to see if that fixes it. Perhaps G2 ignores the command if the dwell time is 0. If G4P1 fixes it you can try smaller values, like maybe G4P0.1 so there isn't a long delay after each command.

If this doesn't work we'll have to talk to the TinyG folks and find out what the best way to dwell after a movement is using G2.

Jason


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Lisandro B

unread,
Jun 3, 2016, 5:52:47 PM6/3/16
to OpenPnP
Just figure that out before reading this reply, and tested with no luck, the g2 still replies ok to both lines even before the command ends

g0y200x200
                                                                   
 g4p1
                                                                         
tinyg
[mm] ok>
                                                               
tinyg
[mm] ok>
 

Jason von Nieda

unread,
Jun 3, 2016, 6:22:40 PM6/3/16
to OpenPnP
Okay, I think we'll have to go to the source on this one. I've got a message in to Alden Hart to see if he can help. I'll let you know.

Jason


Lisandro B

unread,
Jun 3, 2016, 6:37:09 PM6/3/16
to OpenPnP
Great!  just in case :
[fv]  firmware version            0.98
                                                                         
[fb]  firmware build             83.08
   



Jason von Nieda

unread,
Jun 3, 2016, 6:41:14 PM6/3/16
to OpenPnP
Well, I have some bad news. I asked Alden how we wait until a movement is complete. Here is his answer:

"You monitor the status reports for stat STOPPED. There is no way in Gcode to determine that, as it wasn't designed for it. This is probably best put on the G2 Issues list."

So, unfortunately this means that the GcodeDriver won't work with G2 as it stands right now. Fortunately, I think we can probably solve this with a pretty simple change to the GcodeDriver. We can turn automatic status reports back on and add a move-complete-regex that searches for "stat:3". 

So, if you'd do me a favor and do something like:

G0X0
$sv=1
G0X10

and then send me the full output from those commands I will get this new regex added this weekend and you should be able to get up and running.  You don't have to do this in OpenPnP, you can use a terminal if that's easier. And it doesn't have to be X0 and X10, just some type of movement that shows the status reports that are generated. The final status report *should* include stat:3, I believe.

Jason



Jason von Nieda

unread,
Jun 3, 2016, 6:56:42 PM6/3/16
to OpenPnP
I filed an issue for this for G2: https://github.com/synthetos/g2/issues/138

Jason

Lisandro B

unread,
Jun 3, 2016, 7:01:59 PM6/3/16
to OpenPnP
I was about to suggest the same thing, for some reason it sound "unrespectful" in my mind ja

The easy fix seems to be  "vel:0.00" so .*vel:0.00.* may be the regex

g0x0
                                                                           
tinyg
[mm] ok>
                                                               
$sv
=1
                                                                         
[sv]  status report verbosity     1 [0=off,1=filtered,2=verbose]
               
tinyg
[mm] ok>
                                                               
line
:0,posx:0.000,posy:0.000,posz:0.000,posa:0.000,feed:950.00,vel:0.00,unit:1,c
oor
:1,dist:0
                   
g0x10
                                                                         
tinyg
[mm] ok>
                                                               
posx
:0.460,posa:0.000,vel:364.42
                                               
posx
:3.492,vel:984.37
                                                         
posx
:7.614,vel:886.01
                                                         
posx
:9.848,vel:175.50
                                                         
posx
:10.000,posa:0.000,vel:0.00
 



Lisandro B

unread,
Jun 3, 2016, 7:04:07 PM6/3/16
to OpenPnP
meant "disrespectful", dont know what the automatic spell checker did there...

Jason von Nieda

unread,
Jun 3, 2016, 7:05:34 PM6/3/16
to ope...@googlegroups.com
Interesting that stat is not shown. Can you try it with $sv=2?

The velocity should work fine too, but I'd rather do it the way Alden suggests if we can. He knows the code best.

Jason


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Lisandro B

unread,
Jun 3, 2016, 7:12:26 PM6/3/16
to OpenPnP
Stat does not show on  sv 2

$sv=2
                                                                         
[sv]  status report verbosity     2 [0=off,1=filtered,2=verbose]
               
tinyg
[mm] ok>
                                                               
g0x0
                                                                           
tinyg
[mm] ok>
                                                               
line
:0,posx:9.540,posy:0.000,posz:0.000,posa:0.000,feed:950.00,vel:364.42,unit:1
,coor:1,dist:0
                                                                 
line
:0,posx:6.508,posy:0.000,posz:0.000,posa:0.000,feed:950.00,vel:984.37,unit:1
,coor:1,dist:0
                                                                 
line
:0,posx:2.386,posy:0.000,posz:0.000,posa:0.000,feed:950.00,vel:886.01,unit:1
,coor:1,dist:0
                                                                 
line
:0,posx:0.143,posy:0.000,posz:0.000,posa:0.000,feed:950.00,vel:172.03,unit:1
,coor:1,dist:0

Jason von Nieda

unread,
Jun 3, 2016, 7:13:55 PM6/3/16
to OpenPnP
Interesting. That seems like that could be a bug perhaps. Well, in any case, I'll add the regex code and you can use velocity for now, until we find something else better.

Jason


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Lisandro B

unread,
Jun 3, 2016, 7:25:18 PM6/3/16
to OpenPnP
I have 3 smoothies on fedex, don't now when they will arrive.


To anybody: Stay away from tinyg2 and DIV268n

Jason von Nieda

unread,
Jun 4, 2016, 12:14:05 AM6/4/16
to OpenPnP
Okay, I've added the new regex. More information here: https://github.com/openpnp/openpnp/blob/develop/CHANGES.md#2016-06-03

Hope this helps!

Jason


On Fri, Jun 3, 2016 at 4:25 PM 'Lisandro B' via OpenPnP <ope...@googlegroups.com> wrote:
I have 3 smoothies on fedex, don't now when they will arrive.


To anybody: Stay away from tinyg2 and DIV268n

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Henrik

unread,
Jun 4, 2016, 3:13:54 AM6/4/16
to OpenPnP
This "move complete" thing has been a bit confusing to me as well. I'm using Smoothie (running dry on a terminal still) and it too responds with OK directly on motion commands. There's a M400 code which I see is being used but it's sent after an already sent motion command, like:

We send a motion command and Smoothie imediately responds with OK, motion starts. Then we send a M400, Smoothie imediately responds with an OK (to ack the M400 command I suppose). Then, when the motion is complete it responds with another OK.

How does this actually work in practice?

/Henrik.

Jason von Nieda

unread,
Jun 4, 2016, 3:25:32 AM6/4/16
to OpenPnP
Hi Henrik,

For Smoothie the M400 causes Smoothie to not respond until the queue is empty, meaning all motion is complete. From their docs: 
M400 Wait for the queue to be empty before answering "OK"

So, when moving via Smoothie we send the movement command which is immediately responded to with "ok" and then we send M400 which does not respond until the previous movement completes.

Are you sure you are seeing two "ok" responses from one command? I have not seen that and that would certainly break things in OpenPnP. Can you post a log?

Jason



--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Henrik Olsson

unread,
Jun 4, 2016, 4:34:28 AM6/4/16
to ope...@googlegroups.com
Jason,
Yes, I thought I understood what M400 was supposed to do but my whole point is that as soon as you send M400 it responds with OK (while the machine is still moving) and then, when the motion is complete, it sends another OK.

From memory:

G0 X10 Y10
OK  (Motion starts)
M400
OK  (Motion still occuring)
OK  (Motion stopped)
G0 X0 Y0
OK

Initially I thought that M400 was a switch kind of thing, permanently (for the duration of the session) setting Smoothie up to not respond with OK until motion completes but it seems as if you need to send it for each command.

And, you obviously can't send M400 prior to a G0/G1 since at that point the queue is empty so it would respond with OK imediately. 

I'm pretty sure it does do this, if it didn't I wouldn't be confused and wouldn't have had to ask, but I'm not at home right now so I can't verify (hopefully I'm just doing something wrong). I'll try to get you a log during the day/evening.

So, yeah, I'm confused but it's apparently working for others using Smoothie so it's likely just something I don't quite understand - hence the question.

/Henrik.
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Jason von Nieda

unread,
Jun 4, 2016, 4:36:54 AM6/4/16
to ope...@googlegroups.com
Henrik,

I verified on my Smoothie that it works as documented. If yours is not working like this we'll definitely need to investigate. 

Jason


Henrik Olsson

unread,
Jun 4, 2016, 7:17:48 AM6/4/16
to ope...@googlegroups.com

Jason,

I’m sorry, false alarm. I don’t know what I was doing last time or if I simply remembered wrong but it seems to work as intended.

The initial motion command gets acknowledged with an ‘ok’ then we send M400 which will respond with another (single) ‘ok’ when the previously issued motion command is completed.

 

Again, I apologize for the confusion.

 

/Henrik.

 


Från: ope...@googlegroups.com [mailto:ope...@googlegroups.com] För Jason von Nieda
Skickat: den 4 juni 2016 10:37
Till: ope...@googlegroups.com
Ämne: Re: [OpenPnP] Re: Fiducials, what im I doing wrong?

Lisandro B

unread,
Jun 4, 2016, 11:21:08 AM6/4/16
to OpenPnP
well, it turns out that  this G2 piece of crap does not allways trows vel0 when command ends. Im tired of fighting with this and will put it on hold until the smoothies arrives

g0y0
                                                                           
tinyg
[mm] ok>
                                                               
posy
:137.660,vel:3613.05
                                                       
posy
:114.046,vel:5363.82
                                                       
posy
:85.288,vel:5916.20
                                                       
posy
:56.262,vel:5800.17
                                                       
posy
:29.839,vel:4750.29
                                                       
x0
                                                                             
tinyg
[mm] ok>
                                                               
posy
:11.482,vel:2855.47
                                                       
posy
:2.167,vel:983.95
                                                         
posx
:0.000,posy:0.000,vel:0.00
                                                 
x10
                                                                           
tinyg
[mm] ok>
                                                               
y10posx
:10.000

                                                               
tinyg
[mm] ok>
                                                               
posy
:10.000
 



As allways, Im very gratefull to you Jason and insist with this advice to everybody STAY AWAY OF Tiny G2!!! nothing but headache!

I know that I can go and dig the code and fix it to my needs, but there are a ton of things implied in setting up any kind of cnc and this is a time not well spent


Jason von Nieda

unread,
Jun 4, 2016, 1:00:47 PM6/4/16
to ope...@googlegroups.com
No worries, glad it's working!

--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Jason von Nieda

unread,
Jun 4, 2016, 1:02:35 PM6/4/16
to ope...@googlegroups.com
Lisandro,

I was afraid of that. That's actually why I was wanting to use status instead of velocity. I thought I remembered way, way back in my TinyG v1 days that it would not always send a velocity = 0 at the end.

I've filed two issues about this with TinyG, so we'll see if anything comes up. And as you've painfully discovered, for now it's probably best to stick with Smoothie :)

Jason


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Jason von Nieda

unread,
Jun 4, 2016, 6:29:53 PM6/4/16
to ope...@googlegroups.com
Hi Lisandro,

Alden responded regarding the missing stat field. Looks like this is configurable:


Jason

Reply all
Reply to author
Forward
0 new messages