Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

OUT command - turning LED's on/off with the board

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
10 postsPage 1 of 1
10 postsPage 1 of 1

OUT command - turning LED's on/off with the board

Post by dcalkins » Sun Aug 10, 2008 9:55 pm

Post by dcalkins
Sun Aug 10, 2008 9:55 pm

Huh. So the board is supposed to do someting it's not.

I want to control a secondary controller with the MR-C3024. Normally, the analog (right side) pins should go high (+5V) with the IN command (pg 48 of the robobasic manual):

"Send a signal from the controller through a port. When sending a 0 (LOW) value, a 0V signal will be output. When sending a 1 (HIGH) value, a +5V signal will be output. Numerals (0 or 1), constants, and variables can be used for the [output value]. Bit settings can be used for the [output value] because only a 0 or 1 is available in the output port."

e.g.:

OUT 3, 1 'Turn on LED

I've tried this, on all 8 pins, and cannot* get any VDC from the pins. Interestingly, I do get +VDC when the gyro is turned on (if you hook up an LED to any pn and it's high, the LED should turn on - it does turn on if hooked up to pin 0 or 4 with a gyroset command active...)

ANyone have any experience with this? If I can get any current out o fthe pin, I can turn an L293 on and off to controll other stuff, but so far, no luck getting the LED to turn on - multi-meter confirms pin is always low... The normal LED port for the visor won't work, ad I need multiple pins. I don't want to use a PWM pin set as that would require an ESC of some sort.

Thoughts?
Huh. So the board is supposed to do someting it's not.

I want to control a secondary controller with the MR-C3024. Normally, the analog (right side) pins should go high (+5V) with the IN command (pg 48 of the robobasic manual):

"Send a signal from the controller through a port. When sending a 0 (LOW) value, a 0V signal will be output. When sending a 1 (HIGH) value, a +5V signal will be output. Numerals (0 or 1), constants, and variables can be used for the [output value]. Bit settings can be used for the [output value] because only a 0 or 1 is available in the output port."

e.g.:

OUT 3, 1 'Turn on LED

I've tried this, on all 8 pins, and cannot* get any VDC from the pins. Interestingly, I do get +VDC when the gyro is turned on (if you hook up an LED to any pn and it's high, the LED should turn on - it does turn on if hooked up to pin 0 or 4 with a gyroset command active...)

ANyone have any experience with this? If I can get any current out o fthe pin, I can turn an L293 on and off to controll other stuff, but so far, no luck getting the LED to turn on - multi-meter confirms pin is always low... The normal LED port for the visor won't work, ad I need multiple pins. I don't want to use a PWM pin set as that would require an ESC of some sort.

Thoughts?
dcalkins
Newbie
Newbie
User avatar
Posts: 2
Joined: Mon Apr 18, 2005 1:00 am

Post by robots42 » Sun Aug 10, 2008 11:15 pm

Post by robots42
Sun Aug 10, 2008 11:15 pm

This is because the manual is misleading.
IN(0) - IN(7) refer to the AD ports at the top right of the board.
These are Digital I/O ports 32-39

The IN and OUT refer to any of the digital ports

so to set AD(0) pin high do OUT 32,1

OUT 3,1 is Digital I/O port 3 which is the left hip forward/backward, G6A,3

Instead of using the AD ports you could use Digital I/O ports 9,10,11 which are on the left hand side top connector, ie G6B 4,5,6
ie
OUT 9,1
OUT 10,1
OUT 11,1

or use the same three spare pins on the Right hand side but these are hidden by servo cables.
David
This is because the manual is misleading.
IN(0) - IN(7) refer to the AD ports at the top right of the board.
These are Digital I/O ports 32-39

The IN and OUT refer to any of the digital ports

so to set AD(0) pin high do OUT 32,1

OUT 3,1 is Digital I/O port 3 which is the left hip forward/backward, G6A,3

Instead of using the AD ports you could use Digital I/O ports 9,10,11 which are on the left hand side top connector, ie G6B 4,5,6
ie
OUT 9,1
OUT 10,1
OUT 11,1

or use the same three spare pins on the Right hand side but these are hidden by servo cables.
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by robots42 » Sun Aug 10, 2008 11:25 pm

Post by robots42
Sun Aug 10, 2008 11:25 pm

oops
I meant
AD(0) - AD(7) refer to the AD ports at the top right of the board.

IN() has the same numbering as OUT
David
oops
I meant
AD(0) - AD(7) refer to the AD ports at the top right of the board.

IN() has the same numbering as OUT
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by Gort » Sun Apr 12, 2009 3:26 pm

Post by Gort
Sun Apr 12, 2009 3:26 pm

I hooked up a laser that I got through Trossen robotics. The interesting thing that I noticed was that the laser was always on. So at the beginning of the program I added this line OUT 32, 0. Then when I wanted to turn the Laser on I did an OUT 32, 1. It did the opposite of what I thought. The laser stayed on and turned off when I wanted it to turn on? So I changed the first command to OUT 32, 1 and the second one to OUT 32, 0. As you can see in the video it works now.

