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.

Messages - reinier

Pages: [1]
Software development / Re: Error on using existing Encoder code
« on: November 22, 2014, 12:25:24 PM »
Hi Lauszus,

Thank you for your help.

Regards, Reinier

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

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


Do anyone have the same problem with deploying the firmware to the main board?

Regards, Reinier

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

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 


I can now compile the source code in Visual Studio 2013 but after download the file without any error, the leds are blinking which means that the communication is working correctly, the mainboard however don't response after downloading.
When I download the same code with Arduino IDE 1.5.8 everything works fine. The buzzer and led are working correctly.

Do you have any idea what can be the problem?

Regards, Reinier


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:\\\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

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

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

// Encoder values
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;
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;

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

Software development / Re: How to assign pins to sabertooth
« on: September 23, 2014, 11:24:25 PM »
I understand but I will explain it with an example.

This is my code:

#include <servo.h>

#define rightPWMST P3  // connected to sabertooth motor controller
#define leftPWMST P4  // connected to sabertooth motor controller

I can't write the code:

  leftST.attach( rightPWMST, 1000, 2000);
  rightST.attach( leftPWMST, 1000, 2000);

but only this code will work:

  leftST.attach( 3, 1000, 2000);
  rightST.attach( 4, 1000, 2000);

I don't want to use hardcode pinnumbers.
How can you help me to use the same notation?

Regards, Reinier

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

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?


Applications / Re: Android app graph instability problem
« on: September 22, 2014, 08:08:57 PM »

I have shortly received my balanduino. I have the same problem when I turn on the graph on my Android app.  Good to hear that it will be fixed when replacing the USB dongle.

Good work.

Best regards, Reinier

Pages: [1]