Asked — Edited

Home Stepper Motor

Can you show me some examples in Javascript of how to Setashome for V21? Can you also show me some examples in Javascript of how to Calibrate V22?



Related Hardware (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skills (view all robot skills)
Stepper Servo by Synthian Inc.
Control up to 127 stepper motors via Arduinos mapped to ARC servos; supports any stepper driver, serial network, home calibration, speed/accel.
Customizable inverse/forward kinematics editor for robot arms: add joints/bones, map XYZ in cm, auto-calc joint angles for precise 3D positioning.

ARC Pro

Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.

#65  

Yes, you're right this will be a tedious operation. I moved the code to the cmd==1 and ran it. No leds turned on, not even the Rx. Ran a loop program to 5000 back to 1 and back to 5000 etc to observe it and no leds came on at all. Before I continue with each is this what you were looking for whereas it doesn't turn on?

User-inserted image

Am I supposed to hook up an led to pin 13 and ground side of led to ground?

Author Avatar
PRO
Synthiam
#66  

When you read the comments of cmd 1, what does it say it does? I’m looking at your screenshot and it doesn’t say anything related to your test. :)

each cmd condition is a different function of the stepper controller. Hint: if you’re testing movement, you’ll want to put that code in the cmd condition for moving

Author Avatar
PRO
Synthiam
#68   — Edited

I don’t believe there is a ControlCommand for speed. You’ll have to check the cheat sheet. I believe the speed is a servo function.

setspeed

or in advanced servo settings

or just move the led code to the cmd for where the position is moved. No point to test something you don’t use.

#69  

This was a very good exercise! I delved in to the speed cmd2 with EZScript and see exactly what is happening with the debug light. It does toggle on and off each time it receives a script and works great! This speed script will come in handy and will save on script writing which I had to do to slow stepper down recently to very accurately find an edge. I moved the debug led code under the cmd5 for calibrate and the script is definitely is not getting there and same is happening with Homing as the built in debug led is not turning on for V8 but I can see it is trying to transmit on V1 with the Tx light coming on. Since the servoSpeed( V8, 5) is working with EZScript is there a similar code for homing. I looked around on the cheatsheet and did not see anything.  On a side note tried to put speed script into the new Javascript block but the code is in EZScript so it doesn't go. An upgrade for future may be to add an EZScript block. I used the ControlCommand to get around this in my loop code in Blockly. Getting closer.

Author Avatar
PRO
Synthiam
#70  

Your lesson isn’t done:) because you’re talking ezscript and trying to merge with Blockly which is JavaScript. So what you’re missing is the support section that has all the commands. Here’s the JavaScript command for setting speed: synthiam.com/Support/javascript-api/Servo/setSpeed

that being said, Blockly already has a speed block for servos. So you can just use that without typing the code.

#71  

Tried it and both of the items worked great. Looked up the setAsHome in Javascript and did not see any. What would the code be?