Sunday, March 13, 2011

Manual Control Rough Build

I made some good progress over the last week or so. I've got all the buttons and the throttle control connected to the Arduino. It's pretty rough looking. I'm trying to pull lots of things together, the input controls connected to the controller and the firmware to respond to the input and move the motors.


I built the panel here pretty quickly. I wrote in a previous post how careful I have to be to avoid making mistakes when I'm building things. Norm Abram said, "Measure twice, cut once", right? He also said, "don't measure if you don't have to." If you need a board the same length as another, lay one over the other and mark the longer one to match the shorter. So I put the throttle control up to the right end and marked the board where the corners of the throttle line up and made square lines on the board. I marked the hole centers and drilled the holes. I went back to the throttle lines and baffoon that I am, I threw it on the band saw and cut to the lines. But the lines represented the "extents" of the top plate on the throttle. I was supposed to cut a smaller hole so the plate had something to sit on. That's what the ugly gap on the right is all about.

Then I went about soldering up a circuit board to connect the buttons and potentiometer to the microcontroller.


Yeah, that's pretty ugly. It's not nearly as easy to do this kind of soldering as it is a proper PCB. Believe it or not, there aren't any solder bridges here. In fact I had to troubleshoot a bad connection down one of the middle vertical lines. With the wires bridging each pad and piles of solder it was hard to tell there was half a bridge that didn't come down on the other side. I think I discovered this doing a continuity check early on but I didn't trust my meter. So I wasted some time pulling things apart to find the problem.

Once the inputs were all responding, I ran into another problem. When I built the opto-isolator circuit I did a nice wiring diagram but I didn't follow it opting instead to run the wires the easiest way. So I didn't know what Arduino pins mapped to what stepper driver pins. I had to modify the firmware to allow me to interactively set the mapping without multiple uploads.

I got the manual controls all working properly. That's pretty cool. But the motion of the motors is odd. At very low to moderate speeds, the acceleration algorithm seems to be good. But as it moves to higher speeds it gets jumpy and even stops momentarily. There could be a number of reasons for this. There could be a problem with the interrupt routine where the time it takes to execute the interrupt is longer than the time between steps. It could also be a problem with "resonance". I don't really have any experience with this, but the steppers can lock up at certain frequencies. The steppers are just sitting on my workbench, they aren't under load. It's possible putting some load on it may take care of the resonance.

It might also be my acceleration algorithm. The idea is pretty simple: the motor is turning at speed A and we want it to turn at speed B, so with each step we change the current speed by C, which is our acceleration constant. This seems to work well at low speeds but it may be too coarse at higher speeds or there might be some little error in calculations. I think I'll take a look at some of the RepRap GCode projects that also use constant acceleration.

One "interesting" thing that happened is that when I upload the firmware while the stepper controller is on, the X stepper goes nuts. The X step signal is on pin 0. This would be bad for a regular Arduino as pins 0 and 1 are serial lines. This is a Sanguino board which has serial lines on 8-11 (it has 2 serial ports). I'll have to look at the specs for the Sanguino or find someone who knows what's going on.

No comments:

Post a Comment