top of page

Forum Posts

raykimber
Oct 24, 2022
In General Discussion
This is some code that I wanted to send to somebody ( @Lathe Adventures ) who asked me how to record the AR4's current position by pushing a button. I extracted this code from my modified AR4 program. I was working on customizing the rough calibration and fine calibration of the robot. The variables XcurPos, YcurPos, ZcurPos, RzcurPos, RycurPos, RxcurPos, and J1AngCur, J2AngCur, J3AngCur, J4AngCur, J5AngCur, J6AngCur in the code are part of Chris Annin's overall program. They are constantly updated to reflect the AR4's current position and orientation, and joint angles. As you can see, all this function does is delete and then write to 12 small entry fields (6 for the position and orientation, and 6 for the joint angles). The code below includes the Python function and the statements for creating the display fields. It also includes the definition for the button which executes the function. It should be able to inserted in Chris' AR4 source code file pretty much anywhere and compiled. I put my customization code after line 236 (after the "def setCom2():" code). The button and display fields are placed on the lower right corner of the "calibration"tab (I couldn't upload the python file so here it is) ######################################################## def SaveCurPosToFC(): # this function writes the current pose and angle position to the fine calibration position element fields global XcurPos, YcurPos, ZcurPos, RzcurPos, RycurPos, RxcurPos global J1AngCur, J2AngCur, J3AngCur, J4AngCur, J5AngCur, J6AngCur global FCxEntryField, FCyEntryField, FCzEntryField, FCrzEntryField, FCryEntryField, FCrxEntryField global FCj1EntryField, FCj2EntryField, FCj3EntryField, FCj4EntryField, FCj5EntryField, FCj6EntryField FCxEntryField.delete(0, "end") FCxEntryField.insert(0, XcurPos) FCyEntryField.delete(0, "end") FCyEntryField.insert(0, YcurPos) FCzEntryField.delete(0, "end") FCzEntryField.insert(0, ZcurPos) FCrzEntryField.delete(0, "end") FCrzEntryField.insert(0, RzcurPos) FCryEntryField.delete(0, "end") FCryEntryField.insert(0, RycurPos) FCrxEntryField.delete(0, "end") FCrxEntryField.insert(0, RxcurPos) FCj1EntryField.delete(0, "end") FCj1EntryField.insert(0, J1AngCur) FCj2EntryField.delete(0, "end") FCj2EntryField.insert(0, J2AngCur) FCj3EntryField.delete(0, "end") FCj3EntryField.insert(0, J3AngCur) FCj4EntryField.delete(0, "end") FCj4EntryField.insert(0, J4AngCur) FCj5EntryField.delete(0, "end") FCj5EntryField.insert(0, J5AngCur) FCj6EntryField.delete(0, "end") FCj6EntryField.insert(0, J6AngCur) ################ statements to create the pose and joint position display fields #############3 # fine calibration joint angle labels FCj1Lab = Label(tab2, font=("Arial", 11), text = "J1") FCj1Lab.place(x=920, y=440) FCj2Lab = Label(tab2, font=("Arial", 11), text = "J2") FCj2Lab.place(x=960, y=440) FCj3Lab = Label(tab2, font=("Arial", 11), text = "J3") FCj3Lab.place(x=1000, y=440) FCj4Lab = Label(tab2, font=("Arial", 11), text = "J4") FCj4Lab.place(x=1040, y=440) FCj5Lab = Label(tab2, font=("Arial", 11), text = "J5") FCj5Lab.place(x=1080, y=440) FCj6Lab = Label(tab2, font=("Arial", 11), text = "J6") FCj6Lab.place(x=1120, y=440) # fine calibration joint angle element fields FCj1EntryField = Entry(tab2,width=5) FCj1EntryField.place(x=910, y=465) FCj2EntryField = Entry(tab2,width=5) FCj2EntryField.place(x=950, y=465) FCj3EntryField = Entry(tab2,width=5) FCj3EntryField.place(x=990, y=465) FCj4EntryField = Entry(tab2,width=5) FCj4EntryField.place(x=1030, y=465) FCj5EntryField = Entry(tab2,width=5) FCj5EntryField.place(x=1070, y=465) FCj6EntryField = Entry(tab2,width=5) FCj6EntryField.place(x=1110, y=465) # fine calibration pose element labels FCxLab = Label(tab2, font=("Arial", 11), text = "X") FCxLab.place(x=920, y=490) FCyLab = Label(tab2, font=("Arial", 11), text = "Y") FCyLab.place(x=960, y=490) FCzLab = Label(tab2, font=("Arial", 11), text = "Z") FCzLab.place(x=1000, y=490) FCRxLab = Label(tab2, font=("Arial", 11), text = "Rz") FCRxLab.place(x=1040, y=490) FCRyLab = Label(tab2, font=("Arial", 11), text = "Ry") FCRyLab.place(x=1080, y=490) FCRzLab = Label(tab2, font=("Arial", 11), text = "Rx") FCRzLab.place(x=1120, y=490) # fine calibration pose element fields FCxEntryField = Entry(tab2,width=5) FCxEntryField.place(x=910, y=515) FCyEntryField = Entry(tab2,width=5) FCyEntryField.place(x=950, y=515) FCzEntryField = Entry(tab2,width=5) FCzEntryField.place(x=990, y=515) FCrzEntryField = Entry(tab2,width=5) FCrzEntryField.place(x=1030, y=515) FCryEntryField = Entry(tab2,width=5) FCryEntryField.place(x=1070, y=515) FCrxEntryField = Entry(tab2,width=5) FCrxEntryField.place(x=1110, y=515) # button to initiate loading current position to display fields FCSaveBut = Button(tab2, text="Save Curr Pos as FC", command = SaveCurPosToFC) FCSaveBut.place(x=1165, y=405)
0
1
269
raykimber
Mar 11, 2022
In General Discussion
I have an AR3 robot but wanted to explore using the new AR4 control software with my existing robot. I bought and installed a Teensy 4.1 and per Chris Annin's recommendations made the limit switch wiring changes to use 3.3V instead of 5V. I loaded the AR4_teensy41_CUI_enc_sketch in the Teensy 4.1 and got the AR4 control program running. There were some warnings in the Arduino IDE compilation (see attached file), but it still compiled. These are my observations so far in using the software: 1) After making the recommended wiring changes to provide 3.3V to the limit switches, all the limit switches and encoders tested okay using the special test programs. Nice additions to the tool chest. 2) All the limit switch calibrations worked okay (I only used the individual calibrations, not the auto) 3) Jogging on joints 2 through 6 worked fine, and was to the same direction as the AR3 ARCS control program angle, i.e., “+” and “-“ jogging moved the joints the same way as with the AR3 control program., which also agrees with the AR4 assembly manual diagram on page 263. 4) However, Joint 1 had a problem: a) The jogging direction was opposite to the movement using the AR3 control program, i.e., “+” jogging moves joint 1 CCW looking down on the robot instead of CW. (“+” movements resulting in CCW movements is also depicted in the AR4 manual on page 263.) b) Jogging joint 1 also results in an error message, “Collision or Motor Error – See Log.” (fixed. see next post) c) The angle indicated on the joint 1 jogging controls is opposite to the sign of the jogging button; clicking on the “+” jogging button results in a more negative angle rather than a more positive angle. (fixed. see next post) However, in jogging fractions of a degree (e.g., to bring the angle indicator back to 0.0) the + button results in a more positive angle indication, and vice-versa. 5) The capability to jog with individual motor steps doesn’t seem to work at all. Although the labeling on the button “Incremental Jogging” doesn’t agree with the description on the “Info” tab, it seemed to be the button that turns motor step jogging on an off. With the button enabled (Degree jogging mode?) and jogging set to 1.0, I jogged Joint 2 and the angle indicator appropriately showed + or - .99 degrees (why not exactly 1.0 degree?). However, when I unclicked the Incremental Jogging button (motor step mode?), and tried to move joint 2 with single motor steps, I got movements of roughly 1.5 to 2.0 degrees. The details are: (1) I started with the angle indicator at 0.0 degrees, and the desired movement set to 1 (i.e., 1 step) (2) I clicked the + button, and the angle indicator read 1.51 (degrees, I assume) (3) I clicked the – button and the indicator went back to 0.0 (4) I clicked the – button again and it went to -2.02 (5) I clicked the + button and it went to -.5 (6) I clicked the + button again and it went to 1.01 From my reading of the AR3’s specs for joint 2 there are 20,000 motor steps per robot axis revolution (55.6 steps per degree of rotation), so these movements are obviously not single steps. 6) I haven’t read all the description in the “Info” tab, but from what I have read, about calibration and jogging, it seems that this is the documentation from the AR3 control program not the AR4 program.There are enough differences between the two control programs that it would be very helpful to have an updated Info tab for the AR4 control program. I am using a Windows 10 PC to run the AR4 control program, and I downloaded the latest Arduino IDE and Teensy software. As I explore the new AR4 program further, I'll share my observations. Ray Kimber
3
1
484
raykimber
Jan 03, 2021
In Questions
I just finished building an AR3, which was a challenging experience lasting several months. It was successful, however, thanks to a lot of help from Chris Annin, and of course, a well-designed (aluminum) kit and a highly detailed installation manual. I had decided to use a servo gripper early on because I thought it would be quieter, and I didn't have a need for a powerful gripper. I just wanted to pass on my experiences in constructing it and getting it operational. The servo gripper I used is a Robix plastic gripper, which is available on the web. It uses a standard 3-wire servo (+5V, Gnd, control) that is controlled by PWM. The Arduino has a servo library that is dedicated to controlling these servos (the software that gets loaded into the Arduino MEGA controller calls this library). The ARCS control software used with the AR3 has convenient methods for directly controlling the servo, both manually (via the Input Output screen) and in a program (via the "servo" button, which inserts a control statement in the program). In the AR3 installation manual, chapter 5, Chris talks about servo grippers briefly. Mounting the servo-controlled gripper – The servo gripper will not directly mount to the J6 gripper mount piece so you need some sort of adapter as a go between. I designed and 3D printed an adapter that did the job nicely, using screws that came with the AR3 kit (note that because I either lost a few screws or they were not in the kit, I had to order another screw hardware kit (around $20 -- a good investment), so I had extra screws. The STL file for this adapter is attached below (note: I was unable to upload this STL file. If anybody wants it, please contact me at raykimber@comcast.net). Wiring the servo -- The servo needs +5V (red wire), Gnd (black wire), and a control signal (yellow wire). These run back through the length of the AR3 arm to the wiring box at the base of the robot, and via a GX12-4 connectorized 6 ft cable, back to the power enclosure. Since the STL files for the 3D-printed wiring box doesn't have an extra hole for a servo gripper's GX12-4, you have to drill one yourself (also an extra one on the enclosure). I drilled one on the right side of the wiring box, close to where the J4-J6 wiring enters the box. Originally I ran AWG 22 (red and black) and AWG 18 (yellow) individual silicone wires from the gripper to the wiring box (this is what I had on hand), but because of a noise problem (see below), I removed them and substituted a shielded 3-conductor AWG 22 cable from the gripper to the wiring box. On this shielded cable I left the shield at the gripper end unconnected, and connected the shield at the wiring box end to the cable's black wire. The GX12-4 connectorized cable between the wiring box and the enclosure was made from the same 4-conductor cable used for the motor cables. Back in the enclosure, the red and black wires should be connected to the 5V power supply using the same red and grey DIN terminals as the ones used to power the relay board (the servo draws too much current and is too noisy for the the Teensy +5V power). The yellow wire gets connected to the MEGA's A0 pin (you can use A0 through A7, but why not use A0 for a single servo). Operating the gripper -- Once the wiring is done as instructed from the AR3 installation manual, and the robot and enclosure are otherwise constructed, and the Teensy and Arduino MEGA have their software loaded, you can operate the gripper from the Input Output screen as a test using the Servo 0 buttons (this assumes the yellow wire is connected to the MEGA's A0 pin). On my gripper an entry of 30 opens the gripper fully and 180 closes it fully. So entering 30 in one Servo 0 button and 180 in the other allows you to control the gripper. Enter these same values (or whatever numbers are appropriate for your gripper) in the "position" value in the "Servo" button on the "Main Controls" screen to place a servo control command in your program. In the "number" field enter 0 through 7 corresponding to the pin number you're using on the MEGA (A0-A7) for the yellow wire. Noise problem solved -- In my case, when I completed all the wiring using the individual red, black and yellow wires, and I fired up the AR3, I got no movement of the gripper. I tried both the manual method and using the servo command in my program -- nothing. I thought I heard a little servo "twitch" now and then, but no movement. Then I noticed that when I shut down the 24V motor power, the gripper worked perfectly, so I figured there was a noise problem. I replaced the three individual servo wires with a shielded cable from the gripper to the wire box and connected the shield to the black wire. I continued to use the same unshielded connectorized cable between the wire box and the enclosure, but I figured if this didn't work, I could always use a shielded cable back to the enclosure. In this case I would have terminated the robot cable shield on the GX12-4 jack metal housing and only connected the shield to Gnd back at the DIN rail terminals. Anyway, this almost did the job. With the 24V power on, I was able to completely control the gripper. However, there were occasional gripper twitches, so I wasn't finished. I hooked an Oscope up to the servo wires (signal on the yellow wire and ground on the black) and saw the problem: With the 24V power off there was a clean pulse at 200KHz (the servo control), but with the 24V on there was a strong 1MHz pulse on the frequency display and some jitter. But I noticed that there was no physical twitching of the servo when the scope probe was attached. I figured that the capacitative loading from the probe (approximately 100pF) attenuated the noise enough to eliminate the twitches. I removed the scope probe and attached a 471pF capacitor between the yellow and black wires at the connector to the servo (see photo below) and this did the job -- full control of the gripper and no twitching. I hope this was helpful. Ray Kimber
Tips for using a servo gripper instead of a pneumatic one content media
3
2
345

raykimber

More actions
bottom of page