![]() ![]() This means each of the bytes in the packet can only represent 64 values ( 2^6 = 64). 0x03 = this signals the end of the packet ( ETX)Įach of these bytes are encoded by left-shifting the bits by two.MILLI_BETWEEN = number of milliseconds between each step (speed control).STEPS_2 = the low 6-bits of steps to take.STEPS_1 = the high 6-bits of of steps to take.MOTOR_NUM = the motor selected X, Y, Z, E0, E1.MOTOR_PACKET = CMD_TYPE MOTOR_NUM DIR STEPS_1 STEPS_2 MILLI_BETWEEN 0x03Įach motor movement packet consists of seven bytes and five values: ![]() If a motor has steps waiting to be taken, move the motor one step and decrement the respective motor’s step counter.Check if a motor has steps to take and the timing window for the next step is open.Load direction, steps, and delay (speed) into the appropriate motor struct.Check if a new movement packet has been received.The result, only one motor could be controlled at a time. It was not written with concurrent and independent motor operation in mind. I should point out, this project builds on a previous attempt at firmware:īut that code was flawed. I prefer to keep stuff as simple as possible, unless absolutely necessary. Include four commands: motor select, direction, speed, duration.So, I decided roll my own RAMPs firmware. When I bought the RAMPs board I started thinking, “I should see if we could re-purpose Marlin to drive the conveyor belt easily.” I took one look at the source and said, “Oh hell no.” Learning how to hack Marlin to drive a conveyor belt seemed like learning heart surgery to hack your heart into a gas pump. To ensure a long-life of your motor, do not set the amperage higher than needed to do the job. The your current_limit will vary depending on the drag of your conveyor belt and the quality of your stepper motor. We are watching the voltage, as it is related to the amperage we are feeding the motors. Watch the voltage on the multimeter–we want to use the lowest amperage which effectively drives the conveyor belt. Use the screwdriver to turn the tiny potentiometer on the stepper driver. Attach the positive probe to an alligator clip and attach the other end to the shaft of your screwdriver. Power on your RAMPs board and carefully attach the negative probe to the RAMPs GND. To set the amperage, get a small phillips screwdriver, two alligator clips, and a multimeter. This allowed me to drive the entire belt from one NEMA17. I’ve also increased the amperage to the stepper. Having all three jumpers enables maximum microsteps, but would cause the speed of the motor to be limited by the clock cycles of the Arduino–more on that soon. However, I did need to make two adjustments before starting on the firmware.įirst, underneath each of the stepper drivers there are three drivers for setting the microsteps of the respective driver. You follow about any RAMPs wiring diagram. Luckily, I had the PSU and a few stepper motors lying about the house. ![]() After some research I decided to meet both goals by purchasing an Ardunio / RAMPs combo package intended for 3D printers.Īt the time of the build, these kits were around $28-35 and included: Of course, one of the overall goals of this project is to keep the tools accessible. This was great, as several other parts of the LEGO classifier system would need steppers motors as well-e.g.,turn table and dispensing hopper. They provide plenty of torque and finite control. Stepper motors were a fairly obvious choice. To move forward with the LEGO sorting machine I needed a way to drive a conveyor belt. This portion covers the Arduino Mega2560 firmware I’ve written to control a RAMPS 1.4 stepper motor board.Ī big thanks to William Cooke, his wisdom was key to this project. This article is part of a series documenting an attempt to create a LEGO sorting machine. Programming Arduino from Raspberry Pi Command Line ![]() Install Tensorflow and OpenCV on Raspberry Pi Generating LEGO Images for Training a CNN ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |