ADVrider

Go Back   ADVrider > Fluff > Shiny things
User Name
Password
Register Inmates Photos Site Rules Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Rating: Thread Rating: 8 votes, 5.00 average. Display Modes
Old 05-14-2012, 10:07 PM   #31
RonS OP
Out there...
 
RonS's Avatar
 
Joined: Dec 2002
Location: Dancing with roads
Oddometer: 17,947
It begins

The mill has arrived:

Color matches the Versys (almost):



Has spindle speed readout and DRO in the z-axis:



Little smaller than the RF-40:



Still waiting for the the servo motors, drivers, control boards, pendent and probe to arrive.
RonS is offline   Reply With Quote
Old 05-27-2012, 09:41 PM   #32
RonS OP
Out there...
 
RonS's Avatar
 
Joined: Dec 2002
Location: Dancing with roads
Oddometer: 17,947
Not a lot of people jumping in on this but I'll keep posting just in case someone finds it interesting.

Well, the components arrived. Four 38 oz-inch servo motors (20 amp draw each) with encoders mounted, a remote control Pendent, a pin probe, an array of proximity limit switches and a chassis with the 5 volt power supply, 12 volt power supply, 72 volt power supply, a Smooth Stepper board, a C32 breakout board, an RJ45 translator board, a spindle control board and four Whale 3 servo motor drivers. Everything was prewired in a box barely big enough to fit the components. The PC already had Mach3 loaded so the task should be as simple as connecting the motors and encoders to the box, connecting the pendent to the box, connecting the USB to the PC, configuring the Mach 3 ports and pins, inputs, outputs and presto, I'd have motors turning.

Well, that's not quite the way it has been going down... At this point I've put in about 40 hours in the last 3 days debugging the issues. Warning: debugging this stuff is not for the faint of heart. I've done quite a bit of imbedded software over the years and although I'm not an EE I've been about as close to the hardware as you can get without doing board, circuit or ASIC design and this is testing my limits. In large part due to the relative lack of documentation. The documentation for most of this stuff is oriented toward the novice. It contains just enough info to get things going as well as some circuit designs and pinouts but is sparse in between. If a novice doesn't get this stuff going with no issues all I can say is, god help them. Anyway, as debugging continues this is what it currently looks like on the bench:



and:



Backtracking along the path I've followed for the last three days, to start with one of the motors was damaged in shipping. The brush holder was broken off and the brush spring was sticking out of the motor all proud like. Ok, scratch the A axis from the Mach3 config and start with three a three axis system. Power everything up select the x axis on the pendent, turn the dial and...Nothing! WTF... OK, pull the top off the box and start looking around. Check the pinouts on the pendent RS232 against the pinouts for the C32 breakout board. Looks "relatively" OK. Then poking around a bit more I notice this red LED lit on the breakout board. Put my reading glass on (very small print) and the writing next to it says ESTOP. Another one nearby is lit that says STBY. OK so the ESTOP is not depressed on the front of the box, what the hell is going on. I start doing a little research and I notice that the pendent I have is not the same as the one pictured on the web site. That one has an enable button and a separate ESTOP. Mine has only one "very hard to depress" button that acts more like an on/off switch but it does nothing. After a couple of hours of poking around I get in touch with Arturo and CNC4PC (who was very helpful in this). He was not aware that the new batch of pendants he received were not the same as the old ones. Still not sure what will be done about that but he recommends rewiring the ESTOP on the breakout board to bypass the pendent ESTOP since the front panel and the pendent ESTOP's are wired in series. I do that and wala! The ESTOP LED goes out. Hit reset on Mach3 and the STBY LED goes out. I'm ready to rock and roll. Select the X axis once again and turn the pendent dial. I get a bit of "not so smooth" movement. I'm elated. Select the Y axis, turn the dial and both the X and Z axis motor start jumping around on the bench like a freshly caught 30lb salmon hauled into a 10 foot row boat (if you've never landed a large salmon it's a tackling job better suited to a pro football lineman than a fisherman). Holy shit...says I! hit the ESTOP.

OK, what now. I fiddle around a bit more. I start checking the wiring of the encoders, the motors, the motor plugs against the pinout documentation for the motor drivers. Everything "looks" OK. Check the encoder to RJ45 device, swap cables and connectors and RJ45 bridges between the "good" motor and the other motors. Then start swapping motors to different axis's. After a couple of hours of this it starts looking like two of the motors are not behaving. The problem follows the motors so it's not a driver issue. For the life of me though I couldn't figure out why turning one would kick both of them off and they'd both start flopping around like fish on the bench. The system was supposed to be tested before it was shipped to me but by this time I'm wondering if Arturo had someone package this stuff and they sent me the components that were not tuned rather than the tuned system I was going to get (kind of like the pendent). Can't get in touch with Aurturo though so there is only one way to find out. Out come the circuit boards to get down to the Whale 3 drivers. I hook up the Whale 3 driver to the PC to run their servo PID loop tuning software...

