Show Posts
Pages: 1 2 [3] 4 5 ... 27
31  Using Arduino / Motors, Mechanics, and Power / Re: Controlling DC voltage to a linear actuator on: February 07, 2013, 02:27:58 am
And using the formula of displacement over time you will get the speed.
Now what you should do is to base on your feedback of your choice, you should know how many tick of an incremental encorder, or the final value of the absolute encorder or linear pot.
 
32  Using Arduino / Motors, Mechanics, and Power / Re: Controlling DC voltage to a linear actuator on: February 07, 2013, 02:23:22 am
What is speed?
As i recall from my physic class when i was 14, speed is displacement over time
So i think if you can control how far the linear motor move within a given time , you have speed control? Correct me if 'm wrong guys.

You need some kind of feedback to know control the speed, usually people will use incremental encorder, rarely people will use absolute encorder , and since you are using a linear motor one more option if shaft is short you could also use a linear/log pot.

So this is how i would tackle this problem, it is not nececerily the best or the most elegent way of doing it but its how i think could be one of the way of doing it....

Since ve have some form of feedback you could make use of a simple calculation to set the speed
One you need to define the length of travel and the time it would take for the motor to reach that length.
W
33  Using Arduino / Motors, Mechanics, and Power / Re: Controlling a DC motor using PWM and a potentiometer on: February 06, 2013, 10:04:29 pm
Code:
int speedread=analogRead(pot1);
 Int speed=map(speedread,0,1023,90,255);
 AnalogWrite(motor1,speed);

This way you could use the full renge of the pot and have the motor start moving as your intended speed....
This is not a complete code so add the thing
34  Using Arduino / Motors, Mechanics, and Power / Re: Controlling a DC motor using PWM and a potentiometer on: February 06, 2013, 09:49:42 pm
Hi, i'm.sorry if i.have so many typ, i typing using a phone.
I would recommend you to use the map function

35  Using Arduino / Project Guidance / Re: How do you adjust PWM periods for Servo control? on: February 06, 2013, 10:21:35 am
Usually people would use the servo library.
Since it is a class you can actually asign as many as you want under the limit of each bord capability.
36  Using Arduino / Motors, Mechanics, and Power / Re: Controlling position of linear actuator on: February 05, 2013, 01:36:08 pm
well it seem that you understand what i mean..... btw what do you mean by no no
37  Community / Gigs and Collaborations / Re: Project Completion Help on: February 05, 2013, 12:38:23 pm
indiegogo or kickstater? search for crowd funding
38  Using Arduino / Motors, Mechanics, and Power / Re: Controlling position of linear actuator on: February 05, 2013, 11:39:33 am
hello Retroplayer
i guess this would not be a good idea but if your willing to try,
Quote
Each h-bridge has a forward and reverse signal, btw. 10 is forward, 01 is reverse, 00 is off, and 11 is a no-no (no braking.)

if you do decide to use pwm to control the speed your set up one way to do it is by controlling one of the pin
for example if you want to go forward, you have to pwm the first pin.

for braking, you could for instant if you go forward pwm the second pin but use only 50 that way you have total braking.
39  Using Arduino / Programming Questions / Re: Program stops after button press on: February 05, 2013, 06:38:07 am
try this
Code:
uint8_t Switch = 2;
uint8_t Led =13;

boolean LedState =LOW;
int SwitchState =0;
int SwitchDebounce;
int LastSwitchState=HIGH;
int LastSwitchDebounce=LOW;

unsigned long LastDebounceTime = 0;
unsigned long DebounceDelay = 50;

void setup()
{
  pinMode(Switch,INPUT);
  digitalWrite(Switch,HIGH);
  pinMode(Led,OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  int CurrentSwitch = digitalRead(Switch);
  if (CurrentSwitch != LastSwitchDebounce)
  {
    LastDebounceTime = millis();
  }
  if ((millis() - LastDebounceTime) > DebounceDelay)
  {
    if (CurrentSwitch != LastSwitchState)
    {
      if (CurrentSwitch == LOW)
      {
        CountNumber++;
      }
    }
    LastSwitchState=CurrentSwitch;
  }
  if ( !CurrentSwitch && !LastSwitchState) CountNumber++;
  Serial.println(CountNumber);
  LastSwitchDebounce = CurrentSwitch;
}

40  Using Arduino / Project Guidance / Re: Soft Starter code using PWM to control DC Motor on: February 05, 2013, 06:16:09 am
one idea is to use for loop that would give you your softstart
41  Using Arduino / Motors, Mechanics, and Power / Re: Controlling position of linear actuator on: February 04, 2013, 05:50:13 pm
how about using softPWM?
42  Using Arduino / Motors, Mechanics, and Power / Re: converting astable multivibrator for DC motor on: February 04, 2013, 12:35:15 pm
you need a H bridge that control by an opto couple then this could be use
btw the third leg is it connected to anything body or something
43  Using Arduino / Project Guidance / Re: button and switch on: February 04, 2013, 12:28:48 pm
you need to debounce and state change detection, then you need to know how you would like to control the main
whats the diff of switch and button?

anyway some hint for you
if you want a relay to be switch on as long as a switch is press
Code:
digitalWrite(Out,digitalRead(IN1);
if you want a relay to be turn off when switch is press. and turn on soon after that
Code:
digitalWrite(Out,!digitalRead(In1);
44  Using Arduino / Programming Questions / Re: Multiple Blink States with a button no delay on: February 03, 2013, 10:45:06 am
Pauls,
I have verify that State value will be updated everytime i press the Switch,
i also have verify that count will start at 0 and every 500millisecond it will increase by 1
i also verify that if State value change, count will reset. what i dont get is this one
Code:
int State2[4][2]=
    {
      (0,1),
      (1,1),
      (0,0),
      (1,0),
    };

int State3[8][3]=
    {
      (0,0,0),
      (0,0,1),
      (0,1,0),
      (0,1,1),
      (1,0,0),
      (1,0,1),
      (1,1,0),
      (1,1,1),
    };

and this one
Code:
case(2):
   
    digitalWrite(Led[0],State2[Count][0]);
    digitalWrite(Led[1],State2[Count][1]);
    if (Count==6)Count=0;
    break;
    case(3):
   
    digitalWrite(Led[0],State3[Count][0]);
    digitalWrite(Led[1],State3[Count][1]);
    digitalWrite(Led[2],State3[Count][2]);
    if (Count==9)Count=0;
    break;

as you can see that in case2 i have use the pattern in State2, however what i dont get why do i need to reset Count==6 as oppose to 4/5?
and in case 3
i use the pattern that i set in State3, however what i dont get is although it doesnt follow the pattern that i have set in array State3, it does however able to repeat the same sequence every time though its not the one that i have set, i can also verify that all my led work and pin work
45  Using Arduino / Programming Questions / Re: Multiple Blink States with a button no delay on: February 03, 2013, 10:33:22 am
there have been many time that count become a runaway, haha but i had done a few if statement so that it will never go higher then 15. i have use the serial.println to see all the value of Count and it does go to 0. btw its not random that what happen to case 3, it happen in a perticular sequence that is not like i state in patern3
Pages: 1 2 [3] 4 5 ... 27