Show Posts
Pages: 1 2 [3] 4 5
31  Using Arduino / Programming Questions / [Help] Hold Position Sytem Use Servo, IMU and PID on: May 16, 2013, 03:25:06 am
Hi, i want to make holding position system using servo motor, IMU and PID controller.

IMU will read position every time, for example, i will set the position at 90 degree. If i tilt the sensor below or above 90 degree, servo will rotating until sensor position back to 90 degree. So, this system will maintain position always at 90 degree. May be it is like a balancing robot, but i using servo motor. Am i need PID controller for this system? Is there any reference that i can learn?

thank you...

32  Using Arduino / Sensors / Re: Combining quaternion orientation with gravity-free acceleration measurements on: May 12, 2013, 01:14:19 am
The Github page is missing, is it deleted?
33  Using Arduino / Motors, Mechanics, and Power / Re: Brushless Motor Direction control on: May 05, 2013, 02:59:01 am
Sine wave drive may not be optimal - depending on the magnet pole and stator shapes a rectangular or trapezoidal  waveform may give more even torque - I'd recommend using a phase -> drive level lookup
table - you can then try out different waveforms trivially.

In the first instance straight trapezoidal is the easiest, either on or off, you can use PWM for speed
control.

What is the difference between use sine wave and trapezoid wave? Why sine wave may not be optimal?
34  Using Arduino / Motors, Mechanics, and Power / Re: Brushless Motor Direction control on: May 03, 2013, 03:47:44 am
The basic concept is that you're feeding the motor 3 phase AC power with each phase offset by 120 degrees (or 2/3 PI radians). Increase the frequency and the motor spins faster; stop the frequency and the motor stops, etc.

With the L2634 the control is via the IN1, IN2, IN3 inputs. It's basically three half bridges allowing each of the outputs to source or sink current. You have to analogWrite() to the inputs to get your smooth motion; analogWrite(pin, 0) makes the pin sink, analogWrite(pin, 128) is off, analogWrite(pin, 255) is source. So -- going out on a limb here with totally untested code -- for a smooth movement between two poles of the motor:

Code:
for (x = 0; x < 2 * M_PI; x += speed) {
  analogWrite(IN1, 128 + 128 * sin(x));
  analogWrite(IN2, 128 + 128 * sin(x + 2/3 * M_PI));
  analogWrite(IN3, 128 + 128 * sin(x + 4/3 * M_PI));
  delay(100);
}

Is that right? My trigonometry is horriblesmiley-sad-blue

Great explanation Chagrin, but i stil wait my brushless motor and L6234D to come. I will try your code when they arrive..
35  Using Arduino / Motors, Mechanics, and Power / Re: Brushless Motor Direction control on: May 02, 2013, 06:36:48 pm
That's a sensorless motor by the look of it, most ESCs are unidirectional (there is no way to cleanly reverse a sensorless motor
without stopping and re-starting it).  The bulk of such motors power airscrews which only ever need to go one way.

However its worth looking for RC model car/truck ESCs to see if there's a reversing one for that application.

[ edit: Oh, that's a high-resistance motor - does it have hall-sensors then? ]

Yes, the motor is sensorless. And for brushless gimbal system, i will use IMU as the sensor. This IMU will control the motor using close loop system, like this video:


There is an open source project about brushless gimbal:
https://code.google.com/p/brushless-gimbal/

But, I find it hard for understanding the concept and overall programming code. So I must to learn step by step, start from how to control Brushless Motor Direction..
36  Using Arduino / Motors, Mechanics, and Power / Re: Brushless motor: Why do I need an ESC? Alternatives on: May 02, 2013, 10:30:05 am
How if we not use ESC and use L6234 IC? like this guy:



and this guy too:

37  Using Arduino / Motors, Mechanics, and Power / Brushless Motor Direction control on: May 02, 2013, 10:27:38 am
Hi, i want to make my own version of brushless gimbal. For first step i want to know how to control brushless motor, especially for direction control. Is there any reference that i can learn?

i will use this motor:
http://www.rctimer.com/index.php?gOo=goods_details.dwt&goodsid=871&productname=

And i will use L6234D as a motor driver..

Thank You for your help..
38  Using Arduino / Sensors / Re: Can We Read Yaw Axis Without Compass? on: April 13, 2013, 02:12:20 am
Which sensor module are you using? The way the different values are transformed depends on the placement of the components on the PCB, so this fact is relevant.

What values do you get and what would have been the expected values?

i use this Board:
https://www.hobbyking.com/hobbyking/store/__27033__MultiWii_328P_Flight_Controller_w_FTDI_DSM2_Port.html

the value that i expected is when i tilt the board, the compass heading degree is not change, i have use tilt compensation algorithm for magnetometer, but still not works, the heading degree still change when i tilt the board..
39  Using Arduino / Sensors / Re: Can We Read Yaw Axis Without Compass? on: April 11, 2013, 09:34:49 pm
This is my code:

https://github.com/mamette/CompassCompensate/blob/master/main.ino

Quote
What problem do you have if you tilt it? What output do you expect? If you have a 3 axis magnetometer, you can calculate the facing direction even if the device is tilted

I want to make 3 axis gimbal, and the problem is on the yaw axis. SO far, i can calculate the heading degree, but when i tilt it, the value is change. I have tried tilt compensation compass algorithm from many reference, but still not works well. Are we must calibrate the magnetometer Max and Min value for each axis first? For Example like this:
Code:
#define M_X_MIN -421
#define M_Y_MIN -639
#define M_Z_MIN -238
#define M_X_MAX 424
#define M_Y_MAX 295
#define M_Z_MAX 472
40  Using Arduino / Sensors / Can We Read Yaw Axis Without Compass? on: April 11, 2013, 10:47:53 am
Hi, i want to read yaw axis for my project. So far, i do this by using compass (3 Axis magnetometer). But, it has a problem when i tilt it. I have tried many tilt compensation compass algorithm but still didn't solve the problem.

My Question is can we read yaw axis without compass? For example, use accelerometer or gyro?
Is there another method to read yaw axis?

thank you..
41  Using Arduino / Programming Questions / Close Loop Stabilization Using IMU on: April 11, 2013, 08:04:28 am
Hi, i want to ask about Close Loop Stabilization Using IMU (Accelerometer+Gyro). It used in camera stabilization system/ Gimbal..

In open loop system, sensor is separated from camera mount, and this is what i do now..

But, i want change my sistem to closed loop system, because it offer better accuracy. In this system, sensor is mounted with camera, so the sensor is almost not move because sensor is stabilize it self.

But, the problem is i still not find good reference to learn how to do that.

Is anyone have experience in closed loop stabilization with IMU?

Thank You..

42  Using Arduino / Sensors / Re: HMC5883L Calibration? on: April 06, 2013, 10:00:08 am
If you keep if flat, it senses the magnetic north. No problem so far.

The 'D' is deviation or declination and is the difference between the real north and the magnetic north. You could take that into account.
If the HMC5883L sensor is tilted, you need an accelerometer to detect how much it is tilted and you have to correct it. Because of the 'I' (Inclination) the magnetism is pointing downward or upward causing a change in the direction if it is tilted.


i have do it, but magnetometer tilt compensation is the problem, i have tried many algorithm like on this site:
https://www.loveelectronics.co.uk/Tutorials/13/tilt-compensated-compass-arduino-tutorial

and many others algorithm that not too different with it, but i still failed.


http://www.jameco.com/Jameco/Products/ProdDS/2150248.pdf

Explains declination adjustment, tilt compensation, etc.

Yes, the algorithm is not too different like on this site:
https://www.loveelectronics.co.uk/Tutorials/13/tilt-compensated-compass-arduino-tutorial

and many other version of magnetometer tilt compensation algorithm that i have tried, but still didn't works well. There must something wrong..
May be the calibration process is influential..
43  Using Arduino / Programming Questions / Control Servo With VB 2010 Problem on: March 27, 2013, 10:47:44 am
Hi, i want to make servo position control with VB 2010. For first try, i want to control servo between 0 - 100 degrees. In VB 2010 i use trackbar to control servo, and i setting the trackbar value between 0 and 10. So, 1 trackbar value represent 10 degree of servo movement. When i tried the system, it works, but there is a problem, the system will works well if the trackbar value ranged between 0 - 9. When i move trackbar value to 10, the servo must be move to 100 degree, but it goes wrong, the servo move to 0 degree, looks like arduino read the trackbar value is 0 not 10.

Then i do other experiment, and the conclusion is arduino only execute trackbar value between 0 and 9. When it between 10-19, or 20 and 29, and so on, arduino will read it as 0 - 9.

Well, how to solve this problem?
Thank you

this is my Arduino Code:
Code:
#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo

int val,pos;

void setup()
{
  myservo.attach(A0);  // attaches the servo on pin 9 to the servo object
  Serial.begin(115200); //begins serial communication
}
  
void loop()
{
  serialControl();
  myservo.write(val);
}

void serialControl() {
  if (Serial.available()){
    delay(100);
    while(Serial.available()>0){
    pos=int(Serial.read());     //reads the value sent from Visual Basic  
      if(pos=='0')
        val=0;   //rotates the servo 0 degrees
      else if(pos=='1')
        val=10;
      else if(pos=='2')
        val=20;  
      else if(pos=='3')
        val=30;  
      else if(pos=='4')
        val=40;  
      else if(pos=='5')
        val=50;  
      else if(pos=='6')
        val=60;  
      else if(pos=='7')
        val=70;  
      else if(pos=='8')
        val=80;    
      else if(pos=='9')
        val=90;  
      else if(pos== '10')
        val=100;
        
    }
  }
  
}

And this is my VB 2010 Code:
Code:

Imports System.IO
Imports System.IO.Ports
Imports System.Threading

Public Class Form1


    Shared _continue As Boolean
    Shared _serialPort As SerialPort

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        SerialPort1.Close()
        SerialPort1.PortName = "com18" 'you need to check which com port your arduino is using, and change them if you need
        SerialPort1.BaudRate = 115200
        SerialPort1.DataBits = 8
        SerialPort1.Parity = Parity.None
        SerialPort1.StopBits = StopBits.One
        SerialPort1.Handshake = Handshake.None
        SerialPort1.Encoding = System.Text.Encoding.Default
    End Sub
  
    Private Sub Label1_Click(sender As System.Object, e As System.EventArgs) Handles Label1.Click

    End Sub


    Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
        SerialPort1.Open()
        SerialPort1.Write(TrackBar1.Value)
        SerialPort1.Close()
        TextBox1.Text = TrackBar1.Value
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub

End Class
44  Using Arduino / Programming Questions / Re: Setting Variable Value Through VB 2010/ Arduino Processing on: March 26, 2013, 10:38:35 pm
Quote
how to write float/integer value from VB 2010 to arduino through serial port?
Generally, the F1 key will be a lot more useful for non-Arduino questions involving Visual Studio.

Quote
Or it's better to use arduino processing than VB 2010?
Or Java Arduino. Or Wiring Processing. Or Java Wiring. Or some other combination that makes no sense.

Thank You PaulS..
45  Using Arduino / Programming Questions / Setting Variable Value Through VB 2010/ Arduino Processing on: March 25, 2013, 07:51:54 am
Hi everyone..

I want to make servo control system that consist of automatic system and manual system. For automatic system, i use sensor (Accelerometer and gyroscope) to move the servo. And for Manual system, i use VB 2010 interface through serial port that can move servo manually by User. I want to combine both manual and automatic system. So, when the automatic system runnning, we can add value manually too from VB 2010 interface. Then, the total servo value is: sensor Value + manual Value.

The problem is, how to write float/integer value from VB 2010 to arduino through serial port? Or it's better to use arduino processing than VB 2010?

Thank You..

Pages: 1 2 [3] 4 5