Before going further I should talk a bit about PID loops. PID stands for proportional–integral–derivative. It is an algorithm that you probably deal with everyday in some aspect of your life. It is used to bring heaters up to temp and settle at a selected temp (like in you car or your house), fill containers to a given level, move material, drive motors at an given velocity with an appropriate amount of acceleration and deceleration so they don't tear the equipment they are attached to apart and all kinds of other applications. There are basic PID algorithms and then there are "special sauce" algorithms which add additional tuning parameters and even use heuristics or history as input for tuning purposes. PID loops might appear simple on the surface but they are (for most of us) rooted in some reasonably deep science. The software that Whale provides to tune the servo PID loop is actually a fairly nice piece of software. It allows entry of a lot of inputs to the tuning process then triggers the motor and paints of graph of how the PID loop settled. It also has diagnostic capability that tell you the state of the drive, the pins and PWM info. Unfortunately the documentation does not tell you much about what some of the input parameters do. More on that later.

Anyway, that aside, I try the X axis first using the default PID settings in the driver. The motor jogs and a graph of a not so efficient settling curve is painted. Next I power down, hook up the Y axis for monitoring power back up, hit the "analyze" button on the software and the motor starts flopping around. Then the Z axis motor starts flopping around. I hit the ESTOP and look at the graph of the PID loop performance. It never settles. Massive over and under shooting of the set point. No wonder this motor is flopping around like a fish. Still wondering how the Z axis motor could take off when I'm only jogging the Y axis motor though. Well, I disconnect X and Z axis motor to focus on the Y axis PID loop. I spend a couple of hours trying everything I can change to get some stability in the PID loop. Remember that "special sauce" PID loop? Well this PID loop supports two "i" (integral) variables. The documentation tells you that one of them should be set to 65535 and only lowered if necessary. No info what how it affects the PID loop, what it does or which one is the "real" integral component. I change the encoder multiplier rate, the P, the D, both I's, the pulse multiplier, the sampling rate. For hours I go through this and nothing helps. Still massive over and under shooting of the set point. This was about 11:00 PM last night. I give up and go into the house to do a bit of reading. As I'm looking over the encoder documentation I notice that the encoder has a four bit micro dip switch on the board to set the pulse rate. I wonder what they have the encoders set to and if the one working motor encoder is set differently than the others. Back out to the shop. I pop open the encoders and check out the dip switch settings. They are all set to 100 PPR (pulses per rotation)... bummer. I figure what the fuck, grasping at straws I set one of the encoders on one of the misbehaving motors to 2048 PPR. Fire everything back up, hit the analyze button and...THE FUCKING MOTOR WORKS!!! I do the same to the other misbehaving motor. IT FUCKING WORKS TO!!! I do the same to the good motor. IT FUCKING WORKS TO. Don't understand why but don't really care at this point. I spend the rest of the night tuning the PID loop to get some smooth settling up. Finally got to bed about 2:30 in the morning. Today I spent a bit of time trying to figure out why the encoder change made such a difference. Still don't know but this is where I ended up with all the motors this morning:



Those who know PID loops will comment right away that the performance of this loop looks like shit. It starts at the set point, massively overshoots then corrects, undershoots a bit then settles fairly fast. Not sure why it's starting so high and over shooting so much. That's a question yet to be answered (along with why the encoder PPR change worked) but for now the motors appear to be stable so I'll take it. As far as stability, I did find out why, when testing one motor, both would take off and start flopping around. In playing with the PID loop I created an instability a couple of times. One of these times I just tossed the screwdriver on the bench and the motor started flopping around. Something about the way the motor was being held in a steady state by the driver that one little bump would cause the encoder to pulse and the motor would go ape shit. So when I was testing with all the motors plugged in it was the one motor flopping around that caused the other motor to start flopping around. As is increasingly becoming the case, I'm not sure why. Perhaps an expert in the behavior of magnetic fields or an EE can enlighten us all.

So by this afternoon I arrived at this point:



Driving the motor from Mach3. I can jog them from within Mach3 but using the pendent, regardless of the axis I select it always jogs the Y only. Mach3 shows the Y pin hot regardless of what axis is selected on the pendent. Probably something to do with the Mach3 "brain" running the pendent. Brains are essentially a way of scripting the behavior of digital inputs within Mach 3. Figuring out what is going on with the pendent and how the pendent brains that came from CNC4PC work will be my next learning curve. This educational experience is far from over. Stay tuned.
RonS is offline   Reply With Quote
Old 05-28-2012, 09:59 AM   #33
BillsR100
Happy Paleoflatus
 
BillsR100's Avatar
 
Joined: Nov 2006
Location: Edmond, Oklahoma
Oddometer: 2,816
I have no idea what you just said but I read the whole thing and thought it was interesting! Thanks for sharing!
BillsR100 is offline   Reply With Quote
Old 05-28-2012, 07:12 PM   #34
metlcutr55
LongGoneDaddy
 
metlcutr55's Avatar
 
Joined: Dec 2004
Location: s w NH
Oddometer: 883
a link that may be helpful

http://www.machsupport.com/forum/index.php?board=1.0

there are sharp folk there who like to help. i have read on the forums that the people who run cnc4pc are also helpful.

good luck with this!
__________________
My mammy was a shewolf, my daddy was a bar.
I'm 200 pounds of tooth and claw, covered oer in har.
Half fire, half smoke, the other half thunder.
I am what you may call the 8th wonder.
Hey look out boys, get out the way, ladies get in line.
I aint perfect but almost, I'm dyin' if I'm lyin'
metlcutr55 is offline   Reply With Quote
Old 05-28-2012, 07:50 PM   #35
BillsR100
Happy Paleoflatus
 
BillsR100's Avatar
 
Joined: Nov 2006
Location: Edmond, Oklahoma
Oddometer: 2,816
Quote:
Originally Posted by metlcutr55 View Post
a link that may be helpful

http://www.machsupport.com/forum/index.php?board=1.0

there are sharp folk there who like to help. i have read on the forums that the people who run cnc4pc are also helpful.

good luck with this!
The real reason I found your posts interesting is that I love controlling stuff with a PC. Right now I have a home made servo controlled web cam that can be controlled (moved) over the internet. I wrote the software that interfaces with the tiny "Mini SCC II" servo controller. One day I realized I could control stepper motors (small ones) using the same Mini SCC II controller, and I could build a little home made CNC machine using a dremel for the cutter. I just might do it some day.
I enjoy reading stuff on this web site also.
http://www.buildyourcnc.com/
BillsR100 is offline   Reply With Quote
Old 05-28-2012, 11:42 PM   #36
RonS OP
Out there...
 
RonS's Avatar
 
Joined: Dec 2002
Location: Dancing with roads
Oddometer: 17,947
Quote:
Originally Posted by metlcutr55 View Post
a link that may be helpful

http://www.machsupport.com/forum/index.php?board=1.0

there are sharp folk there who like to help. i have read on the forums that the people who run cnc4pc are also helpful.

good luck with this!
I'll probably be posting there soon. I'm trying to get through the issues I can resolve first and in the process develop some really hard questions for the folks who actually know what they're doing.
RonS is offline   Reply With Quote
Old 05-28-2012, 11:49 PM   #37
RonS OP
Out there...
 
RonS's Avatar
 
Joined: Dec 2002
Location: Dancing with roads
Oddometer: 17,947
Quote:
Originally Posted by BillsR100 View Post
The real reason I found your posts interesting is that I love controlling stuff with a PC. Right now I have a home made servo controlled web cam that can be controlled (moved) over the internet. I wrote the software that interfaces with the tiny "Mini SCC II" servo controller. One day I realized I could control stepper motors (small ones) using the same Mini SCC II controller, and I could build a little home made CNC machine using a dremel for the cutter. I just might do it some day.
I enjoy reading stuff on this web site also.
http://www.buildyourcnc.com/
Yeah,I considered using stepper motors but decided to go the servo route due to the torque characteristics. Servos hold torque at higher rpm where steppers drop off fairly significantly. Steppers are a lot cheaper though.
RonS is offline   Reply With Quote
Old 05-29-2012, 09:10 AM   #38
FinlandThumper
Has Cake/Eats it Too
 
FinlandThumper's Avatar
 
Joined: Jan 2008
Location: Neither here nor there
Oddometer: 6,201
This is a very cool project. Nice work Ron!
FinlandThumper is online now   Reply With Quote
Old 05-29-2012, 08:24 PM   #39
RonS OP
Out there...
 
RonS's Avatar
 
