1

I have successfully been able to turn the motors through the code pasted (found online). I am trying to adapt the code for a speed control, but it seems that the speed only goes to 100%, I have tried to create incriments and set mymotor.setW(30) and the motor does not spin, it only works at mymotor.setW(40).

link to download the code: https://www.dropbox.com/s/u1tqdxkkh6mkk4a/motor_test.py?dl=0 https://www.dropbox.com/s/9ljbbxrvzshus25/motor.py?dl=0

I want to make the motors increase incrementally like with the DC motor:

clockwise()

while True:

cmd = raw_input("Command, f/r 0..9, E.g. f5 :")

direction = cmd[0]

if direction == "f":

clockwise()

else:

counter_clockwise()

speed = int(cmd[1]) * 11

set("duty", str(speed))

4
  • Please add a link to motor.py code
    – salmon
    Mar 15, 2015 at 14:02
  • added link to dropbox download
    – tanuj Jain
    Mar 15, 2015 at 14:10
  • not this file. I'm asking for motor.py file. The file which you are using by running: from motor import motor
    – salmon
    Mar 15, 2015 at 14:23
  • added both dropbox.com/s/9ljbbxrvzshus25/motor.py?dl=0
    – tanuj Jain
    Mar 15, 2015 at 14:40

1 Answer 1

1

You normally control an ESC by sending servo pulses, i.e. 1000µs to stop, 1500µs half-throttle, 2000µs full-throttle.

I suggest you send servo pulses.

9
  • sorry if i sound daft, but how can i edit that on this script? I have looked at others and tried to run the code, but it didnt work..
    – tanuj Jain
    Mar 15, 2015 at 14:18
  • I'd completely forget your script for the time being and establish if your ESC will respond to normal servo pulses. You have given no details of the ESC or of the method you are currently using to drive the ESC (the hidden motor.py module).
    – joan
    Mar 15, 2015 at 14:29
  • dropbox.com/s/9ljbbxrvzshus25/motor.py?dl=0 this was the other file in the folder i downloaded, The ESC im using is a TALON 15 castle 16V
    – tanuj Jain
    Mar 15, 2015 at 14:34
  • Okay, that uses RPIO which sends servo pulses. Did you write motor,py or is it something you come across?
    – joan
    Mar 15, 2015 at 15:18
  • its something I came across - which is why i am unsure on how to edit it to control the speed incrementally
    – tanuj Jain
    Mar 15, 2015 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.