Hi

Sorry I didn't come back to report my findings.
The easiest way to do it was by simply adding the - signal in one of the
axis.

So just replicate one of you axis configuration and change the scale signal
should do it.

(even though your example does exactly that, you're also changing the .hal,
which is not necessary)


Fernando
On Fri, Nov 18, 2016, 1:28 PM Dan Simone <[email protected]> wrote:

I found this post as I was having the same trouble.  I'm very new to
Linuxcnc and machinekit so it is entirely possible I don't understand your
directions below.  I tried to follow your instructions below but, maybe I'm
doing something wrong.

I have a gantry style machine where I have two motors and two separate
drivers for the Y axis, one is the Y axis and the other is connected to the
A axis on a probotix PBX-BB.  It is belt driven so I need one axis to turn
the other direction.  I'm using the latest 10-30-2016 jessie machinekit
build and I'm using the probotix hal and ini, specifically the Comet.hal
and the CometNP_Metric.ini files.  I have modified the ini file under
AXIS_1 to have a second SCALE value using the name SCALETWO with the sign
reversed.  Then in my Comet.hal file I have changed the y2 axis to use the
SCALETWO value instead of the SCALE value.  It still doesn't work.  I have
also tried adding an AXIS_3 to the ini file and changing the Comet.hal y2
axis to use AXIS_3 for the scale value.  Neither of these has worked for me
as the motors still turn in the opposite direction before and after the
changes.

Just to further clarify, here is what was originally in the files along
with my edits below:

Original CometNP_Metric.ini file

[AXIS_1]
TYPE = LINEAR
HOME = 320
MAX_VELOCITY = 127.0
MAX_ACCELERATION = 762.0
STEPGEN_MAXACCEL = 952.5
SCALE = -31.4960629921
FERROR = 1
MIN_FERROR = .25

MIN_LIMIT = -3
MAX_LIMIT = 640
HOME_OFFSET = -5
HOME_SEARCH_VEL = -13
HOME_LATCH_VEL = -6
HOME_IGNORE_LIMITS = 1
HOME_SEQUENCE = 1
HOME_FINAL_VEL = 127

Modified CometNP_Metric.ini file

[AXIS_1]
TYPE = LINEAR
HOME = 320
MAX_VELOCITY = 127.0
MAX_ACCELERATION = 762.0
STEPGEN_MAXACCEL = 952.5
SCALE = -31.4960629921
SCALETWO = 31.4960629921
FERROR = 1
MIN_FERROR = .25

MIN_LIMIT = -3
MAX_LIMIT = 640
HOME_OFFSET = -5
HOME_SEARCH_VEL = -13
HOME_LATCH_VEL = -6
HOME_IGNORE_LIMITS = 1
HOME_SEQUENCE = 1
HOME_FINAL_VEL = 127

Original Comet.hal file

# y2-axis
setp hpg.stepgen.02.position-scale [AXIS_1]SCALE
setp hpg.stepgen.02.steplen 2000
setp hpg.stepgen.02.stepspace 2000
setp hpg.stepgen.02.dirhold 35000
setp hpg.stepgen.02.dirsetup 35000
setp hpg.stepgen.02.maxaccel [AXIS_1]STEPGEN_MAXACCEL

Modified Comet.hal file

# y2-axis
setp hpg.stepgen.02.position-scale [AXIS_1]*SCALETWO*
setp hpg.stepgen.02.steplen 2000
setp hpg.stepgen.02.stepspace 2000
setp hpg.stepgen.02.dirhold 35000
setp hpg.stepgen.02.dirsetup 35000
setp hpg.stepgen.02.maxaccel [AXIS_1]STEPGEN_MAXACCEL

Any help is greatly appreciated.


On Tuesday, February 2, 2016 at 4:44:52 PM UTC-5, Charles Steinkuehler
wrote:

On 2/2/2016 3:35 PM, Bas de Bruijn wrote:
>

>> On 02 Feb 2016, at 20:59, Fernando Correa Neto <[email protected]> wrote:
>>
>> Hi there
>>
>> I have a machine that uses two motors on the Y axis and uses a
configuration that derives from the Probotix config.
>> Currently the config loads just fine but the motors are running in the
same direction which is not what I want since it's a belt driven machine.
>> I've tried to revert the polarity of the A axis, which in PBX-BB land
would be:
>>
>> setp bb_gpio.p9-out-27.invert 1
>
> This is not the right way
>
> If you want to change the direction of the motor, you can either swap
some motor wires, or negate the scale in your INI file

If you don't want to swap the motor wires, you can create two scale
values in your INI file.  These are simply definitions that get pulled
into the HAL file for use where/as needed, so just change the name of
the scale parameter for your second motor, and add a corresponding
entry to the INI file with the opposite sign.

-- 
Charles Steinkuehler

[email protected]

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github:
https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to