Servo Drive Controller

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
sysprofessional
Posts: 54
Joined: Sat Oct 26, 2013 7:16 pm
Has thanked: 28 times
Been thanked: 4 times
Contact:

Servo Drive Controller

Post by sysprofessional »

Hello ,

I ma using a 1.5 KW AC servo motor with Panasonic microstep servo controller.That is using in a big size flat bed printer for Y axis .My motion card generate 2 bit pulse to control this motor, (00) when no printing(idle state), (01) for reverse moving, (10) in print command, and (11) for servo step after print one line.
NOTE: Motion card did not use any encoder or strip for feedback on Y axis, just one one encoder strip using for X axis.

Microstep drive have 6 wires for control, Dir+ ,Dir- , Pulse+ , Pulse- , 24 volt+ , Gnd.

In my scenario Dir- , Pulse- ,and Gnd are connected to pcb GND , while Dir+ connected to portC.0 , Pulse+ connected to CCP1 on portC.2 ,

I have design a program using 16f887 to control a this motor for these tow bit pulse on portD.0 and portD.1 use masking. Whole program is very simple.

crystal = 12MHz
Pwm enabled on 7 KHz by adjusting the period registor and prescaler
duty cycle = 0

in program i am using input icon to check portD 0 and 1 bit only , and a switch icon with three cases 0 , 1 and 3
if case = 0 // do nothing (set duty cycle 0)
if case = 1 // set bit on protC.0 for direction,and set duty cycle for 50% (or any other frequency, that's not matter because step can be adjust in micro step controller)
if case = 3 // cr bit on portC.0 , and set duty cycle
---------------------------------------------------------------
this program is working on machine but not real time , for example if i print a 500 mm line to Y axis , the result will not 500 mm , it could be 505 mm ,507mm or less then 500 ,496 or 492mm ,
every test gives different result, with few mm difference on Y axis.

Now i have design a program using portB.0 Interrupt, but did not test yet.because my physical environment is too far from my location.so due to long distance i want your suggestion before test,
just guide me if port interrupt method work in real time , or suggest me any other solution.

any suggestion will be appreciated.

Best regards
Sysprofessional,

George_B
Posts: 128
Joined: Wed Jul 04, 2012 11:21 pm
Location: Greece
Has thanked: 51 times
Been thanked: 19 times
Contact:

Re: Servo Drive Controller

Post by George_B »

Hello and Good Morning,

please specify which servo motor and servo drive you are using. I am a bit confused because in the beginning you are saying for servo drive and then for a stepper motor with micro-stepping Driver? Is it Servo or Stepper drive and motor?

As soon as your motor drive works with Direction and Pulse signals you must be able to control it easily using a micro-controller.

I think that you have wrong positioning due to the fact that you are using PWM to drive the Pulsle+ pin.

1)How many pulses do you send out to the Motor Drive in order the motor to make one full revolution?

2)Is the motor coupled somehow with any Ball screw or Timing Belt system in order to give motion to the Y axis? If yes specify the ball screw pitch or pulley diameter.

Suggestion:
If you don't know how many pulses per revolution your drive need in order the motor to rotate one full circle then i thing you should make a simple test first by disabling the PWM and use the same Pin as digital output.
Then generate pulses (HI-LOW-HI)and drive the Pusle+ pin of the motor drive. Keep a counter for each pulse in your program so you can find the exact number of pulses needed to rotate the motor one full circle.


Edit:
<<NOTE: Motion card did not use any encoder or strip for feedback on Y axis, just one one encoder strip using for X axis.>>
Your Panasonic Drive is obviously running on a closed loop control mode (due to the encoder installed on the motor) which means that you have encoder in Y axis too.

:)

Regards
George

Post Reply