Blog 6 - Motor Control
Sabertooth 2x12:
For this week and last we have being trying to get the motors on the Swarm bots. We have been tracing back wires to see where each cable is going to see what is hooked into what. This was slightly harder than we thought as the wiring in the bots were messy and had 'random colours' going into different parts. The motor controller used was the Sabertooth 2x12, this was used to control the two motors on the bots vai 2 signals wires S1 and S2 to independantly control each motor.
During our testing we could only get the motor to go continously forward we could not figure out for a while why this was the case as we were sending PWM signals into the motor driver. We found after reading the datasheet that we need a 5V and Ground wires connected into the 4 pin input on the Sabertooth so the signal can be sent into it properly. After doing this it was still throwing out the same problem. After which we found out about the switches from the data sheet. From which we could see all the different modes and functions it had. After reading the data sheet we found the proper switch combbination for the controller to work.
The switch combination is as follows:
Switch number function and State:
- DOWN - RC Mode
- UP - RC Mode
- UP - Power supply
- DOWN - Independant mode
- UP - Linear response
- DOWN - Microcontroller mode
After we applied these setting the motor stopped "running away" and was following the correct PWM signals.
On boot up we had the PWM sending 1.5ms pulse to stop the motor.
On button press of the microcontroller we get the following:
- IDLE on start
- Press 1 -> motor 1 = 1.0ms
- Press 2 -> motor 1 = 2.0ms
- Press 3 -> motor 2 = 1.0ms
- Press 4 -> motor 2 = 2.0ms
- Then repeats to press 1
Videos of operation will come soon as we have a power issue currently but operation is working.
Comments
Post a Comment