Joined: Dec 2002
Location: Dancing with roads
Oddometer: 17,947
Quote:
Originally Posted by FinlandThumper View Post
This is a very cool project. Nice work Ron!
Thanks man. Nothing like banging your head against the wall for hours on end

I do have an update but I need to get back to town to post it with pictures. Preview: I got the pendant working.
RonS is offline   Reply With Quote
Old 06-21-2012, 11:07 PM   #40
RonS OP
Out there...
 
RonS's Avatar
 
Joined: Dec 2002
Location: Dancing with roads
Oddometer: 17,947
The process continues. Received the 4th axis motor to replace the one that was broken. At last report the pendent was not working. Turned out that this pendent was a bit different than the Mach3 "brains" were programmed for. In Mach3 brains scan the state of input/output devices and control both input and output devices. They are essentially PLC ladder logic that is created and modified using a "brain" editor supplied by Mach3. The way they work is that you look at the state of one or more input signals and based on the findings drive one or more output signals, update display LED's, drive Mach3 internal functions or a number of other actions. This pendent did not have an ESTOP and the enable button on the side only raised the signals to the breakout board when it was depressed. The yellow LED lit in jog console on Mach3 in the image below is being done by the brain. The red light on the pendent is also turned on by the brain. Both are done by simply raising the signal on the output pin to the pendent for the light and driving an internal function in Mach3 that lights the jog console light for MPG input. Arturo at CNC4PC sent me another pendent with an ESTOP but I actually liked the egronomics of the first one and I think I can do without the ESTOP on the pendent as releasing the enable button shuts down all signals from the pendent anyway. The breakout board was already wired to by pass ESTOP on the pendent so all I had to do was modify the brains to look for the pendent and perform actions when running Mach3 in jog pendent mode. The result, a working pendent:



The next task was tuning Mach3 to make the motors run nice and smooth. All four axis's are now working on the bench from the pendent. Further tuning will be required in that the number of pulses, acceleration and decelleration curves will have to be adjusted but I'll wait until I get the motors mounted and can see the real world results.

So now it's time to mount the motors. I ordered some coulpers (for the motor to the mill shafts) off ebay. Time to start cutting some metal. This will end up being the table side of the x axis mount:



Love this saw:



A couple of these will be welded between the mill side of the mounts and the motor side of the mounts. The coupler will reside within them:



Need to take a bit off the ID on the end that fits the motor:



The motor side of the mounts needed to be bored to fit the tube that runs to the mill, drilled for the bolt pattern on the motors and tapped to mount the motors up. This was a process. The boring of the 2 inch holes in three mounts took me over 6 hours the other evening. The drilling of the bolt patterns was easy. The DRO facilitates calculation of the drill points and storage of all locations. Setting up the pattern took about a half an hour but pre drilling and final drilling of all three mount bases (12 holes) took only about the same amount of time and most of that was swapping and aligning the components. note that the DRO shows SDM 4 (data point 4, the forth hole in the pattern) and it looks like I'm off 1/100th of a millimeter on the Y axis. Close enough for this kind of work:



Gotta watch these small taps. Need to run down and get a couple more tomorrow. It's easy to get too agressive with them and this is the result:



Fortunatly I was able to drive out the broken piece as I'd just started cutting threads.

So that brings it up to date. Next steps are: finish tapping the motor side of the mounts, weld the mounts together and mount a motor or two. I may take the entire mill apart and cut some slots in the ACME screws. Not sure yet.

More later...

RonS screwed with this post 06-21-2012 at 11:32 PM
RonS is offline   Reply With Quote
Old 06-22-2012, 02:42 AM   #41
AZbiker
Crunkin' with crackers
 
AZbiker's Avatar
 
Joined: Mar 2005
Location: Phoenix, in the Arcadia area
Oddometer: 6,949
Cool thread.

You are a very patient man.
__________________
rubber side down,

derek

http://azbiker.smugmug.com

Got SmugMug? If not, save some cash and use my code: McYdbycdcvM5Q
AZbiker is offline   Reply With Quote
Old 06-22-2012, 08:01 AM   #42
RonS OP
Out there...
 
RonS's Avatar
 
Joined: Dec 2002
Location: Dancing with roads
Oddometer: 17,947
Quote:
Originally Posted by AZbiker View Post
Cool thread.

