
Bernard104

Hi,
I'am having trouble with my programming, I cant seem toe get the ESC to go into reverse.
I'm a new user of the ez builder software so it could just be me interpreting the code wrong but this is what I wrote to try and get the ESC into reverse.
Move(D0, "stop")
Movement_Wait("stop")
Move(D0, "reverse")
Movement_Wait("reverse")
Servo(D0, 100)
Every time i run the code it tells me that there is a problem with the word "stop".
Any help will be greatly appreciated.
(I'm using the key control to control the movements)
Upgrade to ARC Pro
Get access to the latest features and updates with ARC Early Access edition. You'll have everything that's needed to unleash your robot's potential!
***EDIT*** Looks like it can be reversed... my experience is limited when it comes to ESC as I only have used them for flying where there is no need for reverse... Anyway, try PWM and see if that will drive your ESC...
Code:
That said, the original code works. I just tried it in ARC and the code runs without error.
As for controlling the ESC, what does it say in the datasheet?
Not having any information on the ESC nor having ever used one I can't test it however if you follow the procedure for a Modified Servo, add the modified servo control and configure it for the correct port, provided the Arduino community are correct it should work.
If you can try that and let us know it'll save digging around for a decent datasheet on the ESC.
I don't have a data sheet for the ESC, it came with a rc car that I bought 3 years ago.
As for the PWM it does not work that good and it would not go into reverse.
If that doesn't work then the datasheet will be needed to see if we can figure out how the ESC is controlled.
As far as I can find out online from quick searches, PWM should work. Some experimentation may be needed to work out what PWM value do what to the ESC though. This is something you would have to do unless someone else on here also has the same ESC (which is doubtful).
To be honest, why use the ESC? Replace it with a H-Bridge and you will make everything so much simpler.
Does your ESC have a button on it which is used to set the values for neutral, full acceleration and full reverse? According to one post online it does.
It runs from PWM. You will need to calibrate it to the specific PWM values. The you will use those PWM values to control it.
Before I go about explaining the best way to do that please tell us if there is a button on it for calibration.
For reference, the PWM of a servo is different and explained in detail on the servo page for the v3: http://www.ez-robot.com/Tutorials/EZBv3-Servo.aspx
Now, the question you are waiting for.. How do make the ESC work? Well, firstly if the ESC is your method of movement, then use the Modified servo Movement Panel. Therefore in EZ-Script, you would use the Stop(), Forward(), Left(), Right(), Reverse() commands.
If the ESC is not your method of movement, and perhaps used for controlling an ARM or something - then use the Servo() Control. This is because the ESC receives PWM similar to a servo. So, in this case you would need to identify what appropriate PWM commands work with the ESC.
On a v3, try this
Servo(d0, 10) <- that should move one direction
Release(D0) <- that should stop the motor
Servo(d0, 90) <- that should move the other direction
If those don't work, try changing the numbers like this...
Servo(d0, 11) <- that should move one direction
Release(D0) <- that should stop the motor
Servo(d0, 89) <- that should move the other direction
Servo(d0, 12) <- that should move one direction
Release(D0) <- that should stop the motor
Servo(d0, 88) <- that should move the other direction
Servo(d0, 13) <- that should move one direction
Release(D0) <- that should stop the motor
Servo(d0, 87) <- that should move the other direction
Etc... EZ-Robot did not make the ESC. And no ESC's or Servos follow any standard what so ever... So it's literally impossible for us to have a single parameter that works with all ESC's and Servos. The only way to make it work is to find the appropriate servo PWM value for your ESC.
I live in a small town, so there is no chance that I would find a H-Bridge here, I would have to order it online.
To calibrate it follow these steps accurately and carefully.
When you first power the ESC up the LED should flash red once.
Run the code Release(port) where port is the port it's connected to.
Now press the set button.
Now run the code Servo(Port,90)
Now press the set button.
Now run the code Servo(Port,10)
Now press the set button.
It should now be calibrated and work like a modified servo. You will not have to calibrate it again once you do this once.
Note: The above is based on DJ's servo positioning code above. We may need to experiment a little still but I am sure we are heading in the right direction.
For more information on this ESC have a read of the manual
The code that works for me is:
Move(D0, "reverse")
PWM(D0, 8)
For example, the words "modified servo" are only 2 words. The words "Modified servo movement panel" is 4 words. Notice how they are different?
Your example code does not make sense. Using the Move() and PWM() functions together do not make sense.
Please re-read my last post. Have a cup of tea between reading it. Then read it again
The Tamiya TEU-101BK operates a single motor.
With that in mind, the Modified servo Movement Panel may not be the correct control for this operation. If it is only capable of moving an object in a forward or reverse direction then the Modified servo control, correctly configured for the forward and reverse servo values may be better suited.
To be honest, I would try the Modified servo control (not the Modified servo Movement Panel) first.
1. Add the Modified servo control to the project
2. Configure it for the correct port and desired servo positions for forward and reverse
3. Power up the EZ-B and ESC
4. Press the STOP button on the Modified servo control
5. Press the SET button on the ESC (for longer than 0.5 seconds). The LED should flash
6. Press the directional arrow on the Modified servo control for Forward
7. Press the SET button on the ESC. The LED changes to a double flash
8. Press the directional arrow on the Modified servo control for Reverse
9. Press the SET button on the ESC. The LED should turn off
The ESC should now be calibrated to the Modified servo control.
Test it now by clicking on the Forward button on the Modified servo control or using the script command Move(D0, "Forward") - assumed it's connected to D0, change port to suit.
Now try the Reverse button on the Modified servo control or use the script command Move(D0,"Reverse") - assumed it's connected to D0, change port to suit.
Now try the STOP button on the Modified servo control or use the script command Move(D0,"Stop") - assumed it's connected to D0, change port to suit.
If the manual is correct this should have worked and now you can use the Move() command in EZ-Scripts or use the Modified servo control to have the motor move forwards, reverse or stop.
For more information on the ESC (however limited to calibration and fault finding) it is available here
For more about the Modified servo control click here
For more about the Modified servo Movement Panel click here
If your intention is to use it for movement of your robot then you will require the Custom Movement Panel plus some scripting or, if using 2 ESCs for movement the Modified servo Movement Panel and both ESCs correctly calibrated.