Go Down

Topic: Matlab multiple steppers trouble. (Read 161 times) previous topic - next topic

John_engineer88

Hello everyone.

I have an Arduino Uno with the Motor Shield V2.3 the problem is i cannot control simultaneous the 2 steppers which are connected to the shield. I search on the internet but i could not found a simple and understandable solution step by step.
Also I intend to add another motor shield for the 3rd stepper.
The Matlab version i use is R2011a and works fine. However the main problem is about to make the
2 steppers run at the same time.
 Is there anyway of having two simultaneous stepper motor outputs? 

Thank you and sorry for my English.

PaulS

Quote
Is there anyway of having two simultaneous stepper motor outputs? 
Yes. You just need the proper code on the Arduino. Too bad you didn't actually post any.

John_engineer88

The code for Arduino is from the file motor_v2.pde and is large code so would not be an exaggeration to
post it? I'm new here and i don't know.

Could you anyone from here give me some guidance how to do it
step by step?
Because simultaneous in Matlab the steppers don't rotate and I don't know how to do it.



jremington

You need to know the voltage and current requirements of your motors.
You need a power supply capable of providing enough current, at the required voltage, for both motors.
You need a motor driver that can handle two motors, or two motor drivers.
Each motor driver must be capable of controlling the required current without overheating.
Your program must be capable of controlling two motors.

For a final year student in electronic engineering, it appears that you have not learned very much.

PaulS

Quote
The code for Arduino is from the file motor_v2.pde and is large code so would not be an exaggeration to
post it?
I guess that depends on whether you want help with it, or just want to complain that it doesn't work.

John_engineer88

jremington: All these parameters you mention i have knowledge.My mistake that do not properly expressed.

PaulS: Of course I want to help with it. Ι tried to
post the code of pde but was large to post it . Here it is the pde file  and Matlab instructions I use:


Code: [Select]
   a=arduino('COM3');

 
a.stepperSpeed(1,10);
a.stepperSpeed(2,20);

a.stepperStep(1,'forward','single',48);
a.stepperStep(2,'forward','single',48);


end



PaulS

Code: [Select]
      if (val>47 && val<90) {
<snippet the novel...>
        s=10*(val-48);
      }

Please explain what 'Q' - '0' means. Are you really sending data in base 42? If so, the 10 should be 42.

John_engineer88

Please explain what 'Q' - '0' means. Are you really sending data in base 42? If so, the 10 should be 42.
Sorry but I don't understand what you mean.  :smiley-confuse:

PaulS

Quote
Sorry but I don't understand what you mean.
You test that the character received is between '0' and 'Z'. If it is, you subtract '0' from it, to get number in the range 0 to 42.

Typically, one tests that the character is in the range '0' to '9', and subtracts '0', to get a value between 0 and 9, because the string sent was a character representation of the number in base 10.

Since you are dealing with a range of values between 0 and 42, you must be sending a value as a string in base 42.

I'm wondering why. I'd understand base 2, base 8, base 10, and base 16. I do not understand base 42.

Go Up