16.08.2020 – ACT Mk-1 delivers the first filter coffee!
ACT Mk-1 finally delivers its first cup of filter coffee! And biscuits, yes, but when there’s filter coffee, who cares about the biscuits anyway?
Music: ACT 1 Concludes – Raunak Hede (piano/keyboard instrumental)
And here are the codes! As always, feel free to remix, reuse and distribute for further improvement:
ARDUINO NANO R3:
// Originally written by Raunak Hede for ACT Mk-1
// Version Control: Mk-1-v1.7
// Adapted from Mk-1-v1.4
#define lpwm 3
#define ldir 4
#define rpwm 5
#define rdir 6
#define f analogWrite(lpwm, 250);digitalWrite(ldir, HIGH);analogWrite(rpwm, 250);digitalWrite(rdir, HIGH);//forward
#define b analogWrite(lpwm, 250);digitalWrite(ldir, LOW);analogWrite(rpwm, 250);digitalWrite(rdir, LOW);//backward
#define l analogWrite(lpwm, 250);digitalWrite(ldir, LOW);analogWrite(rpwm, 250);digitalWrite(rdir, HIGH);//spot left
#define r analogWrite(lpwm, 250);digitalWrite(ldir, HIGH);analogWrite(rpwm, 250);digitalWrite(rdir, LOW);//spot right
#define wl analogWrite(lpwm, 0);digitalWrite(ldir, LOW);analogWrite(rpwm, 250);digitalWrite(rdir, HIGH);//wide left
#define wr analogWrite(lpwm, 250);digitalWrite(ldir, HIGH);analogWrite(rpwm, 0);digitalWrite(rdir, LOW);//wide right
#define s analogWrite(lpwm, 0);digitalWrite(ldir, LOW);analogWrite(rpwm, 0);digitalWrite(rdir, LOW);// stop
#define d delay(2500);// full-tile forward
#define hd delay(1300);// half-tile forward
#define wtd delay(2200);// 90 wide turn
#define pwtd delay(1550);// 45 wide turn
#define std delay(1600);// 90 spot turn
#define ptd delay(1000);// 45 spot turn
int state;
char movs[50];
//-----------------------------------------------------------------------------------------SETUP
void setup()
{
pinMode(13,OUTPUT);digitalWrite(13, HIGH);//show setup has begun
Serial.begin(38400);// 38400 for HC-05 default speed in DAT-COM mode
//MOTOR SETTINGS
pinMode(lpwm,OUTPUT);digitalWrite(lpwm, LOW);
pinMode(ldir,OUTPUT);digitalWrite(ldir, LOW);
pinMode(rpwm,OUTPUT);digitalWrite(rpwm, LOW);
pinMode(rdir,OUTPUT);digitalWrite(rdir, LOW);
delay(1000);
digitalWrite(13, LOW);//show setup has ended
}
//-----------------------------------------------------------------------------------------MAIN
void loop()
{
//MOTION CONTROL ****************************
state=Serial.read();
// ©www.raunakhede.com
if(state=='f' || state=='F' || state=='w')
{
f;digitalWrite(13, HIGH);
d;
}
if(state=='h' || state=='H')
{
f;digitalWrite(13, HIGH);
hd;
}
if(state=='b' || state=='B' || state=='s')
{
b;digitalWrite(13, HIGH);
d;
}
if(state=='l' || state=='L' || state=='a')
{
l;digitalWrite(13, HIGH);
std;
}
if(state=='r' || state=='R' || state=='d')
{
r;digitalWrite(13, HIGH);
std;
}
if(state=='y' || state=='Y')
{
Serial.readBytesUntil('u',movs,49);
for(int i=0; i<50; i++)
{
mov(movs[i]);
}
for(int i=0; i<50; i++)
{
movs[i]=NULL;
}
}
else
{
s;digitalWrite(13, LOW);
}
}
//-----------------------------------------------------------------------------------------MOTION FUNCTIONS
void mov(char movcom)
{
//0 DEGREE
if (movcom == 'w' || movcom == 'f')//forward
{ f;digitalWrite(13, HIGH);d; }
if (movcom == 'h')//half-tile forward
{ f;digitalWrite(13, HIGH);hd; }
else if (movcom == 's' || movcom == 'b')//backward
{ b;digitalWrite(13, HIGH);d; }
//90 DEGREE
else if (movcom == 'a' || movcom == 'l')//90 spot left
{ l;digitalWrite(13, HIGH);std; }
else if (movcom == 'd' || movcom == 'r')//90 spot right
{ r;digitalWrite(13, HIGH);std; }
else if (movcom == 'q')//90 wide left
{ wl;digitalWrite(13, HIGH);wtd; }
else if (movcom == 'e')// 90 wide right
{ wr;digitalWrite(13, HIGH);wtd; }
// Extra functions included for further develpoment of ACT Mk-2
//45 DEGREE
else if (movcom == 'z')//45 spot left
{ l;digitalWrite(13, HIGH);ptd; }
else if (movcom == 'c')// 45 spot right
{ r;digitalWrite(13, HIGH);ptd; }
else if (movcom == 'o')//45 wide left
{ wl;digitalWrite(13, HIGH);pwtd; }
else if (movcom == 'p')// 45 wide right
{ wr;digitalWrite(13, HIGH);pwtd; }
//180 DEGREE
else if (movcom == 't')// 180 about turn
{ r;digitalWrite(13, HIGH);std;std; }
//STOP
else if(movcom == '0')// stop
{ s;digitalWrite(13, LOW); }
else // stop
{ s;digitalWrite(13, LOW); }
}
ANDROID APP:
The android app was developed in MIT App Inventor 2, so instead of taking screenshots (which have proven to be extremely irritating in the past), here’s the compressed APK file for you to download, and use directly!
Subscribe for updates when the next project begins, or sign up to the newsletter: http://raunakhede.com/newsletter or follow any of the other social media accounts mentioned on the about page.
07.07.2020 – Watch the live premiere of Making Mark-1 at 12:30 pm on Wednesday, 8th July 2020
Two months after the first trailer was released for ACT Mark 1, here’s a look at the build process and what goes into making a, point-to-point delivery robot.
Music: Making the Mark 1 – Raunak Hede (piano/keyboard instrumental)
16.04.2020 – A little lockdown project begins…
ACT Mk-1 is the first version of the ACT series of robots, currently under development for indoor service. This series will focus on developing a simplified learning system for semi-autonomous robots to be trained to move along certain paths, which may be recalled from a database at any time afterwards.