Lowrider CNC

rockyboy

Skill Collector
Mentor
Thanks to a very helpful response from Ryan over on the Lowrider forums, I now know what's up with the travel speed.

Turns out the Marlin firmware doesn't use a separate default feed rate for G0 or G1 commands - but Easel (and the gcode spec) are expecting G0 to be a non-cutting travel move while the G1 is an actionable / cutting travel move. And in the effort to be simple, Easel applies a feed rate as specified to the G1 commands, but doesn't put in any feed rate on the G0 lines. Estlcam knows not all firmware is equal, and specifies the G0 travel rate on each line.

So I'm going to try a quick find/replace on a gcode file tonight to add in a feed rate on the G0 and see if I can make the Easel generated gcode work a lot better. I do like the ease / convenience of the web based Easel, but this job speed issue is a deal breaker for me.

Here's a screen shot of the FY-42 v3 Mini project in Easel - it's handy to have each sheet of foam setup as a page in the project, makes it easy to see where the parts are while laying things out.

Capture.PNG
 

rockyboy

Skill Collector
Mentor
It's been a while since my last update, and I'm happy to report I'm cutting just fine! I did all the cutting for the FW-42 Mini I designed for the WWII challenge, and most recently started on the hot wire templates for the FW-42 Monster size build.


The find/replace of the G0 with a G0 F700 command in the gcode fixed Easel's problem of slow travel rates.

Next up is installing a box style drag chain cable guide to get rid of the wires dangling overhead from the ceiling hook, and connecting the needle cutter through the CNC power supply and the ESC through the RAMPS board so it'll be all automated in one tidy package. :)
 
Last edited:

rockyboy

Skill Collector
Mentor
One thing you could do is connect the needle cutter line to one of the servo ports on the Ramps and use M280 commands to turn it on/off. You might be able to setup the CAM to use M280 as the "spindle on" command...but I'm not sure - it could just be inserted manually in the gcode easily enough. The one issue is RAMPS doesn't output a servo signal by default - so you'd have to do a M280 P0 S0 (assuming you're on the same port I'm using) to start outputting pulses which will cause the ESC to initialize. And then a M280 P0 S80 the 80 is a guess 90 is a bit too high on mine but is what I have programmed into my LCD controls for testing currently, you'd have to play around to find a good value but basically it's the servo setting in "degres" so 0-180. Since "3-4" works good on my servo tester I'm guessing something in the 60-80 range should be appropriate.

So what I'd do is at the very top of the gcode I'd add:

M280 P0 S0 // Start outputting pulses to allow ESC to init.
G4 S5 // 5 second pause to allow the ESC to initialize - may need more or less time
M280 P0 S70 // Set ESC to 70 degrees (since it thinks it's talking to a servo)
G4 S5 // 5 second pause to allow ESC to come up to speed and stabilize - may need more or less.

Then at the end of your cutting gcode you could also add:
M280 P0 S0 // Turn off needle cutter

Except...there's a risk it could stop with the needle down and snag. If you were to do this it may be worthwhile to do something like mount a magnet above the flywheel to encourage it to stop with the needle fully retracted. Or you could just add:

M400 // Wait for movement to finish
M280 P0 S0 // Turn off Needle

At the VERY end after it returns to home - that way it's not moving so it doesn't matter if the needle is fully retracted or not.

I'm actually getting ready to do this myself - just been lazy about experimenting to find the speeds/timings that work best for me. But I'm tired of having my servo tester tied up on the machine and really want to fully automate it.

I think in ESTLCAM it's possible to define start/end gcode like this...if not it's not that big of a deal to cut and paste it manually.

So I've got the wiring setup and ready, but the code isn't working for me here. Here's where I'm at so far.

The Lowrider Marlin firmware looked like the servo libraries and commands weren't enabled, so I uncommented the "#define NUM_SERVOS" in configuration.h and changed it to 3 and changed the "#define Z_ENDSTOP_SERVO_NR" from 0 to 1. That caused me to track down another servo variable that wasn't being defined and uncomment it, but I forget which one that was now. Anyway, after these updates I am able to get the Marlin firmware to compile and upload to the Lowrider.

