Skip to content

4 channel servo controller code for Arduino Mega 2560 for AASD-15A and similar motor driver

License

Notifications You must be signed in to change notification settings

ehmotion/eh-msc-4dof

Repository files navigation

eh-msc-4dof

4 channel servo controller code for Arduino Mega 2560 for AASD-15A and similar motor driver

Arduino sketch for generating pulses needed to control servo drivers such as the AASD-15A used in the SFX100 project and the pt-actuators.
The controller is meant for the SFX100 actuator and the likes but it could easily be adapted to other configurations.

v1 - uses range detection

The controller will start detecting your actuator limits as soon as it is powered on so make sure you have all required connections ready prior to power on.

v2 - uses specified stroke

#define STROKE_LIMIT  100               //100mm limit means we do no homing

Use the stroke length you want, keep in mind that this should be in line with your actuator stroke so make sure you measure it. The circuit section between Arduino pin 18 (19, 20, 21) and DB25 pin 23 can be discarded since no limits detection is performed.

Both versions protect your actuators by not reaching their limit (it reserves 5mm at each end). Both versions use 0..65535 positions and maps them to the actuator lenght.


The following connections are required:
AASD-15A
CN2 DB25 pin / Arduino pin
Motor 1
 3              12
 4              A0
 6              A4
 23             18 (via 2.2kohm resistor and 0.1uF capacitor to GND)
 9              5Vcc
 5,10,14        GND

Motor 2
 3              2
 4              A1
 6              A5
 23             19 (via 2.2kohm resistor and 0.1uF capacitor to GND)
 9              5Vcc
 5,10,14        GND

Motor 3
 3              7
 4              A2
 6              A6
 23             20 (via 2.2kohm resistor and 0.1uF capacitor to GND)
 9              5Vcc
 5,10,14        GND

Motor 4
 3              45
 4              A3
 6              A7
 23             21 (via 2.2kohm resistor and 0.1uF capacitor to GND)
 9              5Vcc
 5,10,14        GND

!!!WARNING: failure to make the proper connections may result in broken actuators.

!!!If this is your first time, try one actuator at a time in each port since it won't mind if any of them is not connected. Watch the serial console/monitor in Arduino IDE to follow what happens during limits detection (the LED flashes slowly).

-the torque reach signal requires the following connection:

CN2 DB25 pin 23 -- 2.2kohm resistor -- Arduino pin
                \-- 0.1uF capacitor -- GND<br>
(resistor between DB25 pin 23 and Arduino; capacitor between DB25 pin 23 and GND)

The following parameters are required for the AASD 15A controller:
(push MOD until you see Pn000 to enter the parameter setup mode)

Pn2 = 2
Pn8 = 300
Pn9 = -300
Pn51 = 3000 (motor top speed/rpm, could be run slower if wanted)
Pn98 = 10
Pn109 = 1
Pn110 = 30
Pn113 = 20
Pn114 = 10
Pn115 = 100
Extra parameters needed in the AASD-15A drivers used for limits detection:
Pn24 = 100 (reach predetermined torque > 100%)
Pn52 = 1
Pn60 = 2 (not used for now)
Pn61 = 6

AASD-15A CN2 DB25 control signal connector explained:
 p3 - pwm signal
 p4 - direction
 p5 - GND
 p6 - enable (motor ON)
 p9 - 5Vcc
p10 - GND
p11 - ready (motor present and ready - not used for now)
p14 - GND
p23 - torque reached

Message format used for position control in FlyPTMover (starts with 'P4', ends with '!!'):

P4<Axis1a><Axis2a><Axis3a><Axis4a>!!

Serial port configuration: 115200,8N1
Command speed frequency: 2ms
Position data: 2 bytes binary
Position encoding: 16bits
Check the screenshots for details on FlyPTMover / Simtools settings.

Position control range: 0 to 65535 - it gets mapped to actuator limits as detected on power on.
To avoid limit detection for each serial port access, use a 10uF capacitor between Arduino pins RESET and GND.
Note that it is no longer possible to upload the sketch on the Arduino while the capacitor is connected.

Thanks to cubexvr! based on https://github.com/cubexvr/servoController

ENJOY at your own risk!

About

4 channel servo controller code for Arduino Mega 2560 for AASD-15A and similar motor driver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages