Restruder 9/17/2023 – 9/23/2023 Updates
One of the issues from the last semester that I wanted to improve is that the diameter sensor for the Restruder. While looking at the previous diameter sensor, we noticed that the sensor was not performing up to the standard we wanted and I was tasked with finding a alternative for this sensor.
Prevoius Diameter Sensor
https://www.thingiverse.com/thing:454584
Through doing research, I was able to find an open source design that was using a different type of sensor to do our task. The sensor that I found was using a linear hall effect sensor with a magnet to get the diameter of the filament. This was done by having the magnet attached to a lever that was pushed away from the linear hall effect sensor and the information then could be used by an arduino to get pretty accurate measurements. This design was focused on low cost and being compact which is important to the Restruder project.
Current Filament Diamter Sensor
https://www.printables.com/model/57154-infiDANK
I am current getting the parts of this sensor and assembly the sensor. I am plannning to have the sensor assembled by the end of next week. For the next week I am starting to design a containment system for the whole project.
Restruder 9/24/2023 – 10/1/2023 Updates
This week I mainly focus on the assembly on the filament diameter sensor. I am also got some goal for website development for this website. Which is a new experience for me and I am excited to start. Finally the design for a containment system for the whole project is being taking up by Alex Nigrine.
Printing of the Filament Diameter Sensor
The printing of the filament diameter sensor took longer than I expected. My first prints were using ABS filament in which the process of filing down the filament was difficult and I ended up craking the print to the point the it was unusable. I decided to swicth to PLA filament but I had major difficulty in which either while printing the thickness of the filament comming out was not correct and making them fragile or the print did not stick the plate. I ended up getting the parts printed correct torward the end of the week.
ABS Print of the Block
In this print some of the holes in the project was filled with filament which was too difficult to remove.
ABS Print of Lever
In this print while filing it it ended up snapping the piece in which the part is not unusable.
Final PLA Print of Block
The Assembly process
This week I ended up getting some part of the assembly process. In which I put the bearing and pins in the lever of the filament sensor.
Lever with bearings
Goals for next week
I plan to finish the sensor this week to use with the whole project. Also in some spare time that I have start some website developent ideas.
Restruder 10/2/2023 – 10/8/2023 Updates
This week I continued assembly of the filament sensor and getting the final pieces together for the final assembly. I wrote a basic arduino code that reads the linear hall effect sensor and show it as analog data.
For future use of the arduino code I would need to put an averaging function in and find and calculate the analog data into a diameter length.
Goals for next week
I would like to fully assembled the filament sensor and start working on the arduino code to have it more useful for the project.
Restruder 10/9/2023 – 10/15/2023 Updates
This week I was able to get the filament diameter sensor fully assembled and was able to get some updates for the Arduino script for it.
Fully assembled filament diameter sensor
I made the decision to put a screw instead of a pin for attaching the lever to the body to make it removable in case the lever breaks. The linear hall effect sensor is glue to the body of the sensor.
Code
With the Arduino code I updated the code using parts of the Infidel sensor code that could be found here. The code that I have now can take filament diameter reading but I would need to go and test if it is accurate enough.
Arduino Code
int analogPin = A3; //set pin A3 into an input
// set up final data
float dia;
// Declare the function before loop
float converter(float x) {
// This is where the math is done
//converts an ADC reading to diameter
//Inspired by Sprinter / Marlin thermistor reading
byte numtemps = 2;
const float table[numtemps][2] = {
//{ADC reading in, diameter out}
//CALIBRATION ONLY
//(unless you want to do the lookup on your host)
{ 0 , 0 },
{ 1023 , 1.023 }
};
byte i;
float out;
for (i = 1; i < numtemps; i++)
{
//check if we've found the appropriate row
if (table[i][0] > x)
{
float slope = (table[i][1] - table[i - 1][1]) / (table[i][0] - table[i - 1][0]);
float indiff = (x - table[i - 1][0]);
float outdiff = slope * indiff;
out = outdiff + table[i - 1][1];
return out;
}
}
// Return a default value if no suitable value is found
return 0.0; // or any default value you prefer
}
void setup() {
// put your setup code here, to run once:
// define speed of serial
Serial.begin(1200);
}
void loop() {
// put your main code here, to run repeatedly:
float x = analogRead(A3);
dia = converter(x);
if (dia > 0.70 && dia <0.75){
dia = 0;
} else {
dia = dia + 1.1;
}
Serial.println(dia);
// short delay
delay(1000);
}
// measurement given out in mm
Serial Plot when no filament is in
Serial Plot when 1.75mm
Restruder 10/15/2023 – 10/22/2023 Updates
This week I mainky was working on the Arduino script that is used to convert a Analog input to an reading in mm. I was mainly looking at in the converter function if the const float table in there could be changed to make more acurate to the system and to be able to not use the if statements I put in. In the next week I will be still working on the code to be able to find a better response to the sensor.
My current code
int analogPin = A3; //set pin A3 into an input
// set up final data
float dia;
// Declare the function before loop
float converter(float x) {
// This is where the math is done
//converts an ADC reading to diameter
//Inspired by Sprinter / Marlin thermistor reading
byte numtemps = 2;
const float table[numtemps][2] = {
//{ADC reading in, diameter out}
//CALIBRATION ONLY
//(unless you want to do the lookup on your host)
{682 , 1.50},
{741 , 0}
};
byte i;
float out;
for (i = 1; i < numtemps; i++)
{
//check if we've found the appropriate row
if (table[i][0] > x)
{
float slope = (table[i][1] - table[i - 1][1]) / (table[i][0] - table[i - 1][0]);
float indiff = (x - table[i - 1][0]);
float outdiff = slope * indiff;
out = outdiff + table[i - 1][1];
return out;
}
}
// Return a default value if no suitable value is found
return 0.0; // or any default value you prefer
}
void setup() {
// put your setup code here, to run once:
// define speed of serial
Serial.begin(2400);
}
void loop() {
// put your main code here, to run repeatedly:
float x = analogRead(A3);
dia = converter(x);
//if (dia > 0.73 && dia <0.75){
//dia = 0;
// } //else {
//if(dia > 0.60 && dia <0.73)
//{
// dia = dia * 2.69231;
//}
//if(dia > 0.50 && dia <0.60)
// {
// dia = dia * 5.55556;
//}
//}
Serial.println(dia);
//Serial.println(x);
// short delay
delay(1000);
}
Restruder 10/22/2023 – 10/29/2023 Updates
This week I have been updated the code to get the filament sensor a better response to the input data. I been using drill bit heads for calibration and got the code functinoal to a certain extent.
const int analogPin = A3; // set pin A3 into an input
float dia;
float converter(float x) {
byte numtemps = 5; // Update the number of rows in the table
const float table[numtemps][2] = {
//{ADC reading in, diameter out}
//CALIBRATION ONLY
//(unless you want to do the lookup on your host)
{536, 3},
{610, 1.984375},
{644, 1.75},
{683 , 1.5875},
{743 , 0}
};
byte i;
float out;
for (i = 1; i < numtemps; i++) {
if (table[i][0] > x) {
float slope = (table[i][1] - table[i - 1][1]) / (table[i][0] - table[i - 1][0]);
float indiff = (x - table[i - 1][0]);
float outdiff = slope * indiff;
out = outdiff + table[i - 1][1];
return out;
}
}
return 0.0; // or any default value you prefer
}
void setup() {
Serial.begin(2400); // define speed of serial
}
void loop() {
int numSamples = 10; // Number of samples to average
float total = 0; // Initialize the sum of samples
for (int i = 0; i < numSamples; i++) {
total += analogRead(analogPin); // Add each sample to the total
delay(10); // Delay between each sample reading
}
float averagedValue = total / numSamples; // Calculate the average
dia = converter(averagedValue);
//Serial.println(dia);
Serial.println(averagedValue); // Print the averaged analog reading
delay(100); // short delay
}
In the updated code there are a couple things that change. First I removed the if else statement and when to edit the float table in the converter function. These values that I change to is the analog value to the mm values to help with the calibration. This was done by using a couple of drill bits and taking the raw analog value. I also added a averaging function since I notice there was some nosie in the sensor and I wanted to reduce that to get more consistent values.
Goals for next week
For next week I want to test my code accuracy and I want to look into if the resolution of the sensor could be change through code. I also want to work on some of the website and make progess on that.
Restruder 10/29/2023 – 11/5/2023 Updates
This week I mainly looked into the accuracy of the filament diameter sensor code. This was done to see if the sensor was accurate enough to be able to and to see if I could improve the accuracy. I ended up changing the calibration of the code to imporve the accuracy of the sensor. I ended getting a consistent error of + or – 0.02 mm. Which is an improvement from before.
Current calibration that I gotten
float converter(float x) {
byte numtemps = 6; // Update the number of rows in the table
const float table[numtemps][2] = {
//{ADC reading in, diameter out}
//CALIBRATION ONLY
//(unless you want to do the lookup on your host)
{536, 3},
{566, 2.31},
{600, 1.98},
{638, 1.72},
{694 , 1.58},
{743 , 0}
};
Goals for next week
Next week I want to be able to help out with the intergration of my code with the rest of the system code and be able to test some filament with the stepper moving at the appropriate rate.
Restruder 10/29/2023 – 11/5/2023 Updates
This week I mainly worked on the develpoment of the OSHE website. I am also working with Alex Nigrine on the implementaion on the 3d model on the mounting of Restruder.
Goals for next week
Next week I want to be able to help out with the intergration of my code with the rest of the system code and to be able to help with the physical mounting system for Restruder.
Restruder 11/19/2023 – 12/3/2023 Updates
I was mainly focus on updated the stl file for the 3d model of the mounting of the Restruder. In which I added a spot for the filament diameter sensor could be attached to.
Model that I edited
Then I worked on printing the part in whihc casused a lot of issue. When first editing the file the file got corrupted and created a shell in stead of an solid part. which made printing have a couple of air gaps and snapping easily. This was not notice until a later point but when the issue got found, it have gotten fix.
The print with the sensor attached to it
Restruder 12/03/2023 – 12/10/2023 Updates
This week I focus on working on the final report to get our porject ready to be completed by the semester. I also finished the website development. I am also working on the final touches for the final check of the project.
Restruder 1/21/2024 – 1/27/2024 Updates
These past couple of weeks I have been focusing on getting caught back up to speed with Restruder, and getting a reviewing last semester goal and updated them for a better well defined scope of the project. After a long discussion we have decided to implement Restruder on a Taz 6 3d printer with a fully swapable extruder system. We wanted to make a fully swapable extruder system because when we were going to test our system to the 3d printer we did not want to go through and breaking one of the printers that everyone useses while attaching and detaching our system to it. The Restruder actual pieces will still however can be transferable from different printers. Our goal for this semester is to get a testable restruder system going for others to gather data on.
Final design idea sketch
Current Circuit Schematics
Goals for the upcoming week
I am going to mainly responsible for the mechanical design for the extruder and getting that up and running as soon as possible. The first thing I would have to do is to get the BOM of the taz 6 extruder to see all the nesscary parts. All of the document of the Taz 6 3d printer could be found here. In previous semseter there is a extruder mostly built. We are planning to use that to cut costs and to save time. Then I would go through and see what is missing and start printing on any of missing part and order part.
Concerns
I am a little worried for next week that the parts we are going to need are going to go above our budget. I am also concerned that going through the documentation is going to take longer then nesscary and hold us up a little bit.
Restruder 1/28/2024 – 2/3/2024 Updates
This week I mainly was going through the documentation that could be found here. In which I moved the BOM for the Luzbot Taz 6 and was looking at the extruder system we had. Turns out the extruder system that we had from previous semesters was a KitTaz 3d printer. In which we were able to receive a Luzbot Taz 6 from a printer that was no longer being used in this enterprise.
My Goals in for the semseter (so far)
- Attach our extruder assembly from last year to the extruder of the Luzbot Taz 6
- See if there are any issues with the current design of the extruder assembly
- Design a way for a circuit board could be attached to the system
Goals for next week
Next week I will be focusing on attaching our part to the extruder assembly and see if there are ay issue with it and make changes if so.
Restruder 2/4/2024 – 2/10/2024 Updates
This week I went and disassembled the Luzbot Taz 6 extruder adn try to attach our design for the assembly. There were an issue in which the sensor was getting in the way of the exturder assembly. in which the sensor will have to be up higher so the bolts will not get into the way of the 3d printer extruder assembly.
New Extruder Design
In which I have been trying to print this for the rest of the week. There have been a lot of struggles with printing this. I had had a lot of failed prints while trying print this. There is an issue where the filament is curling and after chagning settings it continue to fail the print. My Goals in for the semseter (so far)
Goals for the semester
- Attach our extruder assembly from last year to the extruder of the Luzbot Taz 6
- Print out of the current redesign of the sensor attachment
- Design a way for a circuit board could be attached to the system
Goals for next week
Next week I am going to printing this piece out and attach it to the extruder assembly.
Concerns
I am a little concern that I will not be able to print the part out and will continue to spend much more time than needed to print out this part.
Restruder 2/11/2024 – 2/16/2024 Updates
This week I printed out the new extruder design and focused on the reassemble of the extruder system. With the sensor being attached there the printed gear is having issues with moving with the sensor attachment bolts being on there. So I added a washer for a spacer so that the gear could move freely, otherwise I did not change the LuzBot Taz6 6 extruder system design.
Reassembled Extruder system
Goals for the semester
- Attach our extruder assembly from last year to the extruder of the Luzbot Taz 6 (done)
- Print out of the current redesign of the sensor attachment (done)
- Design a way for a circuit board could be attached to the system
- Test the sensor system to see if there are any issues
Goals for next week
Next week I am going to be focusing on provide a test in which nothing is changed with extruder expect for the sensor being there and see if there are any issues with the sensor being attached to the system.
Concerns
I am concern that the test would take up too much time and I will not be able to get it done in time.
Restruder 2/16/2024 – 2/24/2024 Updates
This week I have done some initial testings with the extruder assembly. In which I did three tests which are movement, filiament insertion and removal, and a test print. The movement test that was conducted was to be able to move the 3d printer to the maxium x, y, and z values to see if the sensor is going to cause interference with the 3d printer. I also did a movement test in which filament is inserted into the 3d printer. The filiamnet insertion and removal was to see if the extruder system could be able to insert and remove filament with no issues. I also did a test print to see if there were any issues with the extrusion rate.
Movement
With the extruder system attached to the 3d printer there were no issues with movement. However there are some concerns with the extruder sytem. With the sensor being attached there is now a new maxuim height of the extruder system in which the sensor was going above the frame of the 3d printer. This would mean that with this system would have to have nothing on top of the printer so that the sensor can not interfere with the printer.
Also, the wiring would have to be managed and matained since when the printer heads towards the maxuim value of z the room in front of the extruder is very little.
Filament
This test went fine however a few consdieration needed to happen. Since the sensor can only handle fialment from 1.5 to 2.5 mm of diameter, the recommend diameter for the Luz bot Taz 6 is 2.85mm this could not be inserted into the printer any more. Also when the filament is inserted, the extruder end up pumping out filament even though there are no commands to do so. This might cause problem in the future.
Test print
In this test I put a small rectangle for the 3d printer to print out in which i used 1.75mm diameter filament and change the setting for the G-code to have it print 1.5mm diameter of filament. There were a lot of problems with printing. There was a lot of inconsistently with the extrusion rate. Which made many prints failed. Next week I am going to test with a different extruder to see if there is a problem in gernal or is it the extruder assembly.
Goals for next week
Next week I am going to be focusing on provide a test for printing with a different extruder assembly and fixing the issue with the printer or the extruder.
Concerns
I am concern that the test would take up too much time and I will not be able to get it done in time. Also I am worried about the intergration of the rest of the electrical components.
Restruder 3/3/2024 – 3/9/2024 Updates
This week unfortunately I have gotten really sick and was unable to do much this week. This week I was setting social media requirments and a submission form with Liam Kane for this semseter. Next week I want to get our extruder system to print a part out with only minor issues. I will test print with a different extruder system to give my test some control. I will also be starting designing a way to have our electrical system. After our design critical review there was an idea of putting it on the back of the extruder using velcro.
Goals for the semester
- Attach our extruder assembly from last year to the extruder of the Luzbot Taz 6 (done)
- Print out of the current redesign of the sensor attachment (done)
- Design a way for a circuit board could be attached to the system
- Test the sensor system to see if there are any issues(in progress)
Restruder 3/10/2024 – 3/16/2024 Updates
This week I finished our initilize testing for our extruder system. I have printed out a couple of test prints and everything worked our fine. I did a control print from an already working printer and I did two test prints from our extruder system. in the picture below the control print is labeld C and the test prints are T1, and T2. There is some inconsistencies with the printing that are unknown. Between T1 and T2 there are some differences even though the printer settings are the same. This could be from the filament I was using and the print was affected by that.
Test and control prints
The next thing I am working on is designing the part for the pbc board. I am a designing a snapable part that would attached to the back of the Luz Taz bot 6. On the back there is a nice bracket that has no belts and gears that would get in the way of the part. The only thing that would have to be considerd is the wiring management with our parts and our extruder system.
Back of Luz Bot Taz 6
My Goals for the semester
- Attach our extruder assembly from last year to the extruder of the Luzbot Taz 6 (done)
- Print out of the current redesign of the sensor attachment (done)
- Design a way for a circuit board could be attached to the system(in progress)
- Test the sensor system to see if there are any issues(done)
Restruder 3/17/2024 – 3/24/2024 Updates
This week I mainly worked with designing the part that will attached the 3d printer. In with this I am currenly testing of the design that I have will have enough force to hold the pieces together to the back of the 3d printer. A change of deisng was made between this week and last week. After a discussion, the snappable part was going to be hard to do since the 3d filament is not really felxable and hard to move around once printed properly.
Current design
In this design I have two parts in which they would clasp around the back of the 3d printer in which a bolt and net will provide a amount of tension to hold them together. The parts designs could be found on the osf cite. Next week, I will be testing and updating the design.
My Goals for the semester
- Attach our extruder assembly from last year to the extruder of the Luzbot Taz 6 (done)
- Print out of the current redesign of the sensor attachment (done)
- Design a way for a circuit board could be attached to the system(in progress)
- Test the sensor system to see if there are any issues(done)
Restruder 3/24/2024 – 3/31/2024 Updates
This week I tested the design and made some adjustments to the design that will be putting in the osf cite. In the orginal design the holes of the piece did not align with the circuit board. The board was printed off with 2.85 pla with the recommend settings for the printers. Also the amount of thickness of the board for the circuit board attachement could be reuduced for more room for the bolts since there is not enough room for bolt and nuts between the printer and the design.
Original design
Original design on printer
When it is on the printer the bolt will need to be tighten for the part to stay still. However for furture, the design might change since it is not easy to tighten the bolts at this moment. However once the bolts is tighten the design will stay in place. The newer design gives a slight distance between the part for the bolts to attached to. Also the holes of the part will be adjusted, however I made them to big so in the next upcoming week there will be more adjustments for the design. Putting holes to align a part is usaully the hardest part of the design in my case.
Current design of the part
Current design on 3d printer
There was an idea of making the part more easily to be attached in which a marble spring attachment method. In which when the part is pinched it opens up and returns back to a close state when release. In which design will be worked on next week. Also I will be helping with finding the wiring scheme for the 3d printer in preperation of our circuit board being implemented with the design.
My Goals for the semester
- Attach our extruder assembly from last year to the extruder of the Luzbot Taz 6 (done)
- Print out of the current redesign of the sensor attachment (done)
- Design a way for a circuit board could be attached to the system(done)
- Test the sensor system to see if there are any issues(done)
- Find the wiring documentation for the 3d printer (in progress)
- Create a better design of the circuit board attachment (in progress)
Restruder 3/31/2024 – 4/6/2024 Updates
This week I updated the design that so it would fit the circuit board we are planning to use. I used 2.85mm PLA on the LuzBot Taz 6 to be able to print this part. In my design I kept the concept the same, however the peices that the board wiht support would have to be longer.
Design of part
I chosse to not put the holes for the circuit board since I always make the holes to far apart anyways. When printing this you can either add holes to the design for the circuit board you use or drill them out manually. I had drill out and attach the circuit board to the piece.
cicuit board on piece
In this design the attachement turned in a snap on design which is really nice. This is only done when the bolts and nuts are tighten. The only downside is the circuit board does not attach very well and will have to be improved on later on. These files will be on our osf page. I also found some wiring documentation for the LuzBot Taz 6.
Circuit Documentation
Next week I will be helping with the implemenatation of the circuit board with the LuzBot Taz 6. This will include taking wires from the extruder system and powering our circuit system so our code could be tested.
My Goals for the semester
- Attach our extruder assembly from last year to the extruder of the Luzbot Taz 6 (done)
- Print out of the current redesign of the sensor attachment (done)
- Design a way for a circuit board could be attached to the system(done)
- Test the sensor system to see if there are any issues(done)
- Find the wiring documentation for the 3d printer (done)
- Create a better design of the circuit board attachment (in progress)
- Implement the circuit board with the system (in progress)
Restruder 4/6/2024 – 4/12/2024 Updates
This week I have done a couple of things. First I have redesign the eletronic holder to take up less space. This design is trying to not take up as much space on top of the 3d printer. While testing the design having the 3d printer head towards the upper bounds of z, the design got stuck and was difficult to remove. This new design is to take up minimal space so the 3d printer does not get stuck.
New design
In this I have printed this peice using 2.85mm pla and the stl file is on the osf cite under version 3.
All designs starting form old to new
I am also setting up the intergration of everything, getting it ready for testing that will happen in the near future. In this focusing of connecting all the wires and having wire management.
Extruder System
Next week I am finishing up the project with testing and writing the final report for this semester.
My Goals for the semester
- Attach our extruder assembly from last year to the extruder of the Luzbot Taz 6 (done)
- Print out of the current redesign of the sensor attachment (done)
- Design a way for a circuit board could be attached to the system(done)
- Test the sensor system to see if there are any issues(done)
- Find the wiring documentation for the 3d printer (done)
- Create a better design of the circuit board attachment (done)
- Implement the circuit board with the system (done)
Restruder 4/12/2024 – 4/19/2024 Updates
This week I mainly worked on the report and inital testings for the whole systems. In the case of the testing the motor was not moving and there were issues to be able to be found. The cicuit board ended up needed to be redesign to a more compact form. I was responable for redesign the circuit board holder for the 4th time.
new design
Our new circuit board is 3cm by 7cm and will have to be raised sicne there are now a lot of wires that can not be crushed. Currently this is being printed using 1.75mm pla on the Ender 3. The stl is on our osf page. I also been working heavily on the final report for the semseter.
Concerns
I am a little concerned that our testing will have significant problems and will not have a lot of time to work on it. I am also worried that I will burnout at the last minute and have to focus on my upcoming exams.
Husky Clean Updates 8/26/2024 – 9/13/2024
Hello, this semester I am starting my final capstone projoect Husky Clean for the next two semester. You might be wondering what is Husky Clean. Husky Clean is a autonomous heavy duty vacumm system that can handle messes in a lab/shop setting. Husky clean is planning to be able to clean general messes and objects like metal shavings and wood dust. However Husky Clean is not cleaning up hazardous material since that require special cleaning instructions.
Design idea sketch
In which we plan by adapting a shop vacuum and incorporate other functions to the vacuum. There are a couple of sub systems to our design. Which are drive train, cleaning fluid dispenser, scrubbing brushes mechanism, and vision. Our goal is have the robot be at functional level so that we can start adding complex code. I will be mostly working on the scrubbing brushes mechanism subsystem and the code that follows the robot.
Scrubbing Brushes Mechanism Subsystem
For the scrub brush subsystem we had a couple of idea on which brush we wanted to use for our subsystem. The three options we were debating is a circular brush, a coil brush, and a helical brush. In which we made a pugh chart comparing the three options to if we had no brush system as a base.
In which in our pugh chart the circular brushes were the most beneficial for our project. It would make sense since most of the industry follows using circular brushes. Now we are deciding on what size of brush we would want to use. We are currently planning on using two brushes nearby the robot center of mass.
Next Week Plans
- Decide size and order brushes
- Order a Raspberry pi 4b for the computer vision system
- Review the code that was used on a simular robot (GrowBot) from a previous semster
9/13/24-9/20/24 Huksy Clean Updates
This week I got the srub brush oreder and the raspberry pi 4b order and patiently waiting for them. I also went through the growbot old code to get a sense on what it does. I saw that is it using a remote and a radio transceiver to be able to control the robot through a remote. However I do not know much about how to interface with the code. Fortanly there is a lot of documentation that I cna read so I am currently looking through that. It is kinda hard to be designing the placement of the motors and brushes when I do not know what the frame of the robot looks like. I am hopeful to start next week on that task.
Next Week Plans
- Start designing for brush motors
- Understand code
- Come up with a basic code stucture for the ardunio
9/20/24 – 9/27/24 Husky Clean Updates
This week I worked on a two major thigns. First the srcub brush has a protype design and will be planning to print it out in the next couple of days. Second I have code draft for basic movements of the robot with a fix speed. This is done through a FS-I6X RC receiver & FS-I6X 6-ch Controller. Which is only going to be temporary since we are planning to use a raspberry pi for our controller.
Scrub Brush Design
what we have protyped is a T slotted abr running arcross the center of mass of the robot in which we attach our srub brush through an attachment. The attachment is ment to be slide into the T slotted bar for stability. To connect the motor and scrub brush together we designed a chuck. For the motors we are using a 12 DC volt motor which the part number is 634JSX505-31ZY. The concern that I have with this design is that I am not sure if the design can hold all the weight. We could not come up with a design with nice and pretty motor placements. So I hope for the best when this comes to testing.
Code
For the code I used a template to provide a simple code using a FS-I6X RC receiver & FS-I6X 6-ch Controller. This is used because we will need it for testing our design and electronics. We will be switching to either a python or C system using a Raspberry Pi and Ardunio. In want the final code to function simularly to the turtlebot robot. In which I want to use the same controllers however modify the structure for my own robot.
Code I wrote
/*
Last updated: 9/26/24
Husky Clean basic movement code
Made to move forward, backward, left, and right at a fixed speed.
Use the floowing code below as a base for this basic function.
RC Remote Car
fsi6x-RC-car-spin.ino
Uses Flysky FS-I6X RC receiver & FS-I6X 6-ch Controller
Uses TB6612FNG H-Bridge Motor Controller
Drives two DC Motors
Two Drive Modes - Normal and Spin
Map channel 6 on controller to switch SWA for mode control
Right stick controls direction in Normal mode (CH1 & CH2)
VRA controls speed and direction in Spin mode (CH5)
Left stick is acceleration in both modes (CH3)
Channel functions by Ricardo Paiva - https://gist.github.com/werneckpaiva/
DroneBot Workshop 2021
https://dronebotworkshop.com
*/
// Include iBus Library
#include <IBusBM.h>
// Create iBus Object
IBusBM ibus;
// Channel Values
int rcCH1 = 0; // Left - Right
int rcCH2 = 0; // Forward - Reverse
// Motor A Control Connections
#define pwmA 3
#define in1A 5
#define in2A 4
// Motor B Control Connections
#define pwmB 9
#define in1B 7
#define in2B 8
// Motor Speed Values - Start at zero
int MotorSpeedA = 0;
int MotorSpeedB = 0;
// Motor Direction Values - 0 = backward, 1 = forward
int MotorDirA = 1;
int MotorDirB = 1;
// Control Motor A
void mControlA(int mspeed, int mdir) {
// Determine direction
if (mdir == 0) {
// Motor backward
digitalWrite(in1A, LOW);
digitalWrite(in2A, HIGH);
} else {
// Motor forward
digitalWrite(in1A, HIGH);
digitalWrite(in2A, LOW);
}
// Control motor
analogWrite(pwmA, mspeed);
}
// Control Motor B
void mControlB(int mspeed, int mdir) {
// Determine direction
if (mdir == 0) {
// Motor backward
digitalWrite(in1B, LOW);
digitalWrite(in2B, HIGH);
} else {
// Motor forward
digitalWrite(in1B, HIGH);
digitalWrite(in2B, LOW);
}
// Control motor
analogWrite(pwmB, mspeed);
}
// Read the number of a given channel and convert to the range provided.
// If the channel is off, return the default value
int readChannel(byte channelInput, int minLimit, int maxLimit, int defaultValue) {
uint16_t ch = ibus.readChannel(channelInput);
if (ch < 100) return defaultValue;
return map(ch, 1000, 2000, minLimit, maxLimit);
}
void setup()
{
// Start serial monitor for debugging
Serial.begin(115200);
// Attach iBus object to serial port
ibus.begin(Serial1);
// Set all the motor control pins to outputs
pinMode(pwmA, OUTPUT);
pinMode(pwmB, OUTPUT);
pinMode(in1A, OUTPUT);
pinMode(in2A, OUTPUT);
pinMode(in1B, OUTPUT);
pinMode(in2B, OUTPUT);
delay(2000);
}
void loop() {
// Get RC channel values
rcCH1 = readChannel(0, -100, 100, 0);
rcCH2 = readChannel(1, -100, 100, 0);
// Print values to serial monitor for debugging
Serial.print("Ch1 = ");
Serial.print(rcCH1);
Serial.print(" Ch2 = ");
Serial.print(rcCH2);
// Forward right joystick is up
if (rcCH2 >= 10){
MotorDirA = 0;
MotorDirB = 0;
} //Backwards right joystick is down
else if(rcCH2 <= 10){
MotorDirA = 1;
MotorDirB = 1;
}// Right right joystick is to the right
else if(rcCH1 >= 10){
MotorDirA = 0;
MotorDirB = 1;
}
else if(rcCH1 <= 10){
MotorDirA = 1;
MotorDirB = 0;
}
MotorSpeedA = 20;
MotorSpeedB = 20;
// Ensure that speeds are between 0 and 255
MotorSpeedA = constrain(MotorSpeedA, 0, 255);
MotorSpeedB = constrain(MotorSpeedB, 0, 255);
//Drive Motors
mControlA(MotorSpeedA, MotorDirA);
mControlB(MotorSpeedB, MotorDirB);
// Print speed values to serial monitor for debugging
Serial.print("Motor A Speed = ");
Serial.print(MotorSpeedA);
Serial.print(" | Motor B Speed = ");
Serial.println(MotorSpeedB);
// Slight delay
delay(50);
}
Next week goals
- Print out scrub brush attachments
- Prepare and go to our Critical Desing Review
- Debug code (if nesscary)
- Start preparing for the raspberry pi
9/27/24 – 10/7/24 Husky Clean Updates
This week I focused on our critical desing review. Which is a big presentation about our major updates throughout the semester. I also went through and started testing and redesigning the motor bracket for the scrub brushes.
Bracket attached to the motor
I am also trying to get an updated timeline since there are issues showing up with the whole porject. The vacumm size was smaller than we expected. So our frame will have to be redesigned.
9/7/24 – 10/11/24 Husky Clean Updates
A lot of things happen this week. Frist things I continue my work on testing the scrub brush design. I printed out both of the chucks that are going to be attached to the motor and the scrub brush. A couple of issues popped up. First the frame of the machine does not have enough vertical room for the scrub brushes. Which is a huge concern that i have. Second the chucks of this dsign are way to fragile and snap while testing them. Which we were plannign to make the walls of the design thicker.
Scrub brush design
I also got a chance to update and test the drivetrain code fo rthe robot to move. There was some wiring issues that was made while connecting to the motor controller. After that the code works as intended. There might be a chance that I have the direction backwards. Whichb is something that will come up with later testing.
/*
Last updated: 10/10/24
Husky Clean basic movement code
Made to move forward, backward, left, and right at a fixed speed.
Use the floowing code below as a base for this basic function.
RC Remote Car
fsi6x-RC-car-spin.ino
Uses Flysky FS-I6X RC receiver & FS-I6X 6-ch Controller
Uses TB6612FNG H-Bridge Motor Controller
Drives two DC Motors
Two Drive Modes - Normal and Spin
Map channel 6 on controller to switch SWA for mode control
Right stick controls direction in Normal mode (CH1 & CH2)
VRA controls speed and direction in Spin mode (CH5)
Left stick is acceleration in both modes (CH3)
Channel functions by Ricardo Paiva - https://gist.github.com/werneckpaiva/
DroneBot Workshop 2021
https://dronebotworkshop.com
*/
// Include iBus Library
#include <IBusBM.h>
// Create iBus Object
IBusBM ibus;
// Channel Values
int rcCH1 = 0; // Left - Right (right)
int rcCH2 = 0; // Forward - Reverse (right)
//int rcCH5 = 0; // left dial
//int rcCH6 = 0; // right dial
// Scrub brush motor 1
//#define pwmS1
// Scrub brush motor 2
//#define pwmS2
// Fluid sytem drip
//#define pwmf
// Motor A Control Connections
#define pwmA 4
#define DirA 5
// Motor B Control Connections
#define pwmB 2
#define DirB 3
// Motor Speed Values - Start at zero
int MotorSpeedA = 0;
int MotorSpeedB = 0;
//int MotorScrub = 0;
// Motor Direction Values - 0 = backward, 1 = forward
int MotorDirA = 1;
int MotorDirB = 1;
// Control Motor A
void mControlA(int mspeed, int mdir) {
// Determine direction
if (mdir == 0) {
// Motor backward
digitalWrite(DirA, LOW);
} else {
// Motor forward
digitalWrite(DirA, HIGH);
}
// Control motor
analogWrite(pwmA, mspeed);
}
// Control Motor B
void mControlB(int mspeed, int mdir) {
// Determine direction
if (mdir == 0) {
// Motor backward
digitalWrite(DirB, LOW);
} else {
// Motor forward
digitalWrite(DirB, HIGH);
}
// Control motor
analogWrite(pwmB, mspeed);
}
//void scrubcontrols(int mspeed){
// analogWrite(pwmS1, mspeed)
// analogWrite(pwmS2, mspeed)
//}
//void fluidControl(int mspeed){
// analogWrite(pwmf, mspeed)
//}
// Read the number of a given channel and convert to the range provided.
// If the channel is off, return the default value
int readChannel(byte channelInput, int minLimit, int maxLimit, int defaultValue) {
uint16_t ch = ibus.readChannel(channelInput);
if (ch < 100) return defaultValue;
return map(ch, 1000, 2000, minLimit, maxLimit);
}
void setup()
{
// Start serial monitor for debugging
Serial.begin(115200);
// Attach iBus object to serial port
ibus.begin(Serial1);
// Set all the motor control pins to outputs
pinMode(pwmA, OUTPUT);
pinMode(pwmB, OUTPUT);
pinMode(DirA, OUTPUT);
pinMode(DirB, OUTPUT);
delay(2000);
}
void loop() {
// Get RC channel values
rcCH1 = readChannel(0, -100, 100, 0);
rcCH2 = readChannel(1, -100, 100, 0);
// Print values to serial monitor for debugging
Serial.print("Ch1 = ");
Serial.print(rcCH1);
Serial.print(" Ch2 = ");
Serial.print(rcCH2);
// Forward right joystick is up
if (rcCH2 >= 20 && rcCH2 > 0){
MotorDirA = 0;
MotorDirB = 0;
MotorSpeedA = 100;
MotorSpeedB = 100;
} //Backwards right joystick is down
else if(rcCH2 <= 20 && rcCH2 < 0){
MotorDirA = 1;
MotorDirB = 1;
MotorSpeedA = 100;
MotorSpeedB = 100;
}// Right right joystick is to the right
else if(rcCH1 >= 20 && rcCH1 > 0){
MotorDirA = 0;
MotorDirB = 1;
MotorSpeedA = 100;
MotorSpeedB = 100;
}
else if(rcCH1 <= 20 && rcCH1 < 0){
MotorDirA = 1;
MotorDirB = 0;
MotorSpeedA = 100;
MotorSpeedB = 100;
}
else{
MotorSpeedA = 0;
MotorSpeedB = 0;
}
// looking for any dial movement for scrub brushes
// if (rcCH5 > 20){
// MotorScrub = 20;
//}
// looking for any dial movement for fuild system
// if (rcCH6 > 20){
// MotorFluid = 20;
//}
// Ensure that speeds are between 0 and 255
MotorSpeedA = constrain(MotorSpeedA, 0, 255);
MotorSpeedB = constrain(MotorSpeedB, 0, 255);
//MotorScrub = constrain(MotorScrub, 0, 255);
//MotorFluid = constrain(MotorFluid, 0, 255);
//Drive Motors
mControlA(MotorSpeedA, MotorDirA);
mControlB(MotorSpeedB, MotorDirB);
//scrubcontrols(MotorScrub);
//fluidControl(MotorFluid);
// Print speed values to serial monitor for debugging
Serial.print("Motor A Speed = ");
Serial.print(MotorSpeedA);
Serial.print(" | Motor B Speed = ");
Serial.println(MotorSpeedB);
// Slight delay
delay(50);
}
Video of the motor moving using a RC controller
Next Week Plans
- Update scrub brush design
- Update code to improve more features
- Start working with the raspberry pi
10/11/24 – 10/25/24 Husky Clean Updates
A lot has been going these past couple of weeks. First I went through some testing of the robot and there was some issue with the robot. It was detrimeined later on that the motor controller that was being used had some issues with it. We suspested that the motor controller broke during testing at some point. We have ordered a new motor controller and hoping that it fixes the problem. I also redesigned the motor bracket to be able to fit on to the updated frame. Which is a little bit smaller than the oringal one.
New Motor Bracket (Side View)
New Motor Bracket (Isometric View)
This bracket hold the same design as before hand other than the part that attaches to the frame. Plannign on printing them this week and be able to test them.
Raspberry pi
There are a couple of things that are being started. First, I wanted to use a serial commucation system to communicate between the arduino and the raspberry pi. So I am plannign on using this tutorial as a base for the final code for the arduino. In which the ardunio is being planned to being used for the controls for the robot. I was planning on using a PID controller to be able to handle some of the fine tunning of the robot movement. In which i want to set up to have both the raspberry pi and the arduino to commucate between each other.
Next Week Plans
- Finished a serial commucation system
- Test the robot yet again
- A first draft of the final code for the arduino
- Figuring out lidar wirring
10/25/24 – 11/1/24 Husky Clean Updates
This week a lot of things are happening for the code side of things. I was able to have most of the first draft of my final code set up for the arduino. Execpt for a PID or PI controller for the drive motor. I was also able to get an arrya of data to send to the Arduino form the raspberry pi using UART commucation.
Final draft 1 of Arduinio code
// This is the final code between the Ardunio and the Raspberry pi
// The purpose of this is getting the motor speeds and controls commands from the Raspberry Pi
// Then this code will take these values run it through a PID controller and passes that information back to the Raspberry Pi
//*************************************************************************************
// Pin Definitions
//*************************************************************************************
//Fluid system
#define DirF 8
// Motor A
#define pwmA 4
#define DirA 5
// Motor B
#define pwmB 2
#define DirB 3
// Scrub Brush Motor 1
#define pwmS1 6
// Scrub Brush Motor 2
#define pwmS2 7
//***********************************************************************************************
// Defining initail Motor Speed and Direction
//*******************************************************************************************************
int MotorSpeedA = 0;
int MotorSpeedB = 0;
int MotorScrub = 0;
// Motor Direction values 0 = backwards, and 1 = forward
int MotorDirA = 1;
int MotorDirB = 1;
int FluidDir = 1;
// Seperate functions for differnt functions controls
void DriveMotors( int MotorSpeedA, int MotorDirA, int MotorSpeedB, int MotorDirB){
// set a PID controller to the motor speeds
}
void SrubMotors( int MotorScrub){
// Write speed to the scrub brushes
analogWrite(pwmS1, MotorScrub);
analogWrite(pwmS2, MotorScrub);
}
void FluidControl(int mdir){
// setting a bit to 1 or 0 based on if it is on
if(mdir ==1){
digitalWrite(DirF, HIGH);
} else {
digitalWrite(DirF, LOW);
}
}
void setup() {
// put your setup code here, to run once:
// Set the serial
Serial.begin(115200);
// Make sure that the board is connected to the arduino
while(!Serial){
}
Serial.println("Serial is working");
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() > 0){
String Motor_Speed = Serial.readStringUntil('\n');
int Speed[10]; // size of data numbers
// the data will go by (motorA speed, motorA direction, motorB speed, motorB direction, srub brush 1, fluid dir)
int index = 0;
int lastComma = -1;
for (int i = 0; i < Motor_Speed.length(); i++){
if(Motor_Speed[i] == ',' || i == Motor_Speed.length() -1){
// End of number string
String numStr = Motor_Speed.substring(lastComma + 1, i + (i == Motor_Speed.length() - 1 ? 1 : 0));
Speed[index++] = numStr.toInt();
lastComma = i;
}
}
Serial.println("Received Array");
for(int i = 0; i < index; i++){
Serial.println(Speed[i]);
}
DriveMotors(Speed[0], Speed[1], Speed[2], Speed[3]);
SrubMotors(Speed[4]);
FluidControl(Speed[5]);
}
}
Raspberry pi script for UART commucation
import serial
import time
# Initialize serial communication
ser = serial.Serial('/dev/ttyACM0', 9600, timeout=1)
ser.reset_input_buffer()
def send_array(numbers):
# Convert the list to a comma-separated string
data_str = ','.join(map(str, numbers))
# Send the encoded byte data over serial
ser.write(data_str.encode('utf-8'))
ser.write(b'\n') # Newline to signal end of data
if __name__ == '__main__':
# Example array to send
array_to_send = [10, 20, 30, 40, 50]
while True:
send_array(array_to_send)
time.sleep(1) # Wait 1 second before sending again
Next Week Plans
- Start skeleton code for the raspberry pi
- Assembled scrub brushes to frame
- Be able to test our code for no automous features