Thursday, January 7, 2016

Autocad Fusion 360 and panel layout

I learned to draft on a drafting table with a pencil and rulers when I was young both watching my father and in a high school class.  I took an autocad(r) course in college.  I taught myself autocad(r) and MANY other programs trying to become somewhat efficient at getting concepts out of my head into the computer.  I have always struggled with these tools.  They seem to do some things well and then something fundamental (to me) not so well (or not at  all).  Mainly I have never found a tool that seems to fit me, until now.

Autodesk Fusion 360(r) is a extremely intuitive comprehensive design tool.  I have learned to operate somewhat effectively with only completing a few of the provided step-by-step tutorials  The package does design, assembly, animation, rendering, FEM, 3D printing, CAM and more.  It is free for hobbyist (for a year) and free to students (3 years).

I have maybe 2-3 hours with the application and below is the layout of my mill electrical panel.  It's fairly empowering to see a design before building it.


Hats off to Autodesk for providing the community with such a powerful tool for free (and actually a reasonable paid rate of $20/month).  They also provide loads of training sessions for free.  I hope this platform flourishes and the hobby community leverages the power it contains.  In my opinion, Fusion 360 is in a class entirely by itself (that is a lot coming from me).

Monday, December 14, 2015

DIY Hot End - Arduino PID control






So I really want a 3D printer.  I am creating some components to mount on my mill as a printing kit.  Possibly something usable by others?  This is how attempted to create my first hot end.

What is a hot end?

This part of a 3d printer is the melting point of the print media.  Most are a print nozzle and heater mounted in an aluminum block.  The media is feed into this block and the media in liquid form comes out the nozzle. I was shocked at the size of the nozzle.  REALLY small.  There is a tube to feed media that is cooled to ensure media melts only near the nozzle.  Fans are typical on the heat sink.


Hot End Hardware

I purchased a low cost clone hot end from amazon.  My thoughts were that I could learn something from a fairly inexpensive product.  The heater is 40 Watt and it contains a 100KOhm 3950 thermistor.


Arduino Hot Heat Control

The next step was how to control the temperature of the hot end.  I had an Arduino Yun available.

 ArduinoYun Official Site


The following is how I fulfilled my fulfill my requirements.

Temperature Measurement 

I have to know the temperature before I can control it. A thermistor (pre-installed in hot end) basically is a resistor that changes value (non-linearly) bases on the temperature.  I found a great explanation of them and how to measure with the arduino. Thanks to 'lady ada' for all the great input.  Well written article. See: How to connect and measure a thermistor with an arduino.   I used a 10K balance resistor.  I do not believe my temperatures are ready correct values yet but the values are moving as I would expect.  I will figure out the scaling and report back. If I build the next hot end it will contain a thermocouple.

<Need Photo of the thermistor here...>

Control of the heater output

The 12VDC 40W heater needs to be regulated.  The cheapest/simplest method I could find was to use a TIP120 NPN transistor.  They are really common and handle a fair amount of power.  I found a great blog/explanation here: How to switch higher current loads with a transistor and arduino.  I use the PWM output to switch the transistor using the built in Arduino PWM.  This seems to work well.  I put an LED between the Output pin and ground to give general visual indication of the output.  The load power is 12VDC.  I also paralleled a small case fan with the 40W heater.  I will most likely move this to another output and base the speed on temperature instead of heater current but I like seeing it spin up and then stop.

<Need photo of the heater here...>

As suggested in the comments, I have updated this project to use a MOSFET. I learned about using them here: High-Power Control: Arduino + N-Channel MOSFET.  I have found it allows more current flow and better heat control.  I used a BUZ91A (amazon item)

A control logarithm (Arduino PID)

The Arduino PID control library is mature and there are some great explanations/insights available.  I learned reading Improving the Beginner’s PID – Introduction.  I am still working on the tuning.  I also created a simple sketch based on the Arduino AutoTune library.  Another great post/tutorial  from the same author (much thanks Brett Beauregard) here that demonstrates his code.  I played with this for a while to get it to work.  You want to play with the step and start point so that the loop can move the output and see resultant changes.  That is how it learns (I think).  Again, I am still tuning/learning but my loop trains in on a temperature quickly enough and stabilizes very well.

Side Note:

Notice the PID goes to full scale (255 is max) in a few seconds of a change.  I think I like this response because I'm sure the plastic melting load will be significant.  I would say starting, stopping and speed changes is when the temperature will be an issue.

Communications of setpoint and status

I use the basic USB serial communications of the Arduino for the moment.  The unit constantly ouputs the current temp, current heater output level and current set point.  The arduino also listens for a single input value that it sets as the new set point when it receives. The near future plan is to add a Rasberry pi to the mill.  Hopefully it will control this set point using a Web API published through the Yun's web functionality.

Notice the PID goes to full scale (255 is max) in a few seconds.  I like this response because I'm sure the plastic melting load will be significant.  I would say starting, stopping and speed changes is when the temperature will be an issue.





Arduino Sketch

This should run on any Arduino.. Enjoy.  Let me know if does you any good and please share improvements.

#include <PID_v1.h>
// Analog output pin
#define outputPin 9
// thermistor analog pin
#define THERMISTORPIN A0
// how many samples to take and average
#define NUMSAMPLES 5
// how long between pid/sampling
#define SAMPLETIME 1000
//Define Variables we'll be connecting to
double Setpoint, currentTemp, Output;
//Specify the links and initial tuning parameters
PID myPID(&currentTemp, &Output, &Setpoint,15,.3,0, DIRECT);
void setup() {
  Serial.begin(9600);
  analogReference(EXTERNAL);
  pinMode(outputPin, OUTPUT);
  //initialize PID setpoint *C
  Setpoint = 110;
  //turn the PID on
  myPID.SetMode(AUTOMATIC);
  myPID.SetSampleTime(SAMPLETIME);
  //pid Autotuner
}
void loop() {
  if (Serial.available() > 0) {
    // get incoming byte:
    Setpoint = Serial.parseFloat();
  }
  uint8_t i;
  double average = 0;
  // take N samples in a row, with a slight delay
  for (i = 0; i < NUMSAMPLES; i++) {
    average += analogRead(THERMISTORPIN);
    delay(10);
  }
  average /= NUMSAMPLES;
  currentTemp=resistanceToC(inputToResistance(average));
  myPID.Compute();
  analogWrite(outputPin, Output);

  Serial.print("Set Point: ");
  Serial.print(Setpoint);
  Serial.println(" *C)");
  Serial.print("Temperature: ");
  Serial.print(currentTemp);
  Serial.println(" *C)");
  Serial.print("PID output ");
  Serial.println(Output);
  delay(SAMPLETIME);
}
double inputToResistance(double input) {
  // funtion to convert the input value to resistance
  // the value of the 'other' resistor
  double SERIESRESISTOR = 10000;
  input = 1023 / input - 1;
  return SERIESRESISTOR / input;
}
double resistanceToC(double resistance) {
  // funtion to convert resistance to c
  // temp/resistance for nominal
  double THERMISTORNOMINAL = 118000;
  double TEMPERATURENOMINAL = 25;
  // beta coefficent
  double BCOEFFICIENT = 3950;
  double steinhart;
  steinhart = resistance / THERMISTORNOMINAL;     // (R/Ro)
  steinhart = log(steinhart);                  // ln(R/Ro)
  steinhart /= BCOEFFICIENT;                   // 1/B * ln(R/Ro)
  steinhart += 1.0 / (TEMPERATURENOMINAL + 273.15); // + (1/To)
  steinhart = 1.0 / steinhart;                 // Invert
  steinhart -= 273.15;   // convert to C
  return steinhart;
}



Basic Diagram


I love EasyEDA.  I will probably order a custom board once I add a few more options to the prototype.  See the diagram in an editable link here: Mill Hot End Control







Looks like this is going to work well.  I may update the post as progress is made.  Thanks for all the great input from those mentioned above and elsewhere.




Tuesday, March 10, 2015

No longer a disorder...

I am tired of being guilty for who/what I am. That situation both cripples my confidence and enables my ‘enablism’. I do not want your guidance. I do not want your sympathy. I want equal ground. I want respect. I have as many things to work on as any other normal person plus some. I accept that, own it and even cherish it. Do not mistake that for weakness. This introspective is power. I will no longer accept responsibility just because guilt is offered. Your disagreement with me can no longer be summed up with some chink in my armor. I will now stand to defend my comfortable confidence. I will meet the conflicts with my heart humble but my chest and head high. I accept disagreement. I dig from deep within to meet head on without cowering. I offer peace without compromise, responsibility without weakness.

Me with add…

Monday, October 20, 2014

Egyptian wheat. Not Shattercane!

For the past several years I have planted Egyptian wheat around edges of a few fields also in some 'thrown together' mixtures with other wildlife friendly plants. The plant was originally suggested to me by kitchen seed in Pittsfield, IL. I enjoy visiting here as they are knowledgeable, take the time to offer good insight by listening to your needs and are willing to sell a wide variety of seed in my small quantities.  I had inquired about quail food plot ideas and this was one of the suggested plants. I was fairly hesitant because I knew it was similar to ShatterCane (actually is the same genus and specie?).  I did not want to infest my farm or my neighbors farms with that invasive hard to control problem. I was assured the seed was infertile since planting I have not had any volunteer plants. The wheat has preformed very well for its intended purpose of feeding birds, particularly quail and turkey. I have seen all types of animal tracks in plots during winter. The plant seems to grow well in tough conditions: no-till and little to no 'weed control'. You can see from the photos it grows with significant grass competition. It grows very tall (>10') and produces a large seed head at the top. I estimate about the production per plant at about two cups. The seed is mature very late (late October/early November in midwest?) and seems to provide decent winter food. I try to mow around the edges of some plantings to foster good quail habitat (strips). Although I am still disappointed with the overall quail population, I feel I have seen more quail since I began planting. I do wonder, after seeing the minute size of a baby quail brood(?) last year if the seeds are small enough for the young?

One seed head. Spray paint lid.

Seed head. Most seed did not want to be removed yet.. still green in plants 


Single plant that seed head came from. About 8'

Random mixture planting



Couple rows no-till on field edge

4 rows next to field road. Mowed the adjacent sunflowers.  


Wednesday, October 15, 2014

CNC Rebuild Wiring Diagram Version 1

Below is a first shot at my CNC machine rebuild wiring diagram.  It contains a C11S parrallel port breakout board from CNC4PC.  3 KL-9082 Stepper Motor Drives from Keling. An Allen Bradely VFD drive to provide variable speed to the spindle driver.  I am controlling incoming power to the VFD with a relay.  The coil will power from the system 'master power'.  The enable input on all drives and the breakout board will be de-energized using an E-Stop.  Not sure about this configuration yet.  Diagram does not show any limits yet.