phpBB [media]
I hooked up a laser that I got through Trossen robotics. The interesting thing that I noticed was that the laser was always on. So at the beginning of the program I added this line OUT 32, 0. Then when I wanted to turn the Laser on I did an OUT 32, 1. It did the opposite of what I thought. The laser stayed on and turned off when I wanted it to turn on? So I changed the first command to OUT 32, 1 and the second one to OUT 32, 0. As you can see in the video it works now.

phpBB [media]
Gort
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by Gort » Sun Apr 12, 2009 6:05 pm

Post by Gort
Sun Apr 12, 2009 6:05 pm

I hooked up the laser to port 11 which is a servo port. The laser is always on which is similar to the above problem. I can turn it off by doing an OUT 11, 1. The problem I am having is that I cannot find a way to turn power off to the port at the beginning of the program. The idea is to only turn on the laser when I want it on not to have it on all of the time. If I can use a servo port that would be better than using one of the AD ports.
I hooked up the laser to port 11 which is a servo port. The laser is always on which is similar to the above problem. I can turn it off by doing an OUT 11, 1. The problem I am having is that I cannot find a way to turn power off to the port at the beginning of the program. The idea is to only turn on the laser when I want it on not to have it on all of the time. If I can use a servo port that would be better than using one of the AD ports.
Gort
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

leds on rn-1

Post by engineer » Sat Jun 06, 2009 7:48 pm

Post by engineer
Sat Jun 06, 2009 7:48 pm

Hi Gort, I think you could turn the lasar off in the template by inserting motor off in the first line where the servos are set for stand up.
Hi Gort, I think you could turn the lasar off in the template by inserting motor off in the first line where the servos are set for stand up.
engineer
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 129
Joined: Wed Aug 09, 2006 1:00 am
Location: northern california

turning led's on with the board

Post by engineer » Mon Jun 15, 2009 9:20 pm

Post by engineer
Mon Jun 15, 2009 9:20 pm

iBot and I worked out that

FPWM 0,1,254
'turns on +5v @ pwm0 & pwm1
'using - on the -|<-470 ohm- pwm0 - for red
'and -------------|<-370 ohm-pwm1 -for green ( dim green)
'change to ------|<-220 ohm-pwm1 -for green evens the brightness out
lets me use the pwm outputs to vary my tricolor led's
FPWM 0,1,0
'turns them off
It just doesn't work on Boomers laser correctly because the laser is looking for a off trigger which we didn't,okay iBot, figure out before I left.
They, iBot & GORT, did, it only needed to be inverted.
iBot and I worked out that

FPWM 0,1,254
'turns on +5v @ pwm0 & pwm1
'using - on the -|<-470 ohm- pwm0 - for red
'and -------------|<-370 ohm-pwm1 -for green ( dim green)
'change to ------|<-220 ohm-pwm1 -for green evens the brightness out
lets me use the pwm outputs to vary my tricolor led's
FPWM 0,1,0
'turns them off
It just doesn't work on Boomers laser correctly because the laser is looking for a off trigger which we didn't,okay iBot, figure out before I left.
They, iBot & GORT, did, it only needed to be inverted.
Last edited by engineer on Tue Jun 23, 2009 5:14 am, edited 1 time in total.
engineer
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 129
Joined: Wed Aug 09, 2006 1:00 am
Location: northern california

Post by i-Bot » Tue Jun 16, 2009 2:26 am

Post by i-Bot
Tue Jun 16, 2009 2:26 am

It should be OK to use the OUT command too. I will figure out the port numbers and test when I get home (Wednesday).

For Boomers laser. It does work, but the control is inverted because the the laser uses a high side PNP transistor as a switch. Before any FPWM or out is sent then the PWM output floats high, so the laser is off. When the FWM is set to 0 then the laser will be on, and when set to 255 then it will be off after that. Taking the power from the servo port for the laser is OK, because there is a regulator on his board.
It should be OK to use the OUT command too. I will figure out the port numbers and test when I get home (Wednesday).

For Boomers laser. It does work, but the control is inverted because the the laser uses a high side PNP transistor as a switch. Before any FPWM or out is sent then the PWM output floats high, so the laser is off. When the FWM is set to 0 then the laser will be on, and when set to 255 then it will be off after that. Taking the power from the servo port for the laser is OK, because there is a regulator on his board.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by i-Bot » Fri Jun 19, 2009 4:15 am

Post by i-Bot
Fri Jun 19, 2009 4:15 am

Sorry for the delay, I got a bit jet lagged coming home. I guess it being 4AM now means it aint quite fixed yet !

Any way, I rechecked the configuration and tested it here.

Are you still having problems ?, I am hoping it is a wiring mistake.

