SCARA robot arm
 
Notifications
Clear all

SCARA robot arm

43 Posts
4 Users
3 Likes
2,660 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6895
 

@bldrgy It looks like a controller for a CNC machine. It might work but why not start off at least with something more 'hobby' oriented. Somewhere back around your first post you said there were only 3 wires from the husky lens to arduino, power and communications. Since power needs 2, that leaves 1 for coms. Your mention of pins 0 and 1 and serial make no sense. Yes you can use 0 and 1 but they are semi-reserved, why not use 2 of the more general purpose pins. I am really confused by the following statement.

I’m going to assume that if communication is established and sent to the serial monitor, that’s how to code the robot to somehow go to that position?

Help us understand your experience level. Did you buy the SCARA arm or make it?

Have you spent at least several hundred hours programming a UNO with smaller less complex code?

 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
Topic starter  

@bldrgy 

Wouldn't Husky connect here for communication?

To enlarge image, right click image and choose Open link in new window.

cncPins
cncShield

I would say so. But don't blame me if that is not the case 🙂  One way to find out, try it.

See connections in this link.

https://wiki.dfrobot.com/HUSKYLENS_V1.0_SKU_SEN0305_SEN0336

 


   
ReplyQuote
(@bldrgy)
Member
Joined: 2 years ago
Posts: 19
 
Posted by: @zander

@bldrgy It looks like a controller for a CNC machine. Yep it is.

 

It might work but why not start off at least with something more 'hobby' oriented.

Seems hobby oriented to me:) I’m just not sure how to do it…

 

Somewhere back around your first post you said there were only 3 wires from the husky lens to arduino, power and communications. Since power needs 2, that leaves 1 for coms.

I misspoke. There are 4 wires from the Husky Lens,  power and ground along with RX and TX.

Your mention of pins 0 and 1 and serial make no sense

0 and 1 have to connect to the shield as it fits on top of it. 

0 and 1 would be the pins to hook the Husky to - wires RX and TX

Yes you can use 0 and 1 but they are semi-reserved, why not use 2 of the more general purpose pins.

They don’t appear to already in use in the project as it is now.

 

I am really confused by the following statement.

I’m going to assume that if communication is established and sent to the serial monitor, that’s how to code the robot to somehow go to that position?

Here’s what I assume. Husky picks up the object visually and can tell the coordinates of the object. It sends that information to the serial monitor in Arduino. Based on those positions in the serial monitor, code can be written to move the motors where you want and need them to grab the object. Is there something more I’m missing?

Help us understand your experience level. Did you buy the SCARA arm or make it?

I printed the arm and assembled it. Wired and coded it per instruction from the website I used. It operates as expected. It performs quite well and seems to be accurate. I’m new to coding c++. I have done some PLC coding and built another unrelated machine from scratch. 

Have you spent at least several hundred hours programming a UNO with smaller less complex code?

Not even close:) probably less than 50. That’s why I’m asking the smarter more experienced guys for help! So I don’t assume I know anything about coding yet.

 

 


   
ReplyQuote
(@bldrgy)
Member
Joined: 2 years ago
Posts: 19
 
Posted by: @robotbuilder

@bldrgy 

Wouldn't Husky connect here for communication?

To enlarge image, right click image and choose Open link in new window.

cncPins
cncShield

I would say so. But don't blame me if that is not the case 🙂  One way to find out, try it.

Lol… so don’t blame you if I smoke it! No worries, I’m thankful you are trying to help. 

See connections in this link.

https://wiki.dfrobot.com/HUSKYLENS_V1.0_SKU_SEN0305_SEN0336

 

Thanks for the link and diagram. I will give it shot. I may try and hook up another shield to another UNO along with a stepper and see what I can make happen per Ron’s suggestion. 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6895
 

@bldrgy Serial is for debug, it is part of the IDE, that button on the top right. I suspect you are confusing it with SoftwareSerial. They can be assigned any digital pins but it is ill advised to use 0 and 1 as that is the hardware serial. Does that make more sense to you?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6895
 

@robotbuilder Bill's sketch I just looked at uses SoftwareSerial on pins 10 and 11 to 'read data' from the husky lens, that will not change it then prints that data on the standard serial debug, that needs MAJOR CHANGES.

If @bldrgy wants to use that data to control steppers, then he needs to change the Serial.println's to some other form of output but not before processing that data into something the steppers will understand. 

