Welcome! Log In Create A New Profile

Advanced

Extracting Motor speed and steps from Ramps 1.4

Posted by CDorn 
Extracting Motor speed and steps from Ramps 1.4
August 30, 2021 03:21AM
Hello fellow Reprap-Community,

I want to use the Ramps 1.4 Board to controll an extruder and other sensors. Though for the X,Y,Z-axis I want to use a independant system. For that I need the information of Marlin, how many steps, and at which frequency the individual motors should run (which can then easily be translated into position and speed).

As I understood it, Marlin interprets the given G-Code to calculate its own acceleration. Marlin then sends "on/off" signals to the individual pins of the stepper-motors at a certain frequency. Is it possible to extract that information in marlin?
If yes, how do I send it to an other microcontroller? Via one of the AUX-pins? (sorry I'm quite new to this).

Thanks in advance!!
VDX
Re: Extracting Motor speed and steps from Ramps 1.4
August 30, 2021 03:38AM
... eventually simply extract the pins for STEP and DIR of each axis and feed them (together with GND) to the corresponding external stepper drivers?


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Extracting Motor speed and steps from Ramps 1.4
August 30, 2021 03:44AM
Thanks for the quick answer.
But what do you mean with "simply extract the pins"? Thats exactly what I was asking for... how do I do that in the code?
VDX
Re: Extracting Motor speed and steps from Ramps 1.4
August 30, 2021 04:28AM
... why code? -- I'm inserting a "dummy"-socket into the stepper driver sockets, which feeds the 3 pins STEP/DIR/GND with a cable to the external driver ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Extracting Motor speed and steps from Ramps 1.4
August 30, 2021 04:43AM
Oh now I unterstand what you mean. The thing is, that I need the X,Y, Z-position, as well as the X, Y, Z-speed as values. Sure I could try to convert the measured steps and frequencies from the 12 pins themselves by converting my external microcontroller to a sort of oszilloskop, but I'd rather have a more elegant solution. Those 12 pins are fed a signal, do you know where that signal is in the code?

I'm thinking along the lines of: "the bipolar-X-axis-stepper has 4 pins on the ramps board. In marlin they have the initials pin_x1, pin_x2, pin_x3, pin_x4. The timing of their activation should be sent to an external microcontroller."

My problem is that I don't know the pin names, nor how to send any info to an external microcontroller..
VDX
Re: Extracting Motor speed and steps from Ramps 1.4
August 30, 2021 04:57AM
... the position is not the problem - but the speed could be, as it's calculated (or better "stepwise executed") "on the run" and through a lookahead-buffer to synchronize XYZ with the extruder ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Extracting Motor speed and steps from Ramps 1.4
August 30, 2021 09:16AM
Oh okay. Well I'll try to solve it in a different way.. Thanks for the info!
Re: Extracting Motor speed and steps from Ramps 1.4
August 30, 2021 10:04AM
@CDorn

" "the bipolar-X-axis-stepper has 4 pins on the ramps board. In marlin they have the initials pin_x1, pin_x2, pin_x3, pin_x4"

no such thing

Marlin only knows about the enable, step and direction io lines that control the stepper driver.
It does not have any direct control of the 4 ouput pins of the stepper driver.
Sorry, only registered users may post in this forum.

Click here to login