Simple invert on the X/Y/Z dir pin - BBB + Xylotex DB25

132 views
Skip to first unread message

Mr Molina

unread,
Dec 2, 2015, 2:15:18 AM12/2/15
to Machinekit
Hello all,

I´ve been discussing this with Sarah, and searching, but haven´t come accross a definitive answer on how to invert the logic on the DIR pins.

The thing is, the pin (p8.out-11 for X, for example) is being used by STEPGEN (setp hpg.stepgen.00.steppin 0x4C), and so if I just use:

setp bb_gpio.p8.out-11.invert 1

as suggested by Sarah, I get:

Xylotex.hal:318: parameter or pin 'bb_gpio.p8.out-11.invert' not found
Shutting down and cleaning up Machinekit...

I figured I had to put 111 among the "loadrt hal_bb_gpio output_pins=" part of Xylotex.hal file, and when I get it to work the motor just moves in one direction.
I wonder if this behavior is because I´m inverting a pin being use with STEPGEN already? Or do I need to invert something else also?

Anyway, I´m trying to grasp the logic of how to set this up but I´m quite confused, would appreciate some clarification.
I just wanna change polarity on the DIR pin on Xylotex.


Thanks,


Diego

Bas de Bruijn

unread,
Dec 2, 2015, 3:14:10 AM12/2/15
to Mr Molina, Machinekit




On 02 Dec 2015, at 08:15, Mr Molina <mrdm...@gmail.com> wrote:

Hello all,

I´ve been discussing this with Sarah, and searching, but haven´t come accross a definitive answer on how to invert the logic on the DIR pins.

The thing is, the pin (p8.out-11 for X, for example) is being used by STEPGEN (setp hpg.stepgen.00.steppin 0x4C), and so if I just use:

setp bb_gpio.p8.out-11.invert 1

as suggested by Sarah, I get:

Xylotex.hal:318: parameter or pin 'bb_gpio.p8.out-11.invert' not found
Shutting down and cleaning up Machinekit...

If i'm not misstaken, the step pin is something like "setp hpg.stepgen.{nr}.steppin"


I figured I had to put 111 among the "loadrt hal_bb_gpio output_pins=" part of Xylotex.hal file, and when I get it to work the motor just moves in one direction.
I wonder if this behavior is because I´m inverting a pin being use with STEPGEN already? Or do I need to invert something else also?

Anyway, I´m trying to grasp the logic of how to set this up but I´m quite confused, would appreciate some clarification.
I just wanna change polarity on the DIR pin on Xylotex.


Thanks,


Diego

--
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 machinekit+...@googlegroups.com.
Visit this group at http://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Bas de Bruijn

unread,
Dec 2, 2015, 3:20:49 AM12/2/15
to Machinekit, mrdm...@gmail.com


On Wednesday, December 2, 2015 at 9:14:10 AM UTC+1, Bas de Bruijn wrote:




On 02 Dec 2015, at 08:15, Mr Molina wrote:

Hello all,

I´ve been discussing this with Sarah, and searching, but haven´t come accross a definitive answer on how to invert the logic on the DIR pins.

The thing is, the pin (p8.out-11 for X, for example) is being used by STEPGEN (setp hpg.stepgen.00.steppin 0x4C), and so if I just use:

setp bb_gpio.p8.out-11.invert 1

as suggested by Sarah, I get:

Xylotex.hal:318: parameter or pin 'bb_gpio.p8.out-11.invert' not found
Shutting down and cleaning up Machinekit...

If i'm not misstaken, the step pin is something like "setp hpg.stepgen.{nr}.steppin"

you might search for "steppin" in the machinekit github repo. this leads me to here:

Cheers,
Bas

Mr Molina

unread,
Dec 2, 2015, 3:24:22 AM12/2/15
to Machinekit, mrdm...@gmail.com

Thanks for the answers guys, I know which pin it is, but how to invert it?

Sarah Armstrong

unread,
Dec 2, 2015, 5:24:15 AM12/2/15
to Machinekit, mrdm...@gmail.com
add to the specific axis in your ini file , if it's not already there
and change 0 to 1 ,  this is for stepgen pins only

STEP_INVERT
= 0

Charles Steinkuehler

unread,
Dec 2, 2015, 9:25:24 AM12/2/15
to machi...@googlegroups.com
The direction pin is driven directly by the PRU, so there's no
"invert" parameter like there is for plain GPIO pins.

If you want to invert the sense of the direction output, simple invert
the sign of the scale for that axis. An example from one of my
personal machine configs:

https://github.com/cdsteinkuehler/machine-configs/blob/master/configs/MendelMax/CRAMPS.ini#L160

...it's a bit non-obvious, but inverting the scale makes the motor
turn the other direction. :)

On 12/2/2015 2:24 AM, Mr Molina wrote:
>
> Thanks for the answers guys, I know which pin it is, but how to invert it?
>
>
> On Wednesday, December 2, 2015 at 12:14:10 PM UTC+4, Bas de Bruijn wrote:
>>
>>
>>
>>
>>
>> On 02 Dec 2015, at 08:15, Mr Molina <mrdm...@gmail.com <javascript:>>
>> email to machinekit+...@googlegroups.com <javascript:>.
>> Visit this group at http://groups.google.com/group/machinekit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>


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

Sarah Armstrong

unread,
Dec 3, 2015, 6:17:12 AM12/3/15
to Machinekit
this problem , needs to be addressed , perhaps in the same way the stepgen pin is , although i have not looked 
some hardware as in this case wont work, due to other issues . not all stepper drives will or can be driven high , 

yes altering the scale will work , but it's not ideal in all cases , and in most cases only affects BBB users , or other microprocessors 
rather than pc's for example . 
Reply all
Reply to author
Forward
0 new messages