To be clear AFAIK Bill's sketch either Software Serial or I2C version needs major changes to process the data returned at line 51. The first step is to find the documentation of the protocol that HuskyLens is using, for instance, we can see that COMMAND_RETURN_BLOCK is one such item, you will need to get documentation on all of those as well as the rest of the data returned.

NOW you can use that data to possibly identify the coordinates of whatever you are looking for (of course you need to identify what is being seen and decide if that is of interest) and translate that into stepper motor commands.

I am sure I am missing some pieces, but that is the big picture.

Good luck.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
Topic starter  

@zander 

@@bldrgy FYI

In the link provided,

In the I2C mode they use pins 16, 17 ?
Which on the cnc shield is SCL SDA ?

Relevant code examples are also given.

To enlarge image, right mouse select image and choose Open link in new window.

I2CMode

   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6895
 

@robotbuilder Yes, those are the UNO's predefined SCL and SDA, notice in the sketch the pin numbers are never mentioned, it's all built in.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@bldrgy)
Member
Joined: 2 years ago
Posts: 19
 
Posted by: @zander

@bldrgy Serial is for debug, it is part of the IDE, that button on the top right. I suspect you are confusing it with SoftwareSerial. They can be assigned any digital pins but it is ill advised to use 0 and 1 as that is the hardware serial. Does that make more sense to you?

Yes it does. Thanks. 


   
Ron reacted
ReplyQuote
Oracid
(@oracid)
Member
Joined: 5 years ago
Posts: 18
 
Posted by: @bldrgy
 
This is the shield I have see questions on picture.
4383467A FECC 4BB6 947E 97F35425634B

 

Yes the pin RX and TX are on the UNO. RX is the pin 0, and TX is the pin 1. The same in the NANO.

Yes, you can connect the Huskylens in this pin as it is write in this link, Gravity: HUSKYLENS - An Easy-to-use AI Machine Vision Sensor (dfrobot.com) 

But I better like to connect the Huskylens with I2C when it is possible. It seems to be easier and more confortable. So you can still keep the IDE Serial Monitor available to print values.

In your shield, the blue pins, just under RX and TX, are SCL and SDA, whose are the I2C.

In the UNO, SDA is pin A4 and SCL is pin A5.

In the Nano, SDA is pin A4 and SCL is pin A5.

As you can see it is the same pins in the UNO and the NANO. On shields, you can find those pins duplicated for convenience, but they still are  connected to pin 0(RX) or pin 1(TX), and pin A4(SCL) or pin A5(SDA).

In my opinion, it is more convenience to talk about pin 0 to pin 13  for digital pins and pin A0 to pin A7 for analog pins.

The fact is that the digital pins have the same number that in the card (only on the UNO), but not the analog pins.

Hope this help.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6895
 

@bldrgy One last try to see if I can get you on the right track. You are obsessed with Hardware Serial, pins 0 and 1. That is where the Serial.println output goes in BOTH cases. Ignore that, it shows up on your screen because you have a USB cable plugged in and you clicked the Serial output button top right on the IDE. This is the debug output. Leave that as is.

I recommend you use the I2C sketch so you are no longer confused by the hardware/software serial issue. 

The huskylens data/input comes from either pins 10 and 11 using SoftwareSerial OR SCL/SDA using I2C. Bill used the A4/A5 SCL/SDA pins on the analog side, there is also a duplicate set on the digital side last 2 before reset switch.

In a nutshell, you need to modify/create code to take the data the read statement places in the variable result and send it to the steppers to do what you want. I doubt that will be trivial, so be prepared to do significant research and write some not insignificant code. I suspect 2 or 3 new modules, one to decode the input data, some calculations, and another to send commands to the steppers to do whatever it is you want to do.

I don't know what the hardware interface is between the steppers and that CNC board, or the board and the UNO. I suspect several other members will know that and chime in.

Good luck!

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
Topic starter  

@bldrgy 

I will give it shot.

So are you going to tell us how it went?  Can you run the Huskylens from pins on the sheild?

 

 


   
ReplyQuote
(@bldrgy)
Member
Joined: 2 years ago
Posts: 19
 

I will let you know. I haven’t had a chance to hook it to the shield. Thanks for the help. 


   
ReplyQuote
Page 3 / 3