Y Axis Clone with two motors and two drivers

385 views
Skip to first unread message

john hum

unread,
Dec 9, 2014, 10:59:12 AM12/9/14
to machi...@googlegroups.com
Wondering if anyone can point me in the right direction.  I am attempting to clone my Y axis to A (inverted) using two motors and digital drivers.  I think I am pretty close.

Everything loads ok but when I attempt to move the Y axis I get a Joint 3 movement error.  I figured out what is wrong but do not know how to fix it within the gantry configuration.

On my X axis i removed the following to verify that this is the configuration that I am missing and got the Joint 0 movement error which is what I was expecting.
net motor.00.command pid.0.output [PRUCONF](DRIVER).stepgen.00.velocity-cmd

So within my gantry configuration I need to add the following but can not figure out which command to bind the velocity-cmd to.
 

net motor.01.command pid.1.output [PRUCONF](DRIVER).stepgen.01.velocity-cmd

This is what I currently have for the gantry setup.

##################

## Y AXIS Gantry

##################

net y1pos-cmd gantry.0.joint.00.pos-cmd => [PRUCONF](DRIVER).stepgen.01.position-cmd

net y1pos-fb gantry.0.joint.00.pos-fb <= [PRUCONF](DRIVER).stepgen.01.position-fb pid.1.feedback # ORIG REMOVED NOT SURE IF NEEDED axis.1.motor-pos-fb pid.1.feedback

 

net y2pos-cmd gantry.0.joint.01.pos-cmd => [PRUCONF](DRIVER).stepgen.03.position-cmd

net y2pos-fb gantry.0.joint.01.pos-fb <= [PRUCONF](DRIVER).stepgen.03.position-fb pid.3.feedback # ORIG REMOVED NOT SURE IF NEEDED axis.3.motor-pos-fb pid.3.feedback

----> this is what is failing, i have tried .vel-cmd, .velocity-cmd, .output but I always get the error "gantry.0.joint.01.(vel-cmd | output | velocity-cmd)" does not exist.

----> net y2vel gantry.0.joint.01.output <= [PRUCONF](DRIVER).stepgen.01.velocity-cmd

 

net ypos-cmd gantry.0.position-cmd <= axis.1.motor-pos-cmd pid.1.command

net ypos-fb gantry.0.position-fb => axis.1.motor-pos-fb axis.3.motor-pos-fb

 

## ENABLE Y1 AND Y2

net yenable axis.1.amp-enable-out => [PRUCONF](DRIVER).stepgen.01.enable [PRUCONF](DRIVER).stepgen.03.enable

net yenable pid.1.enable pid.3.enable

Any help would be appreciated.

Thanks,
John

andy pugh

unread,
Dec 9, 2014, 11:16:23 AM12/9/14
to john hum, machi...@googlegroups.com
On 9 December 2014 at 15:59, john hum <john...@gmail.com> wrote:
>
> Wondering if anyone can point me in the right direction. I am attempting to clone my Y axis to A (inverted) using two motors and digital drivers. I think I am pretty close.
>
> Everything loads ok but when I attempt to move the Y axis I get a Joint 3 movement error.


This is basically because you do not have an A axis. You have a Y axis
and two motors.

You can do the "clone" entirely in hardware by running both drivers
from the same step/dir pins. You need to wire the motors differently
to reverse them relative to each other. (swap the polarity of one
phase).

Alternatively drive two sets of step/dir pins from the same joint
position command (optionally with inverted stepgen scales to reverse
one motor).

It looks like you have gone for the second option, but despite the
fact that you don't have an A axis, you are driving the
axis.3.motor-pos-fb pin. As there is no A-axis command from G-code,
the system is not expecting any axis.3 movement, so throws an error.
Just delete that pin reference and you will get a bit further.

--
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto

john hum

unread,
Dec 9, 2014, 11:39:40 AM12/9/14
to machi...@googlegroups.com
Ok thanks Andy.... that makes sense.

I will remove the following and try it once I get home:
net ypos-fb gantry.0.position-fb => axis.1.motor-pos-fb ## REMOVE no A AXIS axis.3.motor-pos-fb

So I am assuming that I do not need the following within the gantry config:
[PRUCONF](DRIVER).stepgen.xx.velocity-cmd

Also is there a way to see all of the available parms for gantry.x.joint.xx.???????? or gantry.x.????.  Within the view HAL config(linuxcnc) you only see the parms that are configured.

Thanks,
John
...

andy pugh

unread,
Dec 9, 2014, 11:47:45 AM12/9/14
to john hum, machi...@googlegroups.com
On 9 December 2014 at 16:39, john hum <john...@gmail.com> wrote:
> Also is there a way to see all of the available parms for
> gantry.x.joint.xx.???????? or gantry.x.????. Within the view HAL
> config(linuxcnc) you only see the parms that are configured.

I don't think that is true.

However, it is often more convenient to open a terminal window and run
"halcmd -kf"
That opens am interactive HAL session which as the enormous advantage
over the "Show HAL config" window in that tab-completion works.

To list pins in a halcmd session the command is (as an example) "show
pin gantry.0.joint*"

Charles Steinkuehler

