Month: May 2017

Wire spool setup finished!

I finished the wire spool setup. It includes a belt brake with adjustable drag, a DC servo for even re-reeling and a DC motor with gear for providing the re-reeling torque. The wire spool setup is connected to the C-arc with two PTFE tubes. Originally I wanted to use PU tubes for this (simple air hose) Adolfo mentioned in a reply on my blog that that would not work. I had PU lying around and tried anyway, just because I’m curious. It really really did not work. With PU the friction is so high that you need a tension higher that the breaking value of the brass wire just to pull it through.

I quickly switched to PTFE and the difference is enormous. Now everything is a smooth virtually friction free ride.

Thanks Adolfo!

Wire motor control finished!

Last weeks I’ve spent on finishing the wire handling, starting with the wire motor control. It has actually become quite sophisticated. My original idea was that the wire motor controller would only realise the closed loop torque control and the closed loop position control for the motors in the C-arc. I quickly finished that. Both motors have their own full PID control loop running at 200Hz (>10 the desired bandwidth is more than enough).

After the control was finished I decided to implement some other nice features as well. First I added a display. A 4 line 20 character LCD with backlight. I considered OLED first, but since the screen would be on for long times and would display mostly the same info, OLED will burn in. And so, I fell back to the trusty old-school LCD.

The LCD now gave me the opportunity to show some nice parameters. The first things I added were the wire speed in [m/min] and the wire tension [in % of max possible motor torque]. I thought about calibrating the torque setting so that I could display wire tension in [N] and eventually did not. The wire tension setting is a fixed setting anyway, it does not need to change often, so to select it a small experiment to determine at which percentage the wire breaks is sufficient. You then select 75% of that to have some margin. In my experiment the wire broke at 50% max motor torque so my setting will be ~37%. At high currents I’ll tweak it down since the wire will heat up and weaken.

The wire speed display in [m/min] is very accurate, it is calculated by using the encoder on the motor and by counting the number of pulses in a fixed time interval. The wire speed readout gave me a nice opportunity to realise a wire usage counter as well! The counter counts the total wire used. Even if the control box is turned off, the wire usage is stored in the EEPROM of the microcontroller. The next time the controller is started up, the usage value is retrieved and counting resumes were it ended last time. This meant however that the power of the microcontroller could not be switched of instantaneously, since the controller needs some time to write the values to the EEPROM. In order to solve that, there is a “ON” push button and a “OFF” push button for the control box. When off is pushed a nice shutdown procedure is triggered including storage of all relevant non volatile parameters. The final action of the shut down procedure is the automatic release of a relay that cuts off the mains power (normally open).

A reset mechanism for the wire usage is also in place in case a wire spool is changed by a new one. This is triggered by keeping “OFF” pressed while turning the control box on.

Next to the control of the wire motors in the C-arc, there are also two motors in the wire spool holder setup. There is one motor for re-reeling. This is a simple DC motor. I performed some experiments and noticed that no current limiting was required. Just a simple 5V DC for the motor was ok, even at RPM=0 the motor would not overheat. So I added a simple on/off switch for this motor to the front panel.

The second motor in the wire spool setup is a DC servo motor. It is required to sway the wire back and forth over the width of the spool body to evenly re-reel the wire. The control box provides the correct PWM control for this. The speed of the swaying motion can be set on the UI. At first I implemented a linear back and forth motion of the rotation axis of the motor. This resulted logically in a non-linear relation between the wire inter distances on the spool body. To correct for this I implemented a non-linear transformation in the firmware.

The controller also has a nice option to manually select the start position of the DC servo (manual mode), when you then switch to auto mode the back and forth swaying motion will start at the position indicated by the manual mode. The setpoint generator for the motion also stores the speed and direction in the EEPROM, just like the wire usage parameter. This makes sure the re-reeling resumes exactly where it left off (no jumps in servo position upon power on).





Wire Motor Controller progress

I worked on the firmware for the wire motor controller:

-Added ADC readout for the magnetic rotary encoder (hall sensor) and two potentiometers for torque and speed settings. For now, the speed and torque will be set by these two potentiometers. I might change this in the future so that adjusting these parameters can be done on a screen UI by using the USB interface to the control PC.

-Added 2 speed PWM outputs @ 20KHz

-Added an interrupt based system tick timer for the control loop

-Added UART communication to write debug messages to a serial terminal over USB

-Added an external 2.5V voltage reference for the ADC

Up next:

-Quadrature encoder software interface

-Quadrature encoder hardware interface for differential quadrature signals

-5V regulator, required for the rotary encoder, hall sensor and H-bridge logic

-Connect H-Bridge to control PCB

-Closed loop control code

Begin of WireMotorController design/realisation

I’m waiting on parts to finish the wire spool rig. In the meantime I’ve started with the design and build of the controller for both the wire motors in the C-arc.

The wire motors in the C-arc need to be closed loop controlled. One motor needs to be in closed loop torque control, with the magnetic rotation encoder as feedback. The other motor needs to be in closed loop speed control with the rotational quadrature encoder as feedback.

I searched for an off the shelf solution to achieve this, and noticed that the available options were remarkably pricy. I decided to design the electronics and SW myself, since it is something I’ve done many times.  The required power H-bridge can be purchased from eBay, many variants exist and they are very cheap. This is the one I selected:

In order to realise closed loop control a microcontroller is required. The micro needs to read the desired setpoints (torque and speed) and sensor values and calculate the required H-bride PWM duty cycles and direction so that the desired setpoints are achieved.

I chose the atxmega32d4, since I have a bunch lying around from another project. They are TFQP44, so you’ll need a small 2.54mm pitch adapter PCB (also from ebay).

This microcontroller has a quadrature decoder inside, which is very usefull for this application. I never use Arduino’s, I find them frustratingly inflexible. I always build my own boards from scratch on prototyping PBC material in order to have full flexibility. This can be done in 2 hours, I really do not understand the Arduino hype… The Atmel Software Framework allows you to quickly (and very flexibly) add required software functionalities to your project.

Last night I build the board, and wrote the application foundation to setup the PLL (uC runs on 24MHz, while external chrystal is 8 MHz). I also added the PWM function and tested the timing using an oscilloscope. Worked like a charm.




Wire spool rig progress 2

Last weekend I tried a few things for driving the wire spools. For the feed spool a friction break is sufficient. The belt brake with variable resistance works like a charm. For the waste wire take up spool I need a torque source. Ideally this is a geared DC motor drive that supplies a constant torque, independant of the spool rpm. I did not have a geared DC motor so I tried a stepper, I figured that with microstepping and current limiting there was a slight chance it would work. I had components lying around anyway so I tried.

Surprise, it did not work. A stepper just can’t be used smoothly to supply a torque to a load that has an unknown rpm. There was a lot of “stuttering” and jitter in the motion. Nice try. Instead, I’ve now ordered a geared DC motor. That should work just fine.

I’ll continue the work on the wire spool rig when the motor arrives.


Build of wire spools rig started

Today I’ve started with the design and construction of the setup that will provide new wire to the EDM machine and will re-spool used wire. This time no CAD design first. Its a relatively basic setup so I’m making the design as I’m building along. I already have all the required parts in house. Some are salvaged from the garbage bin, like the big bearings. I alway dig inside bins when I notice technical stuff is thrown away…. 🙂 The bearings come in handy as the big 22mm axles for the 160mm wire spool inside hole diameters will fit inside these bearings with a small adapter ring. The big bearings allow me to make a single bearing setup for each spool. This makes it really easy when spools need to be changed, since you can then just slide a new spool on the axle without having to unmount the axle.

The bearing blocks that fix the bearings to the extruded profile frame are finished. I made a press-fit to keep the block simple. That required quite a precision machining operation, the tolerance for press fits for that diameter is ~25um. I pressed the bearing in with the Z-axis motion of my CNC machine.


Finished seals and seal interface to water tank

After experimenting a bit, I found the perfect dimensions for the seal. It took 3 iterations. I had to make a setup to vacuumize the silicone before pouring to get rid of the bubbles introduced during mixing. I settled with a jar and a refrigerator pump to do the job.

The final mould is depicted below. The final seals are now finished. I also added the threaded rod interface to the bottom of the water tank. The’re screwed in with epoxy to make sure no water can leak through the thread. Next-up job is gluing the bottom of the tank to the top. I’ll use UV curing Acrifix acrylic glue for that. When that’s done the tank is finished!

Notches in watertank

I encountered some difficulties in assembly. Although is was possible to mount the tank to the frame, all the work table supports then needed to be removed, which is quite some work. In order to make (un)mounting the tank easy I added two notches so that the tank can be lifted over the work table supports. Luckily, the already glued tank fitted in my milling machine…