To recap, the dual colour LED is in common cathode (ground) configuration, so we run the common lead of the LEDs to ground (outside pins on board). The anodes of the red and green run through resistors to the PWM pins on the board(use pins nearest centre of board. The +5V of the PWM port (centre pin) is not used. The resistor should be of a value to limit the current from the pin to less than the maximum of 20mA. You may need different values for the red and green LED due to their different voltage drop and efficiency


The following RoboBasic code should turn the LED alternatively on and off. Ports are 46 and 47 decimal.

Code: Select all
' Test LED on PWM pins
lable:
OUT 46,0
OUT 47,1
DELAY 1000
OUT 46, 1
OUT 47, 0
DELAY 1000
GOTO lable


The following code uses the PWM to change the intensity.


Code: Select all
' Test for using FPWM to control LED on PWM ports
lable:
DIM i AS BYTE
DIM j AS BYTE

FOR i= 0 TO 255
j = 256 -i
FPWM 0,1,i
FPWM 1,1,j
DELAY 5
NEXT i

FOR i= 0 TO 255
j = 256 -i
FPWM 0,1,j
FPWM 1,1,i
DELAY 5
NEXT i

GOTO lable


When we run Gorts Laser sight (Trossen/Sparkfun) , this has its own power supply and a logic controlled switch. For this we power the laser from the battery rail to conserve power on the 5V rail. The ttl control goes to the PWM pin nearest the centre of the board. Ground for the laser module can come from any outside ground pin. The transistor switch does invert the output, OUT, 46,0 will be on and OUT 46,1 will be off.

For the pellet gun some external circuit will be needed. First since the gun is motor based, we need a diode across it to protect the circuit. Since the gun is best at battery voltage, the + end of the motor should go the the battery rail. The negative end should connect through an NPN transistor or N channel FET to ground. The base of this transistor should connect to the PWM pin through a resistor. You may also need a resistor to ground to prevent the gun from running before you are ready. Again the control will be inverted. Let me know if you want me to make a schemaitic and test it. would love a gun to do this, but can try with any motor.

Post some video when it working.
Sorry for the delay, I got a bit jet lagged coming home. I guess it being 4AM now means it aint quite fixed yet !

Any way, I rechecked the configuration and tested it here.

Are you still having problems ?, I am hoping it is a wiring mistake.

To recap, the dual colour LED is in common cathode (ground) configuration, so we run the common lead of the LEDs to ground (outside pins on board). The anodes of the red and green run through resistors to the PWM pins on the board(use pins nearest centre of board. The +5V of the PWM port (centre pin) is not used. The resistor should be of a value to limit the current from the pin to less than the maximum of 20mA. You may need different values for the red and green LED due to their different voltage drop and efficiency


The following RoboBasic code should turn the LED alternatively on and off. Ports are 46 and 47 decimal.

Code: Select all
' Test LED on PWM pins
lable:
OUT 46,0
OUT 47,1
DELAY 1000
OUT 46, 1
OUT 47, 0
DELAY 1000
GOTO lable


The following code uses the PWM to change the intensity.


Code: Select all
' Test for using FPWM to control LED on PWM ports
lable:
DIM i AS BYTE
DIM j AS BYTE

FOR i= 0 TO 255
j = 256 -i
FPWM 0,1,i
FPWM 1,1,j
DELAY 5
NEXT i

FOR i= 0 TO 255
j = 256 -i
FPWM 0,1,j
FPWM 1,1,i
DELAY 5
NEXT i

GOTO lable


When we run Gorts Laser sight (Trossen/Sparkfun) , this has its own power supply and a logic controlled switch. For this we power the laser from the battery rail to conserve power on the 5V rail. The ttl control goes to the PWM pin nearest the centre of the board. Ground for the laser module can come from any outside ground pin. The transistor switch does invert the output, OUT, 46,0 will be on and OUT 46,1 will be off.

For the pellet gun some external circuit will be needed. First since the gun is motor based, we need a diode across it to protect the circuit. Since the gun is best at battery voltage, the + end of the motor should go the the battery rail. The negative end should connect through an NPN transistor or N channel FET to ground. The base of this transistor should connect to the PWM pin through a resistor. You may also need a resistor to ground to prevent the gun from running before you are ready. Again the control will be inverted. Let me know if you want me to make a schemaitic and test it. would love a gun to do this, but can try with any motor.

Post some video when it working.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

led's

Post by engineer » Sat Jun 20, 2009 1:03 am

Post by engineer
Sat Jun 20, 2009 1:03 am

PM me your snail mail address and one will be on the way!!~!
OK!!! I'm using OUT 46, 250 to turn on the green, OUT 47, 250 for the red,works good, I'll have to learn how to post a vid.and reedit this with pics
PM me your snail mail address and one will be on the way!!~!
OK!!! I'm using OUT 46, 250 to turn on the green, OUT 47, 250 for the red,works good, I'll have to learn how to post a vid.and reedit this with pics
engineer
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 129
Joined: Wed Aug 09, 2006 1:00 am
Location: northern california


10 postsPage 1 of 1
10 postsPage 1 of 1