You are a very patient man.
Not patient really, more like I'm not exactly busting my ass on getting it up and running. Just taking it a piece at a time and learning all I can at each step. I actualy had to break down and read the manual on the DRO to figure out how to set up the pattern for drilling the motor mount holes. Now that I know how I can actually do it in a couple of minutes. Once the CNC is operational I won't even need to turn wheels manually for these kinds of repeat processes. Might take a bit longer though to create the CAD drawing and design the tool paths in CAM. We'll see. Lot's more to learn.
RonS is offline   Reply With Quote
Old 06-22-2012, 08:33 AM   #43
RonS OP
Out there...
 
RonS's Avatar
 
Joined: Dec 2002
Location: Dancing with roads
Oddometer: 17,947
P.S. also found out a lot about why the PID loop was displaying what looked like a not so optimized curve and what the difference between Ai and Li are. From the driver manufacturer:

“The 1(t) analyzer is a step response analyzer which is meant to give a pulse train to the drive's input with an infinite acceleration.
This signal is often used in automation as a checking signal and is a theoretical signal.

Because this is only an 1(t) signal you cannot profile the acceleration or deceleration, as said the signal is just to check the response of the plant with the actual PID settings.
The optimal is if you getting a close to zero, but less than 20% overshoot and no second overshoot and settle with a zero position error.

Because in real control when commanding via the step/dir interface you will never have a similar infinite acceleration profiling, so you will likely to have no overshoot even with a bit under damped system (when there is a small overshoot in the 1(t) response), but a bit under damping means a more aggressive reaction of the plant and a better path following, this is why I'm advising to set the PID controller possibly with a small amount of one overshoot...

In your settings, I think you may set the "Current Amps" to a higher value to let your motor accelerate better, the drive limits the current to the set value and if the current is overridden for 3seconds then it lowers the current to 50%, so you can set here a peak value, e.g. a 2x the rated of the motor.

>Also, what is the difference between Ai and Li? Which is the real "I" in PID and how does the other one affect the algorithm?

Ai is the integrator gain (also referred sometimes as reset rate) and Li is an integral limit. The Ai makes your integral term to integrate and rise/fall (respond) faster if set to higher value, however a higher value also decreasing stability. The Li parameter limits the integral output in an absolute value, in other words you can limit the integral counter to rise to above a set abs. value. With limiting the integral term you can avoid a so called windup of the control loop.”

These guys seem to know what they are doing. Sounds like I got lucky. Need to crank the peak amps up to the real peak rather than the steady state draw value I currently have it set to. Add a bit of derivative to get the curve to settle a bit faster then tune the acceleration and deceleration via the motor tuning panel in Mach3 (already did a bit of that but more to do once I adjust the motor driver settings).

More to come...
RonS is offline   Reply With Quote
Old 06-22-2012, 09:00 AM   #44
RonS OP
Out there...
 
RonS's Avatar
 
Joined: Dec 2002
Location: Dancing with roads
Oddometer: 17,947
More random thoughts. So I’ve got a friend who is a mechanical engineer and owns a company that builds equipment for the lumber industry. One of these machines is the size of a small house and is used for stacking green chain (fresh cut lumber as it comes off the saws). I went over to check it out after he’d finished building the latest version. The thing operates so smoothly you’d think it was a finely tuned Swiss watch and its travel on one axis is over 20 feet.

At the time I really didn’t fully appreciate the ramifications when he told me that he had to fly engineers over from Germany to tune the servo motors in order to achieve that level of smooth operation. I do now. After watching those little 380 oz/in motors flop around on the bench before I got them tuned I started thinking about what would happen if his motors didn’t settle like a couple of mine didn’t. With mine it might break a finger if they caught you in just the right way. Not sure how many oz/in of torque his motors are rated at but the motors are bigger than a beer keg. I'm guessing that if you where standing anywhere near one of them and it didn’t settle it'd be like tumbling down a gravel road at speed while hugging your 500+ pound “adventure” touring bike. It’d break every bone in your body. It’s all fun and games when you’re working with the little mills and motors like I’m working with but this shit can get serious in a hurry as the scale increases.
RonS is offline   Reply With Quote
Old 06-22-2012, 09:33 AM   #45
GSWayne
Old Guy nOOb
 
GSWayne's Avatar
 
Joined: Mar 2005
Location: Santa Barbara
Oddometer: 2,938
I also recently got a G0704, but I settled for just putting a DRO system on it. It sure is an improvement over Dykem and height gauges for laying things out, but it won't be as fun to watch cutting metal as CNC.
__________________
It isn't the conditions its the decisions

Don't bring a motorcycle to a car fight
GSWayne is offline   Reply With Quote
Reply

Share

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


Times are GMT -7.   It's 12:50 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ADVrider 2011-2014