Show Posts
Pages: 1 2 [3] 4 5 ... 11
31  Using Arduino / Sensors / Re: which IR receiver on: June 28, 2013, 12:14:36 am
Thanks for the reply.
So stating in the spec sheet the supported encodings makes little sense.
32  Using Arduino / Sensors / which IR receiver on: June 26, 2013, 02:58:59 am

I plan to build an IR beacon and receiver.
I struggle choosing the correct IR receiver.
Being located in Germany this shop has all I need: (tech sheets are in english)

It’s clear that I need to check for voltage, wavelength and opening angle.

What I struggle on is the transmitting code. I would like to use RC6 (as I have a remote for testing which uses RC6).
The cheap OS-Opto receivers only list RC5. Does this really mean RC5 is not possible with these sensors?

Or is it possible to pulse at 38khz without encoding? I think these sensors would filter the signal, right?

What else do I need to look at? The price range is really huge.

Thanks a lot.
33  Using Arduino / Sensors / Re: Ultrasonic beacon from HC-SR04s on: June 25, 2013, 05:09:07 am
That's what I am currently looking in.
Started with ripping of an old CD player for the IR sensor. Works great across the room with the original remote.
Currently trying to get it as directional as possible.

Then I'll try my own beacon.

34  Using Arduino / Sensors / Re: Ultrasonic beacon from HC-SR04s on: June 24, 2013, 08:16:58 am
Thanks a lot for the extensive explanation! I tried rapidly firing both SR04s. Works – but not too reliable.
Connecting them via radio might be required.
35  Using Arduino / Sensors / Re: Right (cheap) sender/receiver for beacon on: June 22, 2013, 03:40:38 pm
Thanks for the info. Does this mean I need to look for a 500 hz IR sensor?
I don't remeber to have seen one. Only The 38 khz modulated sensors.
36  Using Arduino / Sensors / Right (cheap) sender/receiver for beacon on: June 22, 2013, 05:29:26 am

I plan to build a becon finding robot. My questionis how to se up a good and cheap beacon and receiver pair.
One aproach would be to use my HC-sr004s.

I also have a pair of nrf24l01+. But with only a 1 bit "rssi" I think it is hardly usable. I would need to shield it extremely well from three sides. Not realistic .. I think.

Is there any other good and cheap method? IR is too short range I think. And too expensive if I want a wider beam.
I have a  roomba virtual lighthouse. But I have no idea on how to detect it.

All suggetsions are welcome.

37  Using Arduino / Sensors / Ultrasonic beacon from HC-SR04s on: June 22, 2013, 04:10:15 am

I would like to build a beacon which then can be detected by my robot.
As I have some HC-SR04s available I thought I could use one as sender and a few on my robot as receivers.

Is it possible to use such a ultrasonic module as receiver only?

Is the approach realistic at all?

38  Using Arduino / Programming Questions / Re: Synchonous acceleration with Accelstepper library on: June 19, 2013, 04:54:09 am
Thanks for yor reply.

I'll try to extract the relevant code. Turnaround time sould be no problem as most of the sketch (beside odometry and the FSM for driving) is disabled at the moment for testing. In addition I would expect both steppers to be too slow/fast/unsteady - but not to differ.

What I would expect is that while beeing in state Drive_GoTo - speed and currentPosition for both steppers are always the same. But there is a minimal offset until it reaches full speed. Not big, just a few steps.

It works like this:
1. via serial the coords of the new target are submitted.
2. GoTo(String Coords) changes the state of the FSM to Drive_Goto
3. the entry Function Drive_GoTo_Start_F() calculates the relevant steps to go to the target and sets the new target for the steppers. In theory they can differ between both wheels - but at the moment WHEEL_DIAMETERl and WHEEL_DIAMETERr are equal, so the amount of steps are the same. Also correcting the direction before and while driving straigt is disabled at the moment.
4. the FSM stays in state Drive_GoTo until all stepps are processed

#include <FiniteStateMachine.h>
#include <AccelStepper.h>

AccelStepper stepperL(1,StepLStep,StepLDir);
AccelStepper stepperR(1,StepRStep,StepRDir);

#define stepper_highspeed 500.0
#define stepper_lowspeed 200.0
#define stepper_acceleration 500.0

//dead reckoning
float MUL_COUNTl;
float MUL_COUNTr;
float MUL_COUNT_avg;
#define WHEEL_DIAMETERl 8.05
#define WHEEL_DIAMETERr 8.05
#define AXLE_LENGTH 14.1

State Drive_Idle = State(Drive_Idle_Entry_F , Drive_Idle_F, NULL);
State Drive_GoTo = State(GoTo_start_F, Drive_GoTo_F, NULL);
State Drive_Turn = State(Turn_start_F, Drive_Turn_F, NULL);
State Drive_Align = State(NULL, Drive_Align_F, NULL);
FSM FSM_Drive = FSM(Drive_Idle);

function to start driving staight:
void GoTo(String Coords){

relevant FSM code:
void GoTo_start_F(){

DriveMillis = millis();

TargetDist = DistToTarget (Y_pos, X_pos, Y_pos_target, X_pos_target);

void Drive_GoTo_F () {

unsigned long lastCalc = millis() - DriveMillis;

if (lastCalc >= 10) {

/********* check if target reached **********/
if(stepperL.distanceToGo() == 0 && stepperL.distanceToGo() == 0) {

DriveMillis = millis();

function for moving the stepper (in main loop):
void stepperUpdate(){;;

/* define structures */

struct position
float x;        /* meter */
float y;        /* meter */
float theta;    /* radian (counterclockwise from x-axis) */

/* global variables */

struct position current_position;

/* define functions */

void initialize_odometry()
current_position.x = 0.0;
current_position.y = 0.0;
current_position.theta = 0.0;

void odometer_thread()
if (millis() - odometersmillis >= 10) {

float dist_left;
float dist_right;
int left_ticks;
int right_ticks;
float expr1;
float cos_current;
float sin_current;
float right_minus_left;
float right_minus_left_AXL = 0;
float right_minus_left_AXL_theta;

lsamp = stepperL.currentPosition();
rsamp = stepperR.currentPosition();

left_ticks = lsamp - last_left;
right_ticks = rsamp - last_right;

last_left = lsamp;
last_right = rsamp;

dist_left = (float)left_ticks * MUL_COUNTl;
dist_right = (float)right_ticks * MUL_COUNTr;

cos_current = cos(current_position.theta);
sin_current = sin(current_position.theta);

if (dist_left == dist_right)
current_position.x += dist_left * cos_current;
current_position.y += dist_left * sin_current;

right_minus_left = dist_right - dist_left;

expr1 = AXLE_LENGTH * (dist_right + dist_left) / 2 / right_minus_left;

right_minus_left_AXL = right_minus_left / AXLE_LENGTH;
right_minus_left_AXL_theta = right_minus_left_AXL + current_position.theta;

current_position.x += expr1 * (sin(right_minus_left_AXL_theta) - sin_current);
current_position.y -= expr1 * (cos(right_minus_left_AXL_theta) - cos_current);

current_position.theta += right_minus_left_AXL;

if (current_position.theta > PI)
current_position.theta -= (2.0*PI);
if (current_position.theta < -PI)
current_position.theta += (2.0*PI);

theta = current_position.theta;
X_pos = current_position.x;
Y_pos = current_position.y;

odometersmillis = millis();


relevant code from setup:



full main loop:
void loop() {





//TIMER_FSM_DRIVE.update(); -- no longer needed?
39  Using Arduino / Programming Questions / Synchonous acceleration with Accelstepper library on: June 19, 2013, 12:15:13 am

For a robot I use the accelstepper library.
When accelerating two steppers I see a minimal difference between stepperL.speed() and stepperR.speed() during the acceleration phase – resulting in minimal difference in stepperL/R currentPosition(). As stated it’s minimal. But the dead reckoning calculation still results in an angle change which results in a correction by changing the MaxSpeed. I would like to prevent this.

I assume that this happens because the calculation of new speeds and next step time doesn’t take place at exactly the same time. So there most likely are differences in rounding calculation results. Anyhow – that’s only speculation.

Does someone have similar experiences and/or knows a way to do the acceleration exactly synchronous?

The code is too big to be posted as I use finite state machines. But the .run() functions for both steppers run directly after each other in the code.

40  Using Arduino / Motors, Mechanics, and Power / Re: Measuring the spec of stepper motors on: June 06, 2013, 08:45:48 am
I also have Steppers without specs. What I notice is that the stepper starts to produce noise even when not stepping if I allow higher current.
Is a stepper supposed to produce noise when actively holding position but not stepping? Or does this indicate too high current?

If the current is too high, the stepper suddenly starts stepping "back" a few steps even if it should turn "forward".

41  Using Arduino / Motors, Mechanics, and Power / Re: logic high == +5v ? on: May 31, 2013, 02:35:14 pm
Thanks. Just wanted to make sure I don't fry the driver.

42  Using Arduino / Motors, Mechanics, and Power / logic high == +5v ? on: May 31, 2013, 08:20:22 am

I bought a Pololo A4988 stepper driver to configute microstepping I need to bring some pins to logig high or logic low (which they are in by default).
I can simply connect them to +5V? Or is there a difference between bringing them to high via a digital PIN and connecdting them to +5V rail?

43  Using Arduino / Motors, Mechanics, and Power / Re: Stepper and driver combo ok? on: May 27, 2013, 12:24:54 am
OK, thanks a lot. Got the difference now. :-)
44  Using Arduino / Motors, Mechanics, and Power / Stepper and driver combo ok? on: May 25, 2013, 09:06:52 am

can I drive this Stepper:

with this driver:

I still have some of these drivers. So this would be great.

45  Using Arduino / Networking, Protocols, and Devices / Re: ADNS-2610 + Processing - pixel dump - working example? on: May 17, 2013, 08:50:48 am
Thanks a lot. I'll give it a try.

Pages: 1 2 [3] 4 5 ... 11