[blockquote]jean-christian rey said:
hello
what is the best tablette to use sbrick ?
[/blockquote]
As Android and Windows are still beta I think the answer is for the moment iPad 2 min
(https://social.sbrick.com/wiki/view/pageId/12/slug/application-device-compatibility)
Last time I used Matlab was some 20 years ago at college so can't help you.
Raspberry Pi Foundation has made an agreement with Wolfram Mathematica so it is available (I think) free for use with the Pi and there are people using it with the PiCam or common USB webcams. And Raspberry Pi can talk with the SBrick, I had already done it. But is linux-based and I understand that is difficult to start with.
Good luck for your project, keep us informed of your progress.
If you are considering Linux you may also consider some open source alternatives to Matlab like GNU Octave and a few others: http://www.linuxbsdos.com/2013/07/14/2-free-software-alternatives-to-matlab/
GNU Octave claims "The Octave language is quite similar to Matlab so that most programs are easily portable." But I don't know if it can answer your image capture and processing needs.
If your goal is specifically multi train controlling there are other less computer demanding options (i'm beggining a simple Mindstorms EV3 setup with RFID sensors before switching tracks and RFID tags in the trains but others are using reed switches or hall effect sensors in hot spots of the track path and magnets in the trains, color sensors, etc)
Hi Charles.
You are using Windows, right? I've been using Linux but this week I joined the Dark Side for a moment. I plugged my USB BT4.0 dongle in a Windows 7 laptop, it recognized it and promptly installed several drivers from Windows Update. After that I had several virtual devices, including 3 virtual COM ports. But I don't know how to talk with SBrick through those COM ports (if possiible at all).
ButMatlab supports calling external (shell) commands: http://blogs.mathworks.com/community/2010/05/17/calling-shell-commands-from-matlab/
In Linux, you could use this to invoke the gatttool command (or better invoke some shell scripts that use the gatttool command) to achieve what you want. But in Windows there is no gatttool so you will need to access the SBrick with .Net. Can't help you on that but there is someone in the forums who created a Windows Mobile app, perhaps he can help you.
There are also two possibilities: invoking Python from Matlab and invoking Matlab from Python: http://www.mathworks.com/help/matlab/getting-started_buik_wp-3.html As there is some progress in creating python libraries for BLE, you might try investigate this.
Or wait for Vengit to release a SDK for Windows.
(Tamás was faster)
You can use the old 9V battery box. You just need a Power Functions extension cord. You can even use just the light grey plug, not the whole cable - you plug the light grey plug on top of the 9V battery box and the SBrick on top of it.
You can use it only in one way - the 2 studs side of the plug to the inside the battery box and the cable side of plug to the outside.
NO.
SBrick does not have reverse polarity protection in general. It doesn't even have full short-circuit protection.
SBrick was built to be used with LEGO's Power Functions devices. An SBrick, a PF battery box and a number of motors together as a system IS short-circuit protected (because the battery box provides the protection), and is impossible to connect in reverse. This is why we omitted reverse polarity and short-circuit protection between the ground (GND) and power (VBAT) pins.
If you look at a PF connector (or the SBrick) from above, you can see four pins. The lower left (LL) is the ground, the upper-right (UR) is the VBAT pin. The upper-left (UL) is the "C1", the lower-right (LR) is the "C2" pins.
So starting from down and left, counter-clockwise:
LL - GND
LR - C2
UR - VBAT
UL - C1
On the PCB (printed circuit board) all GND pins are connected with a solid sheet of copper, so as VBAT pins. In this regard, SBrick is nothing more than power strip with one input and four output connectors. Just sheets of metal.
On this metal sits the electronics that takes the power from the GND / VBAT lines. It does not protected against reverse polarity, since the PF connectors cannot be reversed by accident (and it is also arguably challenging to do so by force), and LEGO batteries and power supplies can NEVER reverse these lines. These lines are only for power. IR receivers and servo motors get their power from here for example.
However there IS short-circuit and quite intelligent overcurrent protection between the OUTPUT C1 / C2 pins. These are the pins PF motors are drawing their power, and the servo motor gets the SIGNAL in the form of different voltage levels. Actually even in the case of PF (non-servo) motors these lines serve a dual purpose of being POWER and SIGNAL sources at the same time: larger voltage means higher RPM and/or torque, reversed voltage means a different direction.
SBrick too can get power from the INPUT C1 and C2 pins. Since these pins are easy to reverse literraly by the flip of a switch, between INPUT C1 and C2 pins there IS a reverse-polarity protection, but there is NO diode bridge. Because of this SBrick DO WORK with old 9V battery boxes and train power supplies, but ONLY in one direction, meaning that you can only use your SBrick with these if their switch is at the right (as the opposite of wrong) direction.
So:
All of the above are a result of conscious decisions.
Omitting general reverse-polarity protection allows SBrick to handle giant currents. To deliver 3 amperes per channel you need to take semiconductor our of the way. For that, you need copper. Lots of it.
The same copper can take the heat away from the chips. Of course, the heat has few places to go inside a plastic box that starts to do funny things above about 80-90°C. Even if the heat cannot be taken away, it will be transferred under and eventually into the BLE module, where the temperature can be monitored, and (a tunable) temeprature lock could shut the device down if things would go awry. (Since this feature is not implemented in the factory firmware, you will need to perform an OTA when the 4.2 firmware gets released.)
So while dropping overcurrent and reverse polarity protection on GND and VBAT does not affect normal use, it has certain benefits for power users.
If you start using different batteries and motors, you are considered to be a power user, a person who their stuff, and can be careful enough not to wire up a connector in reverse AND plug it in without testing it twice. In return you get amps and some nice fetures to keep them in line.
Can I use the old 9 volt battery box to power my SBrick? Does SBrick care about polarity or just the voltage difference accross the terminals on the bottom of the brick right? Operation between 0 and minus 9v is same as operation between 0 and plus 9v is same but the motors rotate different directions right?
Hello folks,
the PWM frequency change has been implemented and tested. Expect a demo video soon ;)
[blockquote]Tamás Fábián said:
First of all, there's no need to worry.
Both the SBrick and the IR receiver drives the motors with PWM or Pulse Width Modulated voltage.
Both devices work by turning the voltage on and off once in about every thousandth of a second, so in each cycle the motor is on for some time, and off for some. The more the motor is on, the more torque and power it can deliver.
Certain parts of a motor can vibrate, and give off a tweeting sound that is the loudest when the motor is driven with 50% duty cycle e.g. it is on for 50% of the time.
We did our best to support LEGO's M motor, and we did great, since we can drive more M motors per channel than the IR can, and the overall current carrying capacity of the SBrick is much higher than the same figure in case of the IR receiver.
This alsomeans that SBrick might turn on the motors more quickly than the IR recever, and therefore the noise might me louder.
Moreover, the IR receiver only applies PWM duty cycles other than 0 and 100% (where there's no noise, but this is the case with SBrick too) if you use it with a 8879 remote.
Additionally, SBrick can utilize 255 PWM levels. The first 20-30 levels are not really useful with PF motors, since they won't even start. At these levels, there is no motor noise to cover the beeping. Once the motors are running at a reasonable rate, their noise usually masks the tweeting.
If you're really annoyed by the noise, I can do a few experiments to either lower the PWM frequency (lower sounds are harder to radiate, and are masked better by the motors), or increase it (with a bit of luck, above the ~20 KHz limit of the human ear). Since this can affect power efficiency (higher the frequency, higher the switching loss, there's more heat), such parameter should be allow tweaking (let the user to override it).
(Hm, I've looked at the code, and the lowest frequency is about 490Hz, the highest is well above 100KHz. DRV8833's rise and fall time is 160 & 180ns, so it might be able to work at that frequency.)
[/blockquote]
This alsomeans that SBrick might turn on the motors more quickly than the IR recever, and therefore the noise might me louder.
Moreover, the IR receiver only applies PWM duty cycles other than 0 and 100% (where there's no noise, but this is the case with SBrick too) if you use it with a 8879 remote.
Additionally, SBrick can utilize 255 PWM levels. The first 20-30 levels are not really useful with PF motors, since they won't even start. At these levels, there is no motor noise to cover the beeping. Once the motors are running at a reasonable rate, their noise usually masks the tweeting.
If you're really annoyed by the noise, I can do a few experiments to either lower the PWM frequency (lower sounds are harder to radiate, and are masked better by the motors), or increase it (with a bit of luck, above the ~20 KHz limit of the human ear). Since this can affect power efficiency (higher the frequency, higher the switching loss, there's more heat), such parameter should be allow tweaking (let the user to override it).
(Hm, I've looked at the code, and the lowest frequency is about 490Hz, the highest is well above 100KHz. DRV8833's rise and fall time is 160 & 180ns, so it might be able to work at that frequency.)
[/blockquote] Hi If a silent sBrick is possible I'd be happy. It is somewhat annoying tho hear all the current noise. Especially when multiple engines run at the same time. Just done my Excavator and when it drives an turns upper part and crane arm it sounds more like a space thing rather than an excavator. However I like the idea of sound control. That would be a great next product: a controlable LEGO loke loudspeaker giving the "s" a whole new meaning.Thank you Jorge for the additional Info.
Great thing you do all these Tests and electrical measurements so that we others can benefit from your knowledge.
I really appreciate your help.
For now I´m fine with the Information I received from you guys, thanks forum community.