Arduino Mega 2560 Code For AC Servo Motor Control AASD-15A

Job ID: 37000469

Budget: $30 – $250 AUD

Hi I have a Mega 2560 Contrller that I want code for to Control a Single AASD-15A AC Servo motor controller driving a St90-M02430 Motor.

Code is to have the following Items
1. E Stop button
2. Start Button
3. Stop Button
4. Photo Electric Sensor to count Products
5. Limit home switch

Code Requirements

Auto Home routine to Drive the motor Counter Clockwise (CCW) until the home limit switch is made.

After home is found automatically Drive Clockwise to Position 1.

Routine
with Motor in Position 1
Counter will count to 4 and then Move to position 2

Start of Loop.
with motor in position 2
counter will count to 4 and then move to position 3.

With motor in position 3
Counter will count to 4 and then move to position 4.

with motor in position 4
counter will count to 8 and then move to position 3.

With motor in position 3
Counter will count to 4 and then move to position 2

With Motor in position 2
Counter will count to 4 and then move to position 1

With Motor in position 1
Counter will count to 8 and then move to position 2.

Jump to start of loop and repeat.


not sure if the signal can be rising or falling edge for signal. If so would like it to be set to falling edge trigger.

Servo Motor Positions and speeds are to be determined, For programming reasons use 15 degrees from home to position 1. An Additional 15 degrees to Position 2, and additional 15 degrees to position 3 and additional 15 degrees to position 4.

Home position Zero Degrees
Position 1 15 Degrees
Position 2 30 Degrees
Position 3 45 Degrees
Position 4 60 Degrees

Reduction Gear box 10 to 1.
so Motor position will be Home 0
Position 150 Degrees
Position 2 300 Degrees
Position 3 450 Degrees
Position 4 600 Degrees

Motor speed 25%