Hi everyone! Below I show you summaries of my Cobot in its three versions:
A video summarizing the journey of this project in the first version. Main goal, Features, Solutions, Content, Hardware and software prerequisites,
Collaborative Robot Arm with Artificial Intelligence, and Used as Assistant in: 1) Voice Command System & 2) Sorting Objects System
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Hi everyone! Below I show you summaries of my Cobot in its three versions:
A video summarizing the journey of this project in the first version. Main goal, Features, Solutions, Content, Hardware and software prerequisites,
guillengap_ver1.zipFirst code version of the robot armx-zip-compressed - 2.66 kB - 06/27/2021 at 23:09 |
|
|
circuit_diagram.zipCircuit diagram of the robot arm, version 1x-zip-compressed - 295.79 kB - 06/28/2021 at 01:11 |
|
|
stl_files.zipAll the STL files necessary to create this projectx-zip-compressed - 11.19 kB - 06/27/2021 at 23:13 |
|
|
datasheets.zipAll the datashhets files used: 1) MATRIX_Creator.pdf, and 2) MG995_Tower-Pro.pdfx-zip-compressed - 12.30 MB - 06/28/2021 at 00:48 |
|
Before we start to do tests, we need to do next actions:
On your Raspberry Pi type node assistant.js
On your computer's terminal type sam status and sam watch
Congrats! now you can test your robotic arm
The prototype worked very well, and is very useful to develop more complex actions with the robotic arm. however, I also had some difficulties such as:
It's easy to say that in the future this prototype can serve as a model in every home, and may be, we will have a robotic arm at our tables to help us in multiple tasks.
I have designed a 10 x 10 cm panel for three functions:
Below you can see a picture and download the STL file on my GitHub repository here: https://github.com/guillengap/guillengap-robot-arm
Below you can see the electrical diagram with the connections of this project, it's recommended to do it patiently so as not to make mistakes because there are many cables to be connected.
I suggest you not wire the servo 5, since in the tests I carried out the system collapsed when I connected the six servos. Then I decided to disconnect the servomotor that was less used.
This step will go show you how to setup a MATRIX Lite project with Snips.
First, MQTT must be installed and used to listen in on events from Snips.
npm install mqtt --save
assistant.js will be used to listen and respond to events from your Snips assistant. This file combines all the code from everloop.js
& relay.js
to control the everloop and relay switch through voice.
///////////////////////////////////
//AUTHOR: GUILLERMO PEREZ GUILLEN//
///////////////////////////////////
/////////////
//VARIABLES//
/////////////
var mqtt = require('mqtt');
var client = mqtt.connect('mqtt://localhost', { port: 1883 });
var relay = require('./relay.js');
var everloop = require('./everloop.js');
var snipsUserName = 'guillengap';
var wakeword = 'hermes/hotword/default/detected';
var sessionEnd = 'hermes/dialogueManager/sessionEnded';
var lightState = 'hermes/intent/'+snipsUserName+':roboticArmState';
//////////////
//ON CONNECT//
//////////////
client.on('connect', function() {
console.log('Connected to Snips MQTT server\n');
client.subscribe('hermes/hotword/default/detected');
client.subscribe('hermes/dialogueManager/sessionEnded');
client.subscribe(lightState);
});
//////////////
//ON MESSAGE//
//////////////
client.on('message', function(topic,message) {
var message = JSON.parse(message);
switch(topic) {
// * On Wakeword
case wakeword:
everloop.startWaiting();
console.log('Wakeword Detected');
break;
// * Robotic Arm Change
case lightState:
// Turn robotic arm Here/There
try{
if (message.slots[0].rawValue === 'here'){
relay.roboticarmHere();
everloop.stopWaiting();
console.log('Robotic Arm Here');
}
else if(message.slots[0].rawValue === 'there'){
relay.roboticarmThere();
everloop.stopWaiting();
console.log('Robotic Arm There');
}
}
// Expect error if `here` or `there` is not heard
catch(e){
console.log('Did not receive an Here/There state')
}
break;
// * On Conversation End
case sessionEnd:
everloop.stopWaiting();
console.log('Session Ended\n');
break;
}
});
everloop.js incorporates the code required to control the LEDs on the MATRIX Creator.
///////////////////////////////////
//AUTHOR: GUILLERMO PEREZ GUILLEN//
///////////////////////////////////
/////////////
//VARIABLES//
/////////////
const matrix = require('@matrix-io/matrix-lite');
var matrix_device_leds = 0;// Holds amount of LEDs on MATRIX device
var methods = {};// Declaration of method controls at the end
var waitingToggle = false;
var counter = 0;
setInterval(function(){
// Turns off all LEDs
if (waitingToggle == false) {
// Set individual LED value
matrix.led.set({});
}
// Creates pulsing LED effect
else if (waitingToggle == true) {
// Set individual LED value
matrix.led.set({
b: (Math.round((Math.sin(counter) + 1) * 100) + 10),// Math used to make pulsing effect
});
};
counter = counter + 0.2;
// Store the Everloop image in MATRIX configuration
},50);
///////////////////
//WAITING METHODS//
///////////////////
methods.startWaiting = function() {
waitingToggle = true;
};
methods.stopWaiting = function() {
waitingToggle = false;
};
module.exports = methods;// Export methods in order to make them avaialble to other files
relay.js includes the code required to turn the robotic arm here and there. This relay will control power to the robotic arm.
///////////////////////////////////
//AUTHOR: GUILLERMO PEREZ GUILLEN//
///////////////////////////////////
/////////////
//VARIABLES//
/////////////
const matrix = require('@matrix-io/matrix-lite');
var methods = {};// Declaration of method controls at the end
matrix.gpio.setFunction(0, 'PWM');
matrix.gpio.setFunction(1, 'PWM');
matrix.gpio.setFunction(2, 'PWM');
matrix.gpio.setFunction(3, 'PWM');
matrix.gpio.setFunction(4, 'PWM');
matrix.gpio.setFunction(5, 'PWM');
matrix.gpio.setMode(0,'output');
matrix.gpio.setMode(1,'output');
matrix.gpio.setMode(2,'output');
matrix.gpio.setMode(3,'output');
matrix.gpio.setMode(...
Read more »
Intents are what Snips uses to handle user requests. For this Assistant, we'll start by creating an intent for turning Here/There the MATRIX Creator's App.
Create a new intent roboticArmState for your RoboticArm app
Once you've defined your intent, you need to extract whether the user wants their robotic arm here or there. This is where slots come in.
Create a new slot called power
and a custom slot type with the same name.
Make sure your power
slot type has here & there as values.
Create example sentences containing the words here and there. Highlight these words in your example sentences to assign them to your recently created power
slot.
Be sure to save!
Sign into your Snips.ai account.
Create an assistant called Robotic Arm
Create an App named RoboticArm
Before getting started, you can check with more details what hardware I used:
You can check what required software on my personal computer I used:
Once everything is well installed on your Raspberry Pi board, You can check the versions of: npm, node and nodejs.
In my case, I had two serious problems with the configuration of my hardware and these are the solutions:
FIRST SOLUTION: to activate the pcm.speaker, I had to add a rate of 16000 in the assound.conf file.
pcm.speaker { type plug slave { pcm "hw:0,0" rate 16000 } }
SECOND SOLUTION: My Raspberry Pi board has better audio with the "portaudio" board, so I had to activate it in the snips.toml file
[snips-audio-server] # frame = 256 # bind = "default@mqtt" mike = "MATRIXIO-SOUND: - (hw:2,0)" # disable_playback = false # disable_capture = false portaudio_playback="default"
Follow below steps to repeat the experience of this project
NOTE: All these steps are detailed in the Logs of this project
Create an account to leave a comment. Already have an account? Log In.
This project participates in the "Supplyframe DesignLab: 2021 Hackaday Prize" contest, in the category of "Challenge 4: Redefine Robots" and the updates will be published before the deadline.
Become a member to follow this project and never miss any updates
This project also participates in the "Supplyframe DesignLab: 2021 Hackaday Prize" contest, in the category of "Challenge 2: Refresh Work-From-Home Life".