unread,
Dec 9, 2014, 12:08:34 PM12/9/14
to john hum, machi...@googlegroups.com
On 12/9/2014 10:39 AM, john hum wrote:
> Ok thanks Andy.... that makes sense.
>
> I will remove the following and try it once I get home:
> net ypos-fb gantry.0.position-fb => axis.1.motor-pos-fb ## REMOVE no A AXIS
> axis.3.motor-pos-fb
>
> So I am assuming that I do not need the following within the gantry config:
> [PRUCONF](DRIVER).stepgen.xx.velocity-cmd

The velocity commands are for running the PRU step/dir generators in
velocity mode with a PID controller in HAL.

For the gantry configuration, you need a home switch on each joint. Do
you have that setup?

Otherwise, I couldn't make enough sense of your HAL file snippets to
comment on what might be wrong. Can you post or attach the whole HAL file?

--
Charles Steinkuehler
cha...@steinkuehler.net

signature.asc

john hum

unread,
Dec 9, 2014, 12:46:50 PM12/9/14
to machi...@googlegroups.com
Charles,

Please see attached.  It has the update recommended by Andy. I will see how far I get tonight and post any updates. 

Thanks,
John

On Tuesday, December 9, 2014 9:59:12 AM UTC-6, john hum wrote:
...
XylotexGantry.hal

john hum

unread,
Dec 11, 2014, 10:22:34 AM12/11/14
to machi...@googlegroups.com
So i made the update to remove the reference to Axis.3 but still received the same error.  In order for the error to go away I had to add the following:


net motor.01.command pid.1.output [PRUCONF](DRIVER).stepgen.01.velocity-cmd

This resolved the issue on the Y axis but my mirrored motor Y2 is not moving.  It seems like I need to bind the pid.1.output to both motor.01.command and motor.03.command but could not figure out how to bind the source to two signals.

Also thanks Andy, the halcmd cmd is very nice....


Thanks,
John

On Tuesday, December 9, 2014 9:59:12 AM UTC-6, john hum wrote:
...

andy pugh

unread,
Dec 11, 2014, 10:29:35 AM12/11/14
to john hum, machi...@googlegroups.com
On 11 December 2014 at 15:22, john hum <john...@gmail.com> wrote:
> net motor.01.command pid.1.output [PRUCONF](DRIVER).stepgen.01.velocity-cmd
>
>
> This resolved the issue on the Y axis but my mirrored motor Y2 is not
> moving. It seems like I need to bind the pid.1.output to both
> motor.01.command and motor.03.command but could not figure out how to bind
> the source to two signals.

You probably need, in the motor.03 section

net motor.01.command [PRUCONF](DRIVER).stepgen.03.velocity-cmd

(Or, if you prefer, you can add the stepge,03 to the other line)

Note that, in this case, motor.01.command looks like an "official"
name, but you could call it "nancy" and everything would still work.
The first item after a "net" is a name that you can choose freely. In
this case you might want to call it "both-Y-command" or something.

john hum

unread,
Dec 11, 2014, 5:32:16 PM12/11/14
to andy pugh, machi...@googlegroups.com

Really confused... There are not any commands associated to axis.3 like axis.1.  Axis 1motor-pos-cmd is set to ypos-cmd but axis 3 is empty.  Shouldn't axis 3 be bound to ypos-cmd also since we configured the gantry association.  See attached.

Thanks,
John
--
Sent from myMail app for Android

Thursday, 11 December 2014, 09:29AM -06:00 from andy pugh <bodg...@gmail.com>:

20141211_123252.jpg

andy pugh

unread,
Dec 11, 2014, 6:22:58 PM12/11/14
to john hum, machi...@googlegroups.com
On 11 December 2014 at 22:31, john hum <john...@gmail.com> wrote:
> Really confused... There are not any commands associated to axis.3 like
> axis.1. Axis 1motor-pos-cmd is set to ypos-cmd but axis 3 is empty.
> Shouldn't axis 3 be bound to ypos-cmd also since we configured the gantry
> association.

You don't _have_ an axis.3. Your machine is a 3-axis machine, XYZ,
012. The fact that Y / 1 has two motors doesn't add an axis, it still
gets commands from the "Y" word in G-code.

Axis.3 shows command values associated with the A-word.

john hum

unread,
Dec 13, 2014, 11:01:37 AM12/13/14
to machi...@googlegroups.com, john...@gmail.com
Ok thanks...

I noticed that within the show pin bb_gpio there are not any pins for the XYZ.  If I wanted to invert the dir not step how would I do that.  I tried to load the X Axis and invert it to see what would happen but the pin is not loaded which you would not be able to issue the bbb_gpio.px.out-xx.invert 1/0.  How would I invert the direction of an axis?

Thanks,
John

Charles Steinkuehler

unread,
Dec 13, 2014, 11:06:00 AM12/13/14
to john hum, machi...@googlegroups.com
On 12/13/2014 10:01 AM, john hum wrote:
>
> How would I invert the direction of an axis?

Just invert the sign of the SCALE value to reverse direction.

--
Charles Steinkuehler
cha...@steinkuehler.net

signature.asc
Reply all
Reply to author
Forward
0 new messages