LabVIEW Interface for Arduino Blog

Community Browser
Labels
cancel
Showing results for 
Search instead for 
Did you mean: 

PMDC + Magnetic Encoder + Arduino + Motor shield MD10, What level of Labview interface is possible

Dear Friends 

i am starting  a project in which a basic PMDC motor with a 2PPR magnetic encoder controlled with a arduino MEGA and a Cytron motor shield MD10 driver i want to control it with the Lab view for basic position control. As i understand LIFA is the interface to be used and LINX also would be an option would it be possible to control it as i intend to control the position of the motor CW and CCW upto a certian degre which will be controlled with the encoder and the program to be built in the LabView.

The type of program i am trying to build up is that the motor goes upto a certain angle CW and then halts due to encoder with an interrupt feedback and then goes CCW upto the required angle.and then interrupt stops and then go to home position given by IR sensor.

I am a beginner with arduino and labview will this logic be possible as mentioned above or will it have a lot of lapses in counting and operation.

The hard ware i have available is mentioned below with specs

Motor: 2RPM 24VDC 2A 56Nm torque 1/720 ratio

Encoder: Magnetic 2ppr on motor.

Driver: Cytron motor shield MD10 (How about a SYREN10 driver, Arduino and Labview have serial comunication & so does the SYREN10 driver will that help prevent miscounts from encoder)

Arduino mega board

My only concern is the torque required i dont want to control speed or any other factor. I would appreciate your feedback, please inform me if any further info is required .

Your feedback will be appriciated.

Comments
Active Participant

Are you trying to control the number of revolutions the motor makes or to position the motor to a particular angle within a 0 to 360 degree range?  You can't position the motor to a particular angle because your feedback sensor is to coarse. With a 2 revolutions per minute motor and a 2 pulses per revolution encoder you won't have any counting lapses as you will only generate one pulse every 15 seconds.  So yes you can control the number of revolutions the motor makes.  

I suggest initially you just use the tArduino IDE to write a program to count the number of revolutions and to control the starting and stopping of the motor. Then once you are satisfied with the operation add LIFA capability to the project.  

If you need better resolution than 180 degrees you could use a timer to control how long the motor runs. 

hrh212

Member

thank you hrh212, thank you for the answer let me just elaborate a little bit more

Actually i want to control the position of the motor to a particular angle (85 degree back and forth Bidirectional).

The 2 ppr bidirectional magnetic encoder is on the motor of the gear motor (720 Gear ratio) the motor shaft is faster 1440 RPM which gives 2 RPM at the output shaft which makes the encoder resolution for output shaft higher i.e. one pulse every 0.25 degree. So 4 pulses can give 1 degree.

The program logic that i am working on is that the motor runs by a  arduino logic to motor driver  and then is stopped by the encoder pulse interrupts at different position between the whole angular range when required i intend to rotate (85 degree) CW and CCW plus 3 infrared sensors 2 for boundry range so that if any encoder pulses are miscounted and one acting as homing sensor (Home position). Kind of like a closed loop position control system.

as you suggested first IDE then LIFA but do you think that the construction of this above logic will be possible in LabView LIFA as i have seen at the other forums that encoders and DC motor might not be supported in LIFA? Will the IR sensor be supported?

i would appreciate any tips and feedback

muhammad

Active Participant

Encoders are not supported by LIFA.  I don't know if your Motor shield is supported.   LIFA has support for IR sensors because the sensor output is an analog signal. 

I recommend LIFA be used only for supervisory control.  That is send commands to the Arduino mega telling it when the motor should rotate and how far to rotate.

I suggest you use the FregMeasure Library to count pulses See

<https://www.pjrc.com/teensy/td_libs_FreqMeasure.html>

The example program measures the length of a period and counts the number of periods.   The example program can be easily modified to ignore the period measurement data and use the number of counts data to rotate the output shaft a predetermined number of degrees.

hrh212