But the M280 P0 S0 commands aren't causing any servo movement I can find. To test I'm using an actual RC servo and I've tried just about every combination of P0 P1 P2 P3 and the 4 servo pin sets in the block of pins next to the reset button I can think of, but still no movement.

Do you think I'm plugging into the right pin location? Where is yours working?

Thanks,
 

jhitesma

Some guy in the desert
Mentor
Hmmm, I don't think I enabled Z_ENDSTOP_SERVO_NR - I believe that may actually tie up a servo by assigning it to that function.

I'm on an older build of Marlin...but here's my config file all the same:
https://github.com/jhitesma/Marlin-Folger/blob/mpcnc/Marlin/Configuration.h

I have:

#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command

But everything else about servos commented out it looks like:

// Number of servos
//
// If you select a configuration below, this will receive a default value and does not need to be set manually
// set it manually if you have more servos than extruders and wish to manually control some
// leaving it undefined or defining as 0 will disable the servo subsystem
// If unsure, leave commented / disabled
//
#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command

// Servo Endstops
//
// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
// Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500.
//
//#define X_ENDSTOP_SERVO_NR 1
//#define Y_ENDSTOP_SERVO_NR 2
//#define Z_ENDSTOP_SERVO_NR 0
//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles

// Servo deactivation
//
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE

#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
// Delay (in microseconds) before turning the servo off. This depends on the servo speed.
// 300ms is a good value but you can try less delay.
// If the servo can't reach the requested position, increase it.
#define SERVO_DEACTIVATION_DELAY 300
#endif

I did test with an actual servo first too since it seemed easier, and I had one within arms reach at the time :D

I have it plugged into the first servo port - the one closest to the power plugs:
20170929_221416 (1) (1).jpg

And with that M280 P0 "just worked"

I did have the servo plugged in backwards at first which didn't help....

I really need to update my firmware one of these days, not sure how much has changed. But since a lot of people use servos on their auto level setups I doubt it would just stop working.
 

rockyboy

Skill Collector
Mentor
I'm using the same wiring pins, so I might have just gone too far in enabling servo functions then. I'll comment some of those back out again and see how she reacts.

Thank you!!
 

rockyboy

Skill Collector
Mentor
Progress.... sort of...

I commented out the other servo code, but still couldn't get a servo to actually move. So I decided to just try connecting to the ESC anyway. And it got stuck in the arming sequence - and then it came on!! - and then it wouldn't arm again. And in about 1 in 10 tries it fires up - the rest of the time the ESC just won't complete the arming sequence when I try to control it through the RAMPS board.

So I'm going to try and test with a different brand/firmware ESC and see if that works better. And I also remember hearing about how this whole thing of ESC's having an arming sequence and testing for a signal before powering on is sort of a new fangled idea, and that back in the old days (and perhaps even now) some ESC's would just immediately power on. Does anyone know where I could get one like that these days?
 

moebeast

Member
Progress.... sort of...

I commented out the other servo code, but still couldn't get a servo to actually move. So I decided to just try connecting to the ESC anyway. And it got stuck in the arming sequence - and then it came on!! - and then it wouldn't arm again. And in about 1 in 10 tries it fires up - the rest of the time the ESC just won't complete the arming sequence when I try to control it through the RAMPS board.
I accidentally powered up my machine without the servo tester connected, and it did the same thing, so maybe you aren't actually generating a signal?

It might not matter, but I would pull the red lead out of the connector from the ESC so you don't have two voltage regulators feeding the same 5v rail.
 

rockyboy

Skill Collector
Mentor
Yeah, it seems to be very inconsistent in signal generation - perhaps the pulse width is off or something else I just don't know to look for. And I'll double check the wiring at the ESC end now that I'm trying to switch to control through the RAMPS.

Thanks,
 

jhitesma

