Changing Axis step-gen pins
22 Dec 2014 10:52 #54201
by EmcRules
Changing Axis step-gen pins was created by EmcRules
Would it be possible to have a comp to change the step gen pin mapped to an axis by issuing a custom m-code?
The reason I am asking, is that some of the 3D-printer slicing software deal with the extruder axis in odd ways. They treat the extruder as a tool however it uses a machine axis to drive the plastic. In my current configuration it is the A axis. When the slicing software creates the g-code for a part that may use multiple extruders. The axis code does not change. They just issue a T code without changing the axis reference. My guess is that the Reprap guys just coded the firmware to deal with this.
What I was thinking to deal with this, was to call a custom m-code during a tool change and remap my A axis to output to a different stepgen.
Would this make sense or is there a different method to deal with something like this?
Thanks
JP
The reason I am asking, is that some of the 3D-printer slicing software deal with the extruder axis in odd ways. They treat the extruder as a tool however it uses a machine axis to drive the plastic. In my current configuration it is the A axis. When the slicing software creates the g-code for a part that may use multiple extruders. The axis code does not change. They just issue a T code without changing the axis reference. My guess is that the Reprap guys just coded the firmware to deal with this.
What I was thinking to deal with this, was to call a custom m-code during a tool change and remap my A axis to output to a different stepgen.
Would this make sense or is there a different method to deal with something like this?
Thanks
JP
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
22 Dec 2014 11:07 #54202
by Todd Zuercher
Replied by Todd Zuercher on topic Changing Axis step-gen pins
it might make more sense to just switch which output the stepgen is connected to.
Please Log in or Create an account to join the conversation.
22 Dec 2014 11:11 #54203
by EmcRules
Replied by EmcRules on topic Changing Axis step-gen pins
Sorry that's what I was trying to say. But how would i do that with an m code? Would it require a comp?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
22 Dec 2014 11:31 #54204
by Todd Zuercher
Replied by Todd Zuercher on topic Changing Axis step-gen pins
I think you would only need to use some and2 logic to enable and disable the signals sent to your output (parallel port pin or what ever you are using).
One input of the and2 you would connect to the output of your stepgen, the other input you would setp with your custom M-code, to enable the output of the and2 to the pin that goes to one of your drives.
You would then have another and2 set up the same way for each additional drive and motor.
remember to addf the and2 in your base thread rather than the servo thread.
If you are using a hardware stepgen it would get a little more complicated.
One input of the and2 you would connect to the output of your stepgen, the other input you would setp with your custom M-code, to enable the output of the and2 to the pin that goes to one of your drives.
You would then have another and2 set up the same way for each additional drive and motor.
remember to addf the and2 in your base thread rather than the servo thread.
If you are using a hardware stepgen it would get a little more complicated.
Please Log in or Create an account to join the conversation.
22 Dec 2014 11:42 #54205
by EmcRules
Replied by EmcRules on topic Changing Axis step-gen pins
Ok. That makes sense.
My M-code would just set the signals going to the and2's on or off respectively. This would have to be done for both the step and direction pins. All of the other parameters are the same such as scaling and step drive timing
Why would hardware stepgens cause a problem? Sorry for my ignorance. Would the PRU in a BBB not be considered a hardware stepgen?
My M-code would just set the signals going to the and2's on or off respectively. This would have to be done for both the step and direction pins. All of the other parameters are the same such as scaling and step drive timing
Why would hardware stepgens cause a problem? Sorry for my ignorance. Would the PRU in a BBB not be considered a hardware stepgen?
Please Log in or Create an account to join the conversation.
22 Dec 2014 12:02 #54206
by EmcRules
Replied by EmcRules on topic Changing Axis step-gen pins
Actually on second thought would that work? The And2 is just a logic block. It would not pass the stepgen signal thru to the output. Looking at it a little further the BBB PRU pin assignment is done via "setp". I wonder what will happen if i just use a m-code to set the pin to a different number?
This is from the HAL file
# P8.30 GPIO2.25
setp [PRUCONF](DRIVER).stepgen.03.steppin 0x22
# P8.21 GPIO1.30
setp [PRUCONF](DRIVER).stepgen.03.dirpin 0x23
If i run a M-code with the following in it would it work?
halcmd setp [PRUCONF](DRIVER).stepgen.03.steppin "Different value than above^"
halcmd setp [PRUCONF](DRIVER).stepgen.03.dirpin "Different value than above^"
This is from the HAL file
# P8.30 GPIO2.25
setp [PRUCONF](DRIVER).stepgen.03.steppin 0x22
# P8.21 GPIO1.30
setp [PRUCONF](DRIVER).stepgen.03.dirpin 0x23
If i run a M-code with the following in it would it work?
halcmd setp [PRUCONF](DRIVER).stepgen.03.steppin "Different value than above^"
halcmd setp [PRUCONF](DRIVER).stepgen.03.dirpin "Different value than above^"
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
22 Dec 2014 22:11 #54217
by Todd Zuercher
Replied by Todd Zuercher on topic Changing Axis step-gen pins
This would not work with a hardware stepgen because the signal from the hardware stepgen to the output pin doesn't go through hal or even the pc, it is in the hardware card. To do this with hardware, you would either need to reassign the pin the stepgen is assigned to or use multiple stepgens.
I'm no expert and if I'm wrong please someone correct me.
I don't think I follow what you are suggesting.
The and2 should work, a simple logic block is all that is needed since the stepgens output is simple logic, a single bit blinking on and off.
I'm no expert and if I'm wrong please someone correct me.
I don't think I follow what you are suggesting.
The and2 should work, a simple logic block is all that is needed since the stepgens output is simple logic, a single bit blinking on and off.
Please Log in or Create an account to join the conversation.
Time to create page: 0.085 seconds