Installing a pot to control a Stepper Motor in Marlin firmware

This is my first attempt at working with Arduino on anything other than a 3d printer, so please bear with me.

I am trying to recycle plastic bottles into 3d printer filament, and have found some YouTube videos from people in Russia that have some designs, but they all require buying or building electrical circuits, not my thing. I have a slicer for cutting the bottles and a winding machine, but I need to control the speed of the stepper that drives the winder.

I was hoping to find some one that has used a Mega 2560, on a ramps board and a display to control two 3d printer hotends, (from a 3d printer), one stepper motor what driver a stepper motor. The problem I have is the stepper needs to have its speed adjusted as it is running. I have modified a 3d printer profile in Marlin to control the hotends, but have to run the stepper via Pronterface, and cannot adjust the speed as it is running.

From what I have read I think it would be best to control the stepper from a pot but have no earthly idea on how to install it, or add it to the Marlin program to make it functional. I have read a few post that go into coding but and totally lost when it comes to installing into the Marlin Program.
The Marlin program I am using, is for a 3d printer, with some basic modifications to run two hot ends, the stepper for winder via a A4988 driver, and the Rerap display. I have not yet stripped out the unnecessary part of the original code, as this is only the first week of this project.

I am not that proficient with forums, chat boards and groups, have a hard enough time with just email.
Can provide the Marlin code, If i figure out how to do it.
I would apricate any and all help with this project.
thanks
RC

The problem with Marlin is that it is HUGE. I would borrow parts from Marlin and write a much smaller sketch to control the three steppers and the two heaters. The RAMPS board pinout will tell you which pins control which devices.

Stepper drivers are easy. You have one pin to set direction and another pin you pulse to take a step. Pulse the step pin at a fixed rate and you get a fixed speed.

The hot-end heaters have a thermistor for feedback. Typically you would use PWM to control the heater.

So use PWM on Pin 8 and Pin 10 to control the extruder heaters. Use the T0 (A13) and T1 (A14) connectors for your extruder thermistors. The AUX2 connector has several Analog Input pins you can use for your pot: A5, A9, A10, A11, and A12. The E0 and E1 connectors are for the two extruder steppers . E0_STEP is Pin 26. E0_DIR is Pin 28. E1_STEP is Pin 36. E1_DIR is Pin 34. You can use the X, Y , or Z connectors for your other stepper. See the schematic for their pins:

Thanks for the info. I wish I could write a sketch but I am total, total lost. I have no idea as to where I would even start. If I was into doing this about 50+ years ago I might be able to do it, but mother time has gotten the best of me. Thanks for responding. I was hoping someone might have what I need and I could just plug and play, so to speak.
thanks again.
RC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.