Z-axis does not move correct distance - No cam on Z-axis

268 views
Skip to first unread message

Michael Hamilton

unread,
Jul 25, 2016, 4:11:43 PM7/25/16
to OpenPnP
I am using a desktop cnc machine connected to a smoothieboard to place components. I am also using Windows 8.1.

I can connect to the smoothieboard with serial and send gcode such as G0 Z1.0 and the Z-axis will move exactly 1mm. X and Y axis also work fine.

When I use the jog panel in openpnp to move the Z-axis I get unusual movements. X and Y work fine.

In the machine.xml file I see the following line:

<driver class="org.openpnp.machine.openbuilds.OpenBuildsDriver" port-name="COM5" baud="115200" flow-control="Off" data-bits="Eight" stop-bits="One" parity="None" set-dtr="false" set-rts="false" feed-rate-mm-per-minute="500.0" z-cam-radius="24.0" z-cam-wheel-radius="9.5" z-gap="2.0" home-z="false"/>

I don't have a cam in between my z-axis stepper and the PNP head. Instead, I have my PNP head mounted directly to a plate which is driven by a lead screw connected directly to my stepper. My question is what should the following items be set to in order to remove the cam:

z-cam-radius=?
z-cam-wheel-radius=?
z-gap=?

My leadscrew on X, Y and Z are all the same pitch and connected directly to their respective stepper.

Jason von Nieda

unread,
Jul 25, 2016, 4:14:37 PM7/25/16
to OpenPnP
Michael,


Especially my last post showing step by step instructions to use the GcodeDriver.

You cannot use the OpenBuilds driver if you don't have a cam drive. That's the bottom line. The OpenBuilds driver has special logic for handling a cam and simply will not work with a linear drive.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/7c721442-75c1-48be-acd0-3383c1566e5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Hamilton

unread,
Jul 25, 2016, 4:16:29 PM7/25/16
to OpenPnP
Sorry, I see the answer to my question. You are supposed to use the gcode driver instead of the openbuildsdriver.

Michael Hamilton

unread,
Jul 25, 2016, 9:02:07 PM7/25/16
to OpenPnP
Thanks for your response. I followed your advice and now have everything working! What an amazing piece of software you wrote.

Michael

Jason von Nieda

unread,
Jul 25, 2016, 9:04:52 PM7/25/16
to OpenPnP
Glad to hear it Michael, that is great news!!

Jason


Jason von Nieda

unread,
Jul 25, 2016, 9:37:31 PM7/25/16
to OpenPnP
Michael,

Would you mind posting your machine.xml, or at least the GcodeDriver section? This will help others get their machines running too.

Thanks,
Jason

Michael Hamilton

unread,
Jul 27, 2016, 11:12:41 PM7/27/16
to OpenPnP
Here is my machine.xml, but I found a new problem. Sometimes, when I am jogging the machine around I get a M400 timeout as shown in the attached picture. In this example, I jogged the machine using the gui control panel 100mm in the +X direction which generated a N1.moveTo((-23.400000, command. The machine moved over 100mm. Then I tried to jog the machine in the -X direction just 1mm. This generated a N1.moveTo((-124.400000, which caused the machine to move in the -X direction -101mm. It also generated the M400 timeout message as displayed. This is my problem. It should have generated a N1.moveTo((-24.400000, command instead of the N1.moveTo((-124.400000, command. Do you know why this is happening? How should I troubleshoot the problem?

Notice the last calculated moveTo location is off by 100 mm.
machine.xml
M400 Timeout.png

Jason von Nieda

unread,
Jul 28, 2016, 4:08:21 PM7/28/16
to OpenPnP
Michael,

During that last move, before the timeout, was the machine in motion the whole time? Is it possible the move took over 5 seconds for any reason?

Also, is this reproducible and repeatable? Or was it a one time issue?

Jason


Michael Hamilton

unread,
Jul 28, 2016, 10:51:37 PM7/28/16
to OpenPnP
It appears the speed I was using takes more than 5 seconds to move 100mm. I am using the slow speed to keep the movements as precise as possible without loosing steps.

When you get a timeout then the problem occurs on the following move.

How do I increase the timeout from say 5 seconds to 10 seconds?

Jason von Nieda

unread,
Jul 28, 2016, 11:12:15 PM7/28/16
to OpenPnP
On the driver line in machine.xml, look for timeout-milliseconds="5000" and change that to 10000.

Jason


matt

unread,
Jul 29, 2016, 1:08:21 AM7/29/16
to ope...@googlegroups.com
Its a shame the driver can't be polled and say, hey i'm busy give me a
bit longer.. I've been thinking about this - the problem being, i think,
is if a certain operation takes a long time, your going to end up with a
massive time out value thats not really suitable for shorter operations?
>> [1]
>>
>> Especially my last post showing step by step instructions to use the
>> GcodeDriver.
>>
>> You cannot use the OpenBuilds driver if you don't have a cam drive.
>> That's the bottom line. The OpenBuilds driver has special logic for
>> handling a cam and simply will not work with a linear drive.
>>
>> Jason
>>
>> On Mon, Jul 25, 2016 at 1:11 PM Michael Hamilton
>> <mikeh9...@gmail.com> wrote:
>>
>> I am using a desktop cnc machine connected to a smoothieboard to
>> place components. I am also using Windows 8.1.
>>
>> I can connect to the smoothieboard with serial and send gcode such
>> as G0 Z1.0 and the Z-axis will move exactly 1mm. X and Y axis also
>> work fine.
>>
>> When I use the jog panel in openpnp to move the Z-axis I get unusual
>> movements. X and Y work fine.
>>
>> In the machine.xml file I see the following line:
>>
>> <driver class="org.openpnp.machine.openbuilds.OpenBuildsDriver"
>> port-name="COM5" baud="115200" flow-control="Off" data-bits="Eight"
>> stop-bits="One" parity="None" set-dtr="false" set-rts="false"
>> FEED-RATE-MM-PER-MINUTE="500.0" Z-CAM-RADIUS="24.0"
>> Z-CAM-WHEEL-RADIUS="9.5" Z-GAP="2.0" home-z="false"/>
>>
>> I don't have a cam in between my z-axis stepper and the PNP head.
>> Instead, I have my PNP head mounted directly to a plate which is
>> driven by a lead screw connected directly to my stepper. My question
>> is what should the following items be set to in order to remove the
>> cam:
>>
>> z-cam-radius=?
>>
>> z-cam-wheel-radius=?
>>
>> z-gap=?
>>
>> My leadscrew on X, Y and Z are all the same pitch and connected
>> directly to their respective stepper.
>>
>> --
>> 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/7c721442-75c1-48be-acd0-3383c1566e5c%40googlegroups.com
>>> [2].
>>> For more options, visit https://groups.google.com/d/optout [3].
>
> --
> 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/ae213f37-8846-46dc-afb4-8616e9b61425%40googlegroups.com
>> [4].
>> For more options, visit https://groups.google.com/d/optout [3].
>
> --
> 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/80cb0e57-c880-479e-9762-0f831d701040%40googlegroups.com
>>> [5].
>>> For more options, visit https://groups.google.com/d/optout [3].
>
> --
> 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/5965c282-503a-46b3-8f43-b1fd7616c230%40googlegroups.com
> [6].
> For more options, visit https://groups.google.com/d/optout [3].
>
> --
> 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/CA%2BQw0jw8gv5biso5L40%3De9cG%2BEgSk%2BCmXOtDiw_uW7fpns-8ow%40mail.gmail.com
> [7].
> For more options, visit https://groups.google.com/d/optout [3].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/forum/?utm_medium=email&amp;utm_source=footer#!msg/openpnp/JRPeMGWjEwo/uW6yliOJCQAJ
> [2]
> https://groups.google.com/d/msgid/openpnp/7c721442-75c1-48be-acd0-3383c1566e5c%40googlegroups.com?utm_medium=email&amp;utm_source=footer
> [3] https://groups.google.com/d/optout
> [4]
> https://groups.google.com/d/msgid/openpnp/ae213f37-8846-46dc-afb4-8616e9b61425%40googlegroups.com?utm_medium=email&amp;utm_source=footer
> [5]
> https://groups.google.com/d/msgid/openpnp/80cb0e57-c880-479e-9762-0f831d701040%40googlegroups.com?utm_medium=email&amp;utm_source=footer
> [6]
> https://groups.google.com/d/msgid/openpnp/5965c282-503a-46b3-8f43-b1fd7616c230%40googlegroups.com?utm_medium=email&amp;utm_source=footer
> [7]
> https://groups.google.com/d/msgid/openpnp/CA%2BQw0jw8gv5biso5L40%3De9cG%2BEgSk%2BCmXOtDiw_uW7fpns-8ow%40mail.gmail.com?utm_medium=email&utm_source=footer

Jason von Nieda

unread,
Jul 29, 2016, 3:37:13 AM7/29/16
to ope...@googlegroups.com
Matt,

Yea, ideally we would get there for all the supported motion controllers. We do this with TinyG currently, using the move-to-complete-regex. 

There is a plan to have position tracking added eventually, which would get us there, too. This is mentioned in Release 3.

Jason


SMdude

unread,
Jul 29, 2016, 5:41:37 AM7/29/16
to OpenPnP
In the gcode driver section, you could adjust the timeout milliseconds on the fly.
Then for each move, depending on how far the move was, the timeout could be set to allow enough time for even the slowest longest of moves.

timeout = (distance to move/speed)*1000 +1000ms
                          mm        /   mm/s * convert seconds to milliseconds + a bit extra
Then after the move is complete, you could even go as far as reloading timout with the default value

Ray Kholodovsky

unread,
Jul 29, 2016, 11:36:49 AM7/29/16
to OpenPnP
Jason - 
Peter van der Walt's LaserWeb3 does a constant polling of the smoothie to know the position and this seems to work fairly well.  I don't know of the exact command they are using but I know that the support for this was added to the firmware in one of the later releases these last few months.  Worth looking into?  
In response to how matt described it, the driver would never say I'm busy, you would just be getting position feedback and if position A 1+ position B a certain time delay later, the host software would know that the machine is busy but responsive.  

Jason von Nieda

unread,
Jul 29, 2016, 11:56:40 AM7/29/16
to OpenPnP
Ray,

Yea, that's what I mentioned in my previous message. Forgot to include the link: https://github.com/openpnp/openpnp/issues/106

This is mentioned in the "Release 3" section.

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.
Reply all
Reply to author
Forward
0 new messages