Some guy in the desert
Mentor
That is something I may have not mentioned.

Marlin won't output a servo signal by default even when servos are enabled.

So what I did was do a M280 P0 S180 before putting power to my servo, then doing a M280 P0 S0 when the ESC beeped to calibrate the ESC to my board/Marlin.

That's also why I include a M280 P0 S0 and a pause in my start Gcode. That starts outputting pulses from Marlin (but outputting pulses indicating 0 degrees on a servo or low throttle on an ESC) and allows the ESC to initialize. If the ESC is already initialized it doesn't hurt just adds a bit of delay, but if the ESC is powered up for the first time it does it's init and is then ready to go.
 

rockyboy

Skill Collector
Mentor
Hmm... maybe I also need to get a relay installed to let the gcode have power control over the motor/esc too so I can start servo pulses before the ESC is energized. I currently have the motor/esc power coming off the same power supply, but it's directly wired in so when the RAMPS gets power, the motor/esc gets power too.

But I'm still curious about when I plug in a standard servo to the RAMPS board, why none of the M280 commands cause it to move at all.
 

jhitesma

Some guy in the desert
Mentor
Servo no moving is a sign of something bigger being off.

I wouldn't worry about the relay though once you get your M280 sorted out. I regularly power up my ESC before powering up the RAMPS board - the ESC happily sits there waiting for a signal and just doesn't do anything. Then when I first give it a M280 P0 S0 it does it's init routine and is ready to go.

I'm really not sure what could be wrong with your servo commands though. Oh wait...I do. You may not have power to the servo pins. One of the jumpers has to be in place to have power to the servo pins (which a servo would need, the ESC wouldn't.) Most RAMPS boards I've seen come with that jumper off. It's the one next to the reset button...in my photo I don't have it installed since I'm not powering any servos - but when I was testing I did have to install it. I just don't remember exactly how it needs to be installed....
 

epsilon

Active member
ugh... seeing this sucker in action is giving me the itch! trying to wait till after Christmas though like a responsible person ...:rolleyes:
 

rockyboy

Skill Collector
Mentor
ugh... seeing this sucker in action is giving me the itch! trying to wait till after Christmas though like a responsible person ...:rolleyes:


** shouting to the back of the workshop **
We've got another one hooked boys! Let's reel 'em in! :p
 

rockyboy

Skill Collector
Mentor
I'm going to have to get back on figuring out that servo code - look what showed up in the mail today! :D

IMG_20191118_180118-1024x768.jpg


3.5 Watts - enough to engrave and draw on all kids of stuff! Should also cut vinyl, paper stencils, and even thin balsa! :D
 

jhitesma

Some guy in the desert
Mentor
Fun! I've cut 1/8" ply with my 3w so you may be able to do more than you expect (it's not very practical for cutting 1/8" ply though...took 7 passes going very slow and left a very charred edge as a result)

I use it all the time for cutting poster board and black craft foam. The cuts on black craft foam are amazing. Leave the edges nicely cauterized and clean!
 

rockyboy

Skill Collector
Mentor
Thanks for the info! It's good to hear it could be even more useful than I thought :D

But I've gotten myself a little on the fence about how to proceed with this installation.

I have a working needle cutter control board based on an Arduino UNO / RAMPS / VC Marlin with some tweaks for calibration. I haven't been able to get it to output a PWM servo control signal yet, which is required for running the laser module. On the needle cutter I just use an external servo tester and manually operate it - not idea, but it's been working.

On one hand I could flash it with an updated version of Marlin and see if I can re-create my calibration tweaks and get the PWM output working right. Marlin does seem to work well with Lightburn, which seems like a very good choice for a laser CAM software to generate gcode. But that could leave me with a non-functional needle cutter all together too.

On the other hand I could source a new controller board that is known to work well with these laser modules. I could leave my old Uno/RAMPS setup with the (sort of) working firmware alone and just focus on getting the new hardware operating correctly, hopefully with a better chance of overall success.

Hmmm..... :unsure: