NightRider – update e

The programming.

To capture the RC data I am using a simple Arduino function called pulseIn(). You can see all the reference on the Arduino site. I discovered this function while googling “radio control joystick to arduino” and found this great example from Sparkfun.

All the code is at github.

There is a folder called “RC_reader” with a program that captures all the 6 RC channels and prints RAW values to the console. This code it is just for debug purposes and it is not being used for anything else:

int ch1_pin = 6; // right_horizontal
int ch3_pin = 5; // right_vertical

int ch2_pin = 4; // left_vertical
int ch4_pin = 3; // left_horizontal

int ch5_pin = 7; // c_stick
int ch6_pin = 8; // right_knob

int ch1_val; 
int ch2_val;
int ch3_val; 
int ch4_val;
int ch5_val;
int ch6_val;

void setup() {
  Serial.begin(9600); 
  
  // RC pins
  pinMode(ch1_pin, INPUT);
  pinMode(ch2_pin, INPUT);
  pinMode(ch3_pin, INPUT);
  pinMode(ch4_pin, INPUT);
  pinMode(ch5_pin, INPUT);
  pinMode(ch6_pin, INPUT);

}

void loop() {

  ch1_val = pulseIn(ch1_pin, HIGH, 25000); // Read the pulse width of 
  ch2_val = pulseIn(ch2_pin, HIGH, 25000); // each channel
  ch3_val = pulseIn(ch3_pin, HIGH, 25000); // Read the pulse width of 
  ch4_val = pulseIn(ch4_pin, HIGH, 25000);
  ch5_val = pulseIn(ch5_pin, HIGH, 25000); // Read the pulse width of 
  ch6_val = pulseIn(ch6_pin, HIGH, 25000);
  
  Serial.print("ch1: ");
  Serial.print(ch1_val);
  Serial.print("  ch2: ");
  Serial.print(ch2_val);
  Serial.print("  ch3: ");
  Serial.print(ch3_val);
  Serial.print("  ch4: ");
  Serial.print(ch4_val);
  Serial.print("  ch5: ");
  Serial.print(ch5_val);
  Serial.print("  ch6: ");
  Serial.println(ch6_val);
}

Using this code, I am reading raw data from the RC, now we just need to map this data to an usable format (0 – 1023) or (0 – 255) or (0 – 180).

//The actual code have three important functions:

// map RC RAW values to usable values
rc_mapper();

// map usable values to PWM values
motionMapper();

// controls motion with IR sensor and RC control
motionControl();

rc_mapper() – maps the joystick to a differential drive, and once again google made my day, otherwise I would still be struggling with this component. This function will give two values ‘left_vertical’ and ‘right_horizontal’ that will be used later to assign speed to the motors.

motionMapper() – all the source for this function can be seen here. I had to hack this bit of code to use with the Motoruino2, because the motors are on a Slave uC, I am using a function to set PWM for both motors.

motionControl() – just uses the values that comes from the motionMapper() and sends them through the function setPWM(leftMotor, rightMotor).
I am also using the right knob on the remote controller to set maximum velocity.

There is also a Sharp Distance Sensor that is being used to avoid collisions. On the motion control I am testing the distance, and if it is below 100 the bot runs normally, if it is beyond 100 and below 200 it moves slowly, and if it is beyond 200 stops. It can always move backward, there is still some tweak I want to do here, for instance, I want to be able to enable or disable this feature in runtime.

For the light I am using one of the sticks with 3 positions. Each position gives a value, each value will correspond to a light state.

Not to much to say about the servo control. I just need to verify the course limits to avoid collisions with other components on the bot.

All the code is available and commented on GitHub.

NightRider

Back to the Origins

Has been a long time since my last robot project.

Recently everything related to FPV, Drones, and Robots in general have been occupying my mind. I wanted to create an FPV Terrestrial Drone experience to anyone without the need of having (in portugal we say “kit the unhas”, “nails kit”) skills to pilot an aerial drone.

This little project reminds me those times when I have time and patience, to build small robotic creatures just because the fun of it, I guess I’m getting very nostalgic with this one.

BTTO

The Turnigy controller works just fine, and to get the sticks values I am using the very well documented code from Sparkfun Nick Poole
https://www.sparkfun.com/tutorials/348
.

BTTO

And this is the controller with the screen. There is still missing the video receiver and the battery.

BTTO

More to come ;]

MERV

Merv stands for Mini E-Revo, and this is my latest acquisition which turned out to become a hobby! Also it gives me what I eventually call “mechanics sensibility”, and due to the high level maintenance it requires, I am becoming a better maker and designer, as if I wouldn’t say so to myself!!
This car design and engineering is so top level and is like an open book, one can learn a lot just from looking it.

Of course the best part is when the car is able to be driven!

Audience Pong

This installation was commisioned by GCI, in order to boost the Projecto_80 event that took place at Escola Secundária Eça de Queiroz in Lisbon!

Audience Pong

Audience Pong is a community game inspired by emergence patterns. No instruction is given to the audience, only a red / blue card. The audience must figure out how to move the game pads in order to hit the ball. Once the audience understands how to play, visual feedback is disabled. Pure fun :D

Definitely the best moment of the day!

Audience Pong

Don’t forget to check Artica’s Blog for more cool news!!

Motoruino and Motors – Workshop @ ALTLAB

Last Wednesday Artica lectured a Motoruino workshop at AltLab.
Beside all the participants there were more than a hundred watching a live stream on Ustream, people from Viseu, Guimarães, Porto, Évora, Madrid and many more places I believe.

The central theme was Motoruino and motors such as Servos, DC motors, Steppers and Linear actuators.

In the end we had Farrusco working in Obstacle Avoidance and Following Light mode.



Video streaming by Ustream

ICU . 1.01

ICU has been sleeping for a while but was awaken suddenly because I was invited to an exhibition at Flausina, a new born association in Lisbon.

ICU v1.01

Complexity is always a welcome thing around here and the bot was presented with two more servo motors and all the software has been re-written. And because I needed to simulate its movements I coded an application in Processing in a way that I could test all the non-dangerous angles. Inverse kinematics is way to advanced for my taste and I think I can call this a “forward kinematics simulator”. This simulator gives also the possibility to generate individual sine waves for each motor, minimum and maximum range of motion, an interpolator for smoothness and frequency for speed.

ICU v1.01

Unfortunately I don’t have any decent video of photos of the Flausina exhibition, I leave you with a video of the bot in the office with the processing application.

TODO list:

– capability to save presets
– timeline with keyframes, play and stop buttons
– upgrade this servos to more powerful and digital servos
– upgrade all the structure to enhance weight distribution
– create a mask in silicon/rubber and give this bot a crazy new look
– everytime a face is detected it will say something on Twitter and upload the picture in an online gallery

Source code can be downloaded here.

All for now.. Roger, over and out.

ICU v1.01

Photo at Flausina.