I always intended to transfer the breadboard circuit onto stripboard, but never got around to it. The motor spindle went from being loose to fixed firm (stepper motors draw current and lock without an input signal).
I connected the four power lines to each stepper motor and powered up the driver circuits. I soldered on the headers so the two driver circuits would plug into the breadboard. It was also easier to get pre-built stepper motor driver circuits to save time, and I found the (excellent) ‘EasyDriver – Stepper Motor Driver’ circuits. The Pi GPIO would provide the signal (the pulses mentioned earlier) as a square wave, but the Pi can’t provide the current needed to drive the motors, so you need some additional circuitry to boost the amps.įirstly, I connected the GPIO from the Pi to a breadboard so that the signals from individual pins were accessible. Hardware – Setting Up The MotorsĬonfident that the underlying mathematics was all manageable, I moved onto the hardware and getting the two motors powered up. You can use the same working to calculate the pulses needed to set the new length of the left-hand belt, Ll (the answer is 91 pulses). This requires 302.9/40 = 7.57 rotations of the motor spindle.Īs a single rotation requires 200 pulses, we can calculate that the right-hand motor must receive 200 × 7.57 = 1514 pulses. Just considering the right-hand motor and Lr, the change in Lr is 461 – 158.1 = 302.9 mm. If I want to move the pen to Point B (350,450) then we need to make Ll = 353.6 mm and Lr = 158.1 mm. In the example before, if the pen is at point A(150,200) we know Ll = 335.4 mm and Lr = 461.0 mm. You can see the left-hand motor setup in the image above. This means one rotation of the motor would take 200 pulses, and would move the pen 40 mm closer/further from the motor. The sprockets I found had a circumference of 40 mm. This had the advantage that the pulley wouldn’t slip or stretch (unlike string). I then dipped into the world of 3D printers to get a GT2 toothed pulley for the motor shaft, and decided I’d use a GT2 toothed belt to run over each pulley and suspend the pen.
For each pulse, the motor would turn 1.8 degrees, so 360/1.8 = 200 steps per full rotation of the motor shaft. I bought a pair of NEMA stepper motors which are driven by electrical pulses (that would come from the Pi’s GPIO). I then started to think about moving the pen across the paper to draw a line. And, if I want the pen to be at p(150,200), then x=150 and y=200 so the belt lengths can be calculated as: So, if the plotter is 500 mm square, h=500, w=500. The v-plotter makes two right-angled triangles, and the values can all be calculated using Pythagoras’ theorem:
I wanted to work in Cartesian coordinates, so if I want the pen at point p(x,y) how long would the belts from the left motor (Ll) and the right motor (Lr) need to be? To know that, I also need to know the height of the paper (h) and the width between the two motor spindles (w). I sketched out a simple model of a plotter. That way, if the project is beyond me, I find that out early on and abandon it! For the plotter project, I wanted to make sure I could understand the underlying mathematics. I start new projects by working on what I think will be the hardest part of the project for me to complete. Cooling fan for motor driver circuits (normally mounted over the breadboard)