Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - reinier

Pages: [1]
1
Software development / Error on using existing Encoder code
« on: November 17, 2014, 03:13:36 PM »
Hi,

I would like to use this peace of code.
I get this error message in my program Mega_prototype

Mega_prototype.ino: In function 'void leftEncoder()':
Mega_prototype.ino:82:27: error: expected ')' before '::' token

The program don't like leftEncoder1::IsSet() and leftEncoder1::Number - 1

What have I forgot to include?


void leftEncoder() {
  static uint8_t old_AB = 0;
  old_AB <<= 2; // Remember previous state
  old_AB |= (leftEncoder1::IsSet() >> (leftEncoder1::Number - 1)) | (leftEncoder2::IsSet() >> leftEncoder2::Number);
  leftCounter += enc_states[ old_AB & 0x0F ];
}

Regards, Reinier

2
Hardware mods / Connect Motor controller to balanduino
« on: October 13, 2014, 12:02:34 PM »
Hi,

Can I connect pin PWM1A, PWM1B, M2A, M2B to another motor controller? What to do with SV4 and SV5 to disable the internal motor controller?

Regards, Reinier 

3
Hi,

I would like to use Visual Studio 2013 with Visual Micro for Arduino.
But when I press build I get this error messages.

I have downloaded Arduino IDE 1.5.8
When I compile with Arduino IDE all works fine.
 
Do anyone know what to do?


Compiling 'Balanduino' for 'Balanduino'
Balanduino.ino:In file included from
Balanduino.h:22:2: error: #error "Please update the Arduino IDE to version 1.5.6 at the following website: http:\\arduino.cc\en\Main\Software"
Balanduino.ino:In function 'void setup()'
Balanduino.ino:208: error: 'Wire' was not declared in this scope
Balanduino.ino:In function 'uint8_t i2cWrite(uint8_t, uint8_t*, uint8_t, bool)'
I2C.ino:26: error: 'Wire' was not declared in this scope
Balanduino.ino:In function 'uint8_t i2cRead(uint8_t, uint8_t*, uint8_t)'
I2C.ino:39: error: 'Wire' was not declared in this scope
Error compiling


Regard, Reinier

4
Electronics development / different encoders and motors
« on: September 23, 2014, 11:45:55 PM »
Hi,

I don't understand the code with defined the encoder resolutions

// Encoder values
#if defined(PIN_CHANGE_INTERRUPT_VECTOR_LEFT) && defined(PIN_CHANGE_INTERRUPT_VECTOR_RIGHT)
const uint16_t zoneA = 8000 * 2;
const uint16_t zoneB = 4000 * 2;
const uint16_t zoneC = 1000 * 2;
const double positionScaleA = 600 * 2; // One resolution is 1856 pulses per encoder
const double positionScaleB = 800 * 2;
const double positionScaleC = 1000 * 2;
const double positionScaleD = 500 * 2;
const double velocityScaleMove = 70 * 2;
const double velocityScaleStop = 60 * 2;
const double velocityScaleTurning = 70 * 2;
#else
const uint16_t zoneA = 8000;
const uint16_t zoneB = 4000;
const uint16_t zoneC = 1000;
const double positionScaleA = 600; // One resolution is 928 pulses per encoder
const double positionScaleB = 800;
const double positionScaleC = 1000;
const double positionScaleD = 500;
const double velocityScaleMove = 70;
const double velocityScaleStop = 60;
const double velocityScaleTurning = 70;
#endif


I use encoder HKT22 Optical Encoder (quadrature).
It has 300 resolutions (counts) per rotation.
The motor is ZY1020 500W max 2500 rpm gearmotor with ratio of 6.7 : 1.

When I do the calibrateMotor()  the testMotorSpeed() is executed.

Within this program this code will control the velocity and speed.

    if (abs(leftVelocity) < 200)
      (*leftSpeed) += 0.1;
    else if (abs(leftVelocity) > 203)
      (*leftSpeed) -= 0.1;

    if (abs(rightVelocity) < 200)
      (*rightSpeed) += 0.1;
    else if (abs(rightVelocity) > 203)
      (*rightSpeed) -= 0.1;

I don;t know how to change the 200 and 203 and encoder values above with my new encoders.
Please can someone advice my.

Regards, Reinier

5
Software development / How to assign pins to sabertooth
« on: September 23, 2014, 12:04:58 PM »
Hi,

I would like attach my sabertooth to a pin of the balanduino.
for example : ST.attach( pinnr, 1000, 2000);

Now is the pin numbers  assigned in avrpins.h

balanduino.h looks like
#define leftPWM P18

How can I define a pin in balanduino.h which I can use to assign it to sabertooth code?


Reinier

Pages: [1]