Quantcast
Channel: bits and pieces
Viewing all 48 articles
Browse latest View live

RC Mini Quad part 2

$
0
0

The end result with the Skyzone SKY02 3D camera, 2 channel video transmitter, FrSky D4R-II receiver and Turnigy nano-tech 2200mAh 25-50C .

Tarot mini (TL250A) -17

Tarot-mini-motor-wiresForgot that the KISS ESC do not have a BEC output, solved it with a Traco Power dc/dc converter. The ESC are fitted on top instead of underneath the arm as i could not route the motor wire through the tiny hole. Also the stress on the actual motor wires due the sharp bent made me decide to place it on top.

Moved the FrSky D4R-II receiver to the front for more optimal routing of the antennas. That is, perpendicular of each other. The antennas are tapped on the landing skid. Found out (not the hard way) that the receiver minus was not connected to the battery minus on the pcb. Scrapped off the solder mask from one of the battery minus pcb track, soldered a wire on it and joined it to the ESC common signal ground.

Notice that in the pictures below, the barometer is blocked by electrical tape which is a bad thing. Corrected this after writing this.

Tarot mini (TL250A) -10 Tarot mini (TL250A) -12 Tarot mini (TL250A) -11 Tarot mini (TL250A) -13

Moved the FrSky D4R-II receiver to the front for more optimal routing of the antennas. That is, perpendicular of each other. The antennas are tapped on the landing skid.

Tarot mini (TL250A) -21 Tarot mini (TL250A) -20Tarot mini (TL250A) -15 Tarot mini (TL250A) -14 Tarot mini (TL250A) -16 Tarot mini (TL250A) -18 Tarot mini (TL250A) -19

Todo add buzzer, connect D4R-II receiver to battery plus and to the FC telemetry porty.  Also drill two holes in the CF front as Tarot forgot to do this. And eventually wrap up the ESC with heat shrink.

All in all, i like very much the end result. In particular how the battery is placed on the frame i.e. flat surface, integrated XT60 connector and the aluminium bars which prevent the battery from ejecting. Cons, the pcb layout was a rush job, the placement and size of the solder pads suck big time.


RC Mini Quad part 3

$
0
0

So eager to take the mini out for a spin that  i discarded odd events. Hence, before applying power to the quad, i disconnected everything but the ESC as there are soldered.

  • Measured 4M ohms between plus and minus. No short circuit. check.
  • Power supply current limited @ 1A and voltage @ 11.7V. check

Applied power to the quad and current limit is activated. Hmm, does the ESC pull that much current?  Bump up the current limit to 3A, again current limit active. Odd,..
I should have stopped here and check everything again but a little devil said: try a lipo…
Oh the smell of burned glass fibre…

What went wrong? I reversed the battery connection on the M4 ESC. The NFET internal diodes conducted, almost short circuiting the lipo. Hence a current flow of at least 100A.

NotSoMAgicSmoke

Good thing i bought two mini… In the mean time i traced out the pcb, below the result.

Tarot mini pcb top  Tarot mini pcb bottom

The blurps below is a mini howto of programming CleanFlight on a Naza32 with stock BaseFlight firmware e.g. v2.2 and run into issues like board not supported and/or after issuing the command “Flash Firmware” CleanFlight reports Failed to open serial port.

  1. Download & install Google Chrome on desktop/laptop PC
  2. Install CleanFlight for the Chrome app store
  3. Download & install the SiLabs CP210x USB to UART Bridge Virtual COM Port (VCP) drivers
  4. Launch CleanFlight – Configurator
  5. Select the Firmware Flasher tab. On this page chose the latest stable firmware e.g. v1.7.2 Naze 2015-2-18 0:27 (stable), tick Full Chip Erase and click on the button Load Firmware (Online). The release info should appear now. Scroll down to make the Flash Firmware button visible.
  6. Take off all external wiring e.g. ESC, receiver, battery from the Naze32 board.
  7. Use a standard usb micro cable to connect the Naze32 to the pc/laptop. In the upper left corner of FreeFlight, the box with No Ports should change to COMx where x is number. Notice that the app is still not connected i.e. red box with Connect.
  8. Now select the Flash Firmware button. Scroll up to the top to see the status of the action.
    • scenario 1:  progression bar followed by Programming: SUCCESSFUL then you done.
    • scenario 2: status bar shows Failed to open serial port. Now disconnect the Naze32 board by taking off the usb cable and connect the Naze32 by inserting the usb cable. Repeat step #8.
  9. Switch to the Welcome tab and click on the red box with Connect, Your now ready to configure the board.

CleanFlight-ConfiguratorSome CLI settings

  • SET LOOPTIME = 2500  // about 400Hz update rate (max)
  • SET ACC_LPF_FACTOR = 100
  • FEATURE RX_PPM  // for receivers with PPM output i.e. one signal wire.
  • FEATURE FAILSAFE
  • FEATURE MOTOR_STOP  // zero throttle is motors stop, no spinning on arming.
  • SET DISARM_KILL_SWITCH = 1 // use receiver switch to arm/disarm instead of yaw stick.
  • SET ALIGN_BOARD_YAW=90  // board orientation with usb port on the left side & arrow on the pcb points to the right side.

Windows 7 Backup & Restore

$
0
0

Many Windows users are (or should be) familiar with the Windows 7 backup & restore to create a system image of the entire pc/laptop.  The system image is an exact duplicate of the hard drive and is saved in virtual hard drive (VHD) format. Hence, with a VHD one can restore the pc/laptop to the same state when it was made.

An other use of backup & restore is to restore the VHD to a new larger hard disk (or SSD nowadays) due to running out of space on the current system drive. Note that the restored image is the same size as the original disk. One has to extend the system partition to the full size of the new drive afterwards with the help of Disk Management in the Computer Management console. That is, right click on the system partition and choose extend. The nice thing of this all – it free / gratis! :-) So there is absolute no need to purchase any of the disk cloning tools from e.g. Paragon or Norton.

I was attempting to upgrade the system hard drive (C:\) of an rig which does not have a CD/DVD drive.  The idea was to create a System Image on different hard drive, swap the system drive on the machine, then restore the image to it.  To this end, created an boot-able recovery usb drive. The machine booted fine from the stick, but the recovery process hanged with the error:

Error: The parameter is incorrect
Code: 0x80070057

WTF, which parameter?  Can it be a little bit more specific then this general error message. Anyhow, the fix/trick is to remove the usb drive when the Finish button is visible which is just before the final confirming step of the restore. That is, when the message ‘Are you sure you want to continue?’ appears. Btw the new hard drive was pre-formatted with NTFS.

Why is it so difficult to upgrade the hard drive? On any *nix systems this is so easy to do. Hence, can’t imagine it is a technical issue.

What is the point of backing up an system when one cannot restore it?
Below are two methods to aid in the restore or new installation of Windows 7 from a usb drive.

Make an bootable USB drive with the contents of an Windows installation DVD (optional)

This operation assumes your machine can boot from a USB device. Check the BIOS to make sure. Also necessary is the Windows DVD to install the content from the DVD to a USB drive.

Insert an sizeable USB drive e.g. 4GB for Win7 Ultimate x64, which will be wiped, Please note that commands below assumes that the USB drive is Disk 1 which is listed by list disk.

Type at the command prompt:

diskpart
list disk
select disk 1
clean
create partition primary
select partition 1
active
format fs=fat32 quick
assign
exit

At this point the USB drive is formatted and boot-able.

The final step is to copy the installation files to the USB drive. Please note D: is the drive letter for the DVD files. And E: is the drive letter for the usb drive.

Type at the command prompt:

xcopy d:\*.* /s/e/f e:\

Done!

Create an boot-able system repair USB drive for Win7

Follow the above steps, minus the xcope command, USB drive size needs to be at least 165MB. Make hidden files, folders and drives viewable by checking this in Folder Options – Search > View tab. Next uncheck in this tab the ‘hide extensions for files…’ and ‘Hide protected files…’. Please note E: is the drive letter for the USB drive.

Type at the command prompt (including the dots!):

cd Desktop
mkdir 2usbhd
cd 2usbhd
mkdir sources
mkdir boot
copy c:\Windows\Boot\PCAT\bootmgr .
cd boot
copy c:\Windows\Boot\DVD\PCAT\boot.sdi .
copy c:\Windows\Boot\DVD\PCAT\BCD .
copy c:\Windows\Boot\DVD\PCAT\en-US\bootfix.bin .
cd ..\source
copy c:\Recovery\486aab42-cf02-11de-be22-c44fb1debe9d\winre.wim
cd ..\..
xcopy 2usbhd\*.* /s/e/f e:\
e:\
ren boot\BCD bcd
ren sources\winre.win boot.wim

Done!

Note1 the bold printed command will probably fail due to insufficient rights. Take ownership of this folder and give yourself full access.

Note2 the language i.e. en-US, change this to whatever language the installation has been done. Thus change en-US to nl-NL if the installation was in Dutch or de-DE for German.

Note3 one could dump the commands in a batch file if one knows the language.

Assault Reaper 500 (Full collective pitch 3D quadcopter)

$
0
0

Some people say the HobbyKing Assault Reaper 500 is an rip-off of the Curtis Youngblood Stingray (the WLtoys V383 500 is a clone). How different can one make a H-type quadcopter when the basic components are the same?

CY Stingray Assult Reaper 1

Anyway, i always wanted to fly an 450 sized CP heli and the RTF kit had a reasonably price tag of €450. And HobbyKing has actually spare parts! I won’t use the Orange DSM2 Tx & Rx and  the pocket rocket 6S charger.

Assult Reaper rtf Assult Reaper 2  Assult Reaper 4  Assult Reaper 5

The Assault Reaper manual is good but the electronic parts e.g. the BLDC motor specs are missing. Why omit the specs? The Stingray uses a 3000kV motor, a gear ratio of 14T:42T (1:3) and a 4S lipo. Hence prop spins at 16800RPM (16.8Vx3000/3).  The Reaper motor seems to be 1100kV (gear ratio 14T:90T). ESC is rate at 60A and the included lipo is a 6S 1550mAh 130C !

Assult Reaper500 BESC 4-6S 60A Assult Reaper500 BLmotor 1100kV 2922 Assault Reaper 500 FC Assult Reaper500 servo-mg

Did some low flying (just above the ground effect) and this flies very different but love it. Need to practice so some more with AeroSIM RC. before i wreck this heli. Update, the pc simulator sucks big time, their is only one real heli model and the ‘smart’ camera pov changes with distances which makes it real hard to practice moves other than tail-in e.g. nose-in. Perhaps Real flight v7.5 does a better job.

Z1-Proud 3-axis GoPro handheld Gimbal

$
0
0

All current two and three axis gimbals i own are only suited to be fitted onto a rc-model. And all of these lack a quick removal, robust electronics housing and batteries. The Z1-Proud 3-axis handheld gimbal does not have the mentioned drawbacks and can be operated by remote control.

Z1-Proud -1 Z1-Proud -4 Z1-Proud -3 Z1-Proud -5

Clean looks due to the leads are inside the housing, except for the power lead for the GoPro.

Z1-Proud -2

The tube diameter is 25mm. The additional remote control is connected to usb port, with some modification it can be controlled by an flight control board e.g. PixHawk.

Z1-Proud -6

  • Press the lock key once for lock mode, up/down keys adjust pitch.
  • Press the lock key once for follow heading mode, up/down keys adjust pitch.
  • Press the lock key twice for following heading & pitch mode, up/down keys adjust roll.
  • Press and hold the lock key to toggle between standby and on.

 

remoteback USB-connection

S2=up (1.686V), S1=down (2.244V), S3=lock (1.518V). no key press=3.365V.
Odd thing is that the main unit does not supply power when the pcb is not connected. hmm….

After a few weeks, the gimbal did not track accurately the movement, so i had to recalibrate the gyros with gimbal software tools. Instructions are in the Z1-Proud Manual. Similair gimbals e.g. Tarot and AlexMos / SimpleBGC did not have this.

HobbyKing Y3 Tricopter

$
0
0

Mini’s are nice, incredibly fast but i miss the flight behaviour of a tricopter. Time to dust off the HK Y-3 Tri-copter. Replaced the old KK FC for the Naze32 arco with baseflight. No cleanflight this time, for some reason unknown i cannot get the PID control selection right. It is hard to find the correct info, even something simple as how to hook the servo and the esc’s.

Naze32 Tricopter connections Tr-copter

The rotation of motor #3 is cw instead of ccw to counter the inherent ccw yaw (not standard). A few old build pics are below.

Turnigy-Tricopter6 Turnigy-Tricopter5 Turnigy-Tricopter4

I changed the fc deck i.e. cut the horizontal strut, epoxyed carbon fibre struts to hold the deck in place. The battery is now easy accessible after releasing the Velcro and removing the fc deck.

Turnigy-Tricopter2 Turnigy-Tricopter3 Turnigy-Tricopter7 Turnigy-Tricopter9

Still need to add some leds and FPV.

Turnigy-Tricopter1 Turnigy-Tricopter

It is amazing how locked in the tri-copter is with the Naze32 after a few PID tweaking.

TILT Racing Drone

$
0
0

The TILT Racing Drone is a ‘thought of everything’ open-source 3D printed FPV multirotor racing quad (or Octa). Unlike traditional frames that tilt the whole body to acquire forward and lateral velocity, rotating the arms provides greater performance. So less mass to move to acquire forward velocity – higher acceleration, better aerodynamics resulting in a higher top speed. Claims to do over 110km/h and accelerates from 0 to 100km/h in 3.7 seconds, that is fast! The bonus is that camera is looking forward instead of the ground.

TILT Racing Drone TILT Racing Drone wireframe

It is 330 sized quad with up 7″ props and a battery tray that avoids continuous CoG balance every time you change the battery, even if they are different. The FC can be anything which can run CleanFlight e.g. Naze32. Pre-ordered one immediately…

OverLord 3D Printer

$
0
0

At last the OverLord Pro 3D Printer by DreamMaker has arrived! This may sound negative, but the delay is actually one month. Still six month is a long time. The delay came from the lipo battery (banned air freight) and the possibility of having a laser head (customs). This 3D printer is similar to  the BerryBot3D, the mother of delta 3D printers, with a delta mechanism which has a proven record of being highly efficient and economic, requires no long-term maintenance, and is elegant in motion.

OverLord-ks OverLord-ks-Specs

The  fully assembled OverLord Pro cost me €421 excluding €180 (DHL) and €194 (customs).

OverLord-ks-comparison OverLord-ks-stretch OverLord-ks-MultiColor OverLord-ks-colors

OverLord-ks-PowerProtection OverLord-ks-BreakResume OverLord-ks-AutoCalibration OverLord-ks-HeatedPlate

OverLord-ks-SmartPrintingAppWhat about the software? Well DreamMaker promised an Smart Printing App for iOS. Lutz Michaelis (R.I.P) wrote about ‘The Element‘ app with support for OverLord made by the Dutch company Printr. Still clueless whether or not this app will be the Smart Printing App. Perhaps FORMIDEOS by Printr or not nothing at all. Anyway, assuming no app will be coming out one has to choose a program (list of 2D/3D CAD apps) to draw, slice and print a model. I choice the free for private use,  Autodesk 360.


OverLord 3D printer part 2

$
0
0

DHL rough handlingFor starters, the parcel has a shock indicator which was red. Not surprised by this as the carrier is DHL. The heated bed and the glass plate where loss inside the box and apart from some scratches everything is fine.

The out-of-the-box experience… The OverLord quick start guide contains a few simple steps. I only had some trouble with the feeder as it would not grab the PLA wire. The trick is that the wire end needs to be a clean cut (sharp) end. The included SD card contains beside Cura (Windows/OSX/Linux) software, OverLord user manual, also three test g-code examples. Selected the test1 file and the print started.

The end result is pretty good! Mind you that i did not use a glue on the glass.

OLP-Flute6 OLP-Flute5 OLP-Flute4 OLP-Flute3 OLP-Flute2 OLP-Flute1

After this, i opened the bottom of the OverLord to see the electronics.

OLP-bottom OLP-drivers OLP-SD shieldOLP-Controller PCB OLP-wire-mess OLP-uC OLP-Mean Well GS220A24-R7B OLP-Li-ion battery OLP-Spare parts

Notice fan and the flatcable…

DreamMaker support is quite responsive and give me  beta firmware which addresses the noise problem. I guess they refer to raw sound (sounds like an belt is slipping) which one can hear occasionally. The firmware update can only be done with Cura v12.08 or V12.11.

OverLord 3D printer part 3

$
0
0

After the initial successful print of the whistle/flute, printing was a nightmare…

Filament feeder, it grabs the filament very poorly also due to the inlet tubing which does not align the filament in-line with the cog. On the second print, it stopped feeding the filament to the hot-end. The stepper-motor was turning but no feed of the filament. Disassembling the puller/feeder revealed that the cog was spinning freely due to a loss grub screw. The spring loaded idler assembly is a bit wonky, it has very limited range.

OLP-Filament-feeder2 OLP-Filament-feeder3 OLP-Filament-feeder5 OLP-Filament-feeder6 OLP-Filament-feeder7 OLP-Filament-feeder9 OLP-Filament-feeder8

Below two pictures of the filament idler and the cog. Notice that the tops must align perfectly. Search for ‘Bowden Extruder’ if your interested how others implement this. Really nice article of filament drive gear & benchmark.

OLP-Filament-feeder10 OLP-Filament-feeder4

Auto Levelling – it does not work. Sure it does measure eight points and does something but it is not levelling right. One can visually see there is a difference in height. The filament does not touch the glass on front left side. Tried it numerous times, no joy.

Manual levelling – come on, it is BS. Adjusting while it prints (draws) an circle is crazy. If it was like as described in the user manual, it would be useful.

Heated bed is held in position by three screws with springs. Printing objects with a large footprint (RaspberryPi size) and the bed moves around and in mine case, it came loss. Placing the spare rubber feet’s in the holes prevents this. Also blue lock-tight help too.

OLP-HeatedBed-RubberStop2 OLP-HeatedBed-RubberStop1

Sticky glass – hairspray or a glue stick in case of PLA does not work for me. Using the included tape does work but the tape is almost fused with the printed object :-(  Printing a raft hopefully will resolve this.

Observations – The upper colour leds flickers/strobes is a bit annoying. Filament curling on the nozzle/hot-end. The hot-end needs to be very clean, there should be no debris on it otherwise it will curl. Using acetone to clean the nozzle works quite well. Heated bed temperature of 50°C ? Better suited is 60-70°C for PLA and 90°C for ABS.

OverLord owners @ Thingiverse is here. Nice add-on is OctoPrint.

OverLord 3D printer part 4

$
0
0

OLP-Filament-feeder axleAfter a few test the filament feeder stopped again with feeding and made some horrible sounds. Looking at the cog, the issue was clear it was  not aligned with the idler. Disassembled the feeder and saw the problem. The grub screw sits on a slope of the axle just where the flat surface ends. Took a file and extended the flat surface on the axle.

After assembling the feeder, opened the hole in which the spring loaded bolt sits. Without this it close to impossible to install the feeder. See below.

OLP-Filament-feeder-mod1  OLP-Filament-feeder-mod2

OLP-Filament-feeder-mod3Keep the stepper motor wires outside and tug them out of harms way after the feeder has been mounted as there is no room behind the stepper motor.

 

 

Printed  a case for the Red Pitaya which did came out very nice.

OLP printed Red Pitaya case1 OLP printed Red Pitaya case2

Btw. the above was printed with tape on the glass.

Assault Reaper 500 (Full collective pitch 3D quadcopter) part 2

$
0
0

I crashed it in the tail grass. Not sure this was a pilot error or due to a broken belt. At first glance the damage was minor i.e. one broken frame boom (arm). At home, the damage was more severe. The front boom block assembly, 2 frame booms, drive shaft, torque tube, 2 drive belts, main frame plate, canopy and spur gear all needed to be replaced. The FC was also damaged as the battery slammed on it and ripped off the dip switches from the pcb. However a few tags with the solder iron fixed it.

Assault Reaper FC top Assault Reaper FC bottom

Easy fix, just order the parts about €30 and … Damm cannot rebuild it due to the backorder status for months! Goods will arrive within 30 days, Perhaps mine calendar is broke.

HK-backorder

Perhaps i can use some Stingray parts i.e. the motor pulley, the main drive pulley and motor belt.  These parts are quite expensive $44. I would have bought them, despite the fact the pulley OD are not specified, but the curtisyoungbloodhobbies.curtisyoungblood.com store insist that a international phone number is like 99 9999999 ? Don’t take mine money.

Some Assault Reaper 500 vs Stingray dimensions:

  • Motor shaft: 3mm vs 3.17 mm (ND-YM-003)
  • Motor pinion gear: 8mm od
  • Spur gear (90T, 0.5M): 46mm od
  • Drive shaft: 4mm vs 4mm? (ND-YS5-AS4014)

Spare parts, hopeless.

TILT racing drone 2

$
0
0

On a side note, the TILT racing drone is a one of a kind in it’s class. Ali Shanmao also made in the same period an tilting drone (OFM Swift TR260). As the name implies, it is a 260 class quad. Instead of using a complicated belt drive setup, the Swift TR260 uses servo linkages.

Manuals

IMHO a web shop should provide manuals for products which needs assembling and should not stuffed this inside FaceBook. Here are the manuals:

There are two manuals with photo’s of an build. However each step shows a photo of the end result. For example, the build (step #2) of the so called ‘tensors’ aka idlers

TILT tensors build from the manual A few more pictures clarifies a lot. Note i used three washers extra!
TILT tensor 1 TILT tensor 2 TILT tensor 3 TILT tensor 4

When placing the arm support In step #3, place also the two acrylic parts (front and back) and the red pillars. This way the support is stable and prevents the support from an leaning due to the round edge.

TILT arm support  TILT motor mount

Furthermore the build steps skips a lot assembly steps and the build sequence is not logical. Why assembly the arms with motors in step #6 and fitting all four in step #7 when near the end is more logical and brings more build comfort. Skip step #7.

Printed parts

I have the TILT PRO ARF version but was not aware that the  gear platforms where optional :-( .

Every (yes every!) printed part e.g. servo holder, motor mounts needed sanding to make it smooth & level. None of the M3 holes accepted M3 bolts. The servo mount was the worst piece of all and needed to shoehorn the parts. This made the aligned an very difficult task and I doubt this piece would last…

Why did they not made this piece (actually it is made from two pieces) from the same material (HDPE Delrin) as the arm support? Cost or weight? I would pay more for a part which is solid them this printed crap.

Power Distribution Board (PDB)

It is clearly notable that the PDB has gone through many revisions. Still it is not practical as the 5V & 12V BECs are not on the PDB. It would make more sense to exchange the big filter components  for the BECs. The in/out of for the BECs are not silkscreen which make this error prone i.e. releasing the magic smoke. The space reserved for ESC is too small due to the protruding elco on the ESCs.

TILT PDB issues

Instead of relying on the nylon M3 nuts as spacers for the PDB, where the outer ESCs are flapping in the breeze, i used the ESC platform as spacer. Dremmel-ed cavities on places where the pinning and/or solder joints are.

TILT ESC platform dremmel-ed TILT PDB 1TILT PDB 2 TILT PDB 3 with servo assembly

Fitting the belt

Step #15 in the build states the following:

Mark 490 mm span in the belt with a marker leaving similar belt length on both sides. Pass the open belt through the pulleys as shown in the picture.

Check the arms support tensors are loose and on the bottom of their travel range.

Install the belt clamp ‘tightening’ the belt until the 490 mm marks are being nearly covered by the clamp parts.

One could also state

  • Drop the ‘ tensors’  on arm support  on the bottom
  • Place with a sharpy an marker at 490mm belt length
  • Pass the belt through the pulleys as shown in the pictures
  • The marker should align with the other end of the belt
    • If not, move the ‘tensor’ on the servo assembly till it aligns.
    • Note: on mine i could not do this as the belt would touch one of the bolts which holds assembly to the base plate. Therefore i just cut the belt at the marker.
  • Cut the belt at the marker i.e. the belt length equals 490mm
  • Take off an arm from the front (or back) and pull out the axle to free the pulley.
    This will give you a lot slack to do next step…
  • Meet the ends of the belt and place the belt clamps. Be careful don’t over tighten the clamp.
    TILT belt clamp
  • Put the pulley on the belt and re-assemble the front.
  • Put on the top plate and screw it down with all 16 bolts.
    This is an necessity as the base plate will flex inwards while tensioning the belt.
  • Tighten the belt by moving the front & back ‘tensor’ up till there is about 5mm play.

TILT belt 1 TILT belt 2 TILT belt 3 TILT belt 4 TILT belt 5

The battery locking system

TILT battery lockingQuote from the getting started  manual “The battery locking system for perfect weight balancing”. The system is made of four plastic 5mm pillars and a CF plate. At first i was clueless why there was a need for this. Sure it nice to have a battery lock system but how does it work? First i placed an battery on the top plate and strapped it down with Velcro. And there is the issue, the Velcro is very close to the belt. Hence the battery needs to be strapped on the battery plate and this assembly is put over the four stubs. Tighten the four bolts and (to mine surprise) the battery combo won’t move. This is due to the expansion of the nylon pillars by compression. Will it prevent he battery from ejecting during a (high speed) crash?

Read on part 3

Makeblock XY-plotter & laser

$
0
0

Bought four Makeblock items i.e. the XY plotter v2 (€300), Laser Engraver Upgrade Pack (€110), the Linear Motion Guide Module (€130), the DC encoder motor pack (€75) to do some experiments.

Makeblock XY plotter v2 Makeblock laser engraver Makeblock linear guide Makeblock dc encoder motors

Makeblock is by no means cheap, has little to no support (there is a forum), mystifying documentation at best and crappy PC software.  For example, the PC program mDraw to drive the XY plotter with laser is dangerous combo due to the fact it has no fail-safe build-in the hardware nor in the software. Stopping the program while engraving will turn the laser full on. Beside that major flaw, the program ignores all the limit switches.

So why Makeblock? For the mechanical parts which i can obtain at an nearby shop (kiwi-electronics). If your looking for a small laser engraver and/or plotter spend it on Bang Good or DX. Just search for ‘500mW Desktop DIY Violet Laser Engraving Machine’,  cost around $200. Below a few examples.

NE JE1  bg-laser-engraver-cnc benbox-mini-laser-engraver bg-mni-laser-engraver

The included controller is the Me Orion which is an Arduino Uno (ATmega32U4) with integrated DC-motor driver (TB6612FNG) shield (see Me Motor Driver). The stepper motor drivers electronics are on separate boards i.e. the Me Stepper Motor Driver (A4988). Other module can be found here.

Makeblock Baseboard Me Orion  Makeblock Baseboard Me Orion pinning Me-Baseboard-SchematicMakeblock Me Stepper motor driver

Connecting the boards together is done by RJ21 (6 pins) which is at first though nice. But note that the most common similar connection is RJ45 (8 pins). There is no store which carries these type of cables. The RJ45 cables are stiff and is not suitable for moving parts. That is, the plotter wagon drags these all over place and gets eventually stuck on the Me Orion.

The code on Github is a mess and most of it has not been touch (read updated) for over nine months. So instead i am trying to implement GRBL for the ‘Me Orion’. So i can later on use e.g. the GBRL Controller v3 by ZAPMAKER desktop software.

Below is an attempt to engrave on the inside of an tick plexiglas salvage from an LCD panel. Instead, it engraved the bottom of the plexiglas and the wooden floor…

Btw. an 500mW laser can only engrave and will not cut anything besides a sheet of paper. Stronger laser modules can be found Insaneware Deluxe (DE) or DTR’s laser shop.

TILT racing drone 3

$
0
0

Note: Pau moved the documentation over to Github.

I followed the excellent build video’s of the OFM Swift TR260 by AliShanmao which also explains the tilt concept  and mixing in great detail (no secrets here). It is summarized below.

  1. Build vid #7 – Connecting ESCs to CC3D, connecting the CC3D to Receiver
    • Futaba Rx:  AETR1234, Aux1 = Flight mode, Aux2 = Servo, Aux3/48 are not used
    • CC3D inputs: AETR1234, Aux1 = Flight modes, Aux2/3/4 are not used i.e. not connected
  2. Build vid #9 – Programming the Futaba Tx
    • Model: plane – arco
    • Ch5 = SwC (three position switch for selecting Flight modes)
    • Ch6 = DT5 (Trimmer/Dial to set a fixed tilt angle)
    • Mix1: Elevator-to-Flaps (Flaps == Ch6)
      Pmix1
    • Mix2: Elevator-to-Elevator mix
      Pmix2
      Nb ‘Dynamic Rotor Tilting’ works when mix1 & mix2 are on.
  3. Build vid #10 – Programming the OpenPilot CC3D FC
    • Model: Quad-X
    • FMS positions
      OpenPilot FMS Pos
    • Advanced
      OpenPilot Advanced
  4. Build vid #11 – Maiden flight, shows the effects of in-flight rotor tilting

On topic, mine setup is an Taranis transmitter with OpenTx, FrSky D4R receiver coupled to the Naza32 FC by PPM. I would have liked to use the X8R and SBus but could not get it to work with this CleanFlight version. It works okay in v1.9.

PDB – ESC – FC hook up

Naze32 Tricopter / Quad /w TILTThe ESCs & servo connection to the FC is similar to a Tricopter setup (motor #4 is connected to output #6) . The positive servo wire is take out and connected to an UBEC which supplies 5V. The other UBEC, also supplying 5V, is connected to the  positive pin of output #2. Note, the supplied UBECs need to be adjusted with the tiny potmeter on the pcb otherwise the magic smoke will be released. Untrimmed they put out about 10V!

Mine FPV gear runs on 5V so there is no need for a 12V rail. Looking back, the build would have be much easier if i did not installed the 5V & 12V pins on the PDB.

Battery requirement is 4S  (2500-3000 mAh with minimum current draw of 80 A)

CleanFlight TILT version

Don’t try to connect to an brand new Naze32 with CleanFlight as the board has BaseFlight firmware. Start the Tilt CleanFlight app and select ‘Show unstable releases’ and ‘Full chip erase’. Click on ‘load firmware (online)’ and after the download, click on ‘Flash firmware’.

CF 1 firmware CF 2 firmware CF 3 firmware CF 4 firmware

CF 5 CLINext step is to make a connection to the board. Head over to to the CLI tab Instead of configuration tab, For some reason unknown, the CLI wipes the settings in the configuration tab.

Enter ‘set looptime = 2000’, ‘set acc_lpf_factor = 100’ and ‘save’ at the command line.

Why the loop time is set at 2000 instead of selecting OneShot in the configuration is beyond me. That is, the four supplied 2-6S/30A mini ESCs are BLheli Oneshot125 ECSs with “lightly damped” already enabled.

CF 6 config CF 7 rx  CF 8 modes  CF 9 servos

I use Aux3 to switch between fixed tilt (input >= 1500us) and dynamic tilt (input<1500us). Aux1 is used to switch the Flight mode and Aux2 is to (dis-)arm the quad.

CF servo aux3Some ‘Tilt arm’ tab mystery:

  • Why is the ‘servo to arm gear ratio’ set to 0.75? Both pulleys have 18 teeth’s…
  • Why is there an ‘Yaw and roll compensation’? Should this not be ‘Pitch and Roll compensation’ ?

Final note, the save and restore does not save tilt arm settings nor the CLI entered settings.

Maiden flight

Was ready to arm when suddenly the servo started to smoke! Give me a brake with the whole servo assembly. Have enough metal geared servos but (dis)assembly of the craft wears out.

Some pics before the servo gave up.

TILT Drone racer (1) TILT Drone racer (2) TILT Drone racer (3) TILT Drone racer (4) TILT Drone racer (5) TILT Drone racer (6) TILT Drone racer (7) TILT Drone racer (8)

Previous part 2


Asrock Beebox N3150

$
0
0

It was time to decommission the Zotac Pico Pi320.  Needed an box with more beefy specs to run VMware on so i choose the ASRock Beebox N3150  a NUC like box. This box is not crippled by memory as it has dual channel ram.

ASRock-Beebox

  • Intel® Quad-Core Processor N3150 (Up to 2.08 GHz)
  • Microsoft® Windows® 10 32-bit / 10 64-bit / 8.1 64-bit / 7 64-bit compliant
  • Supports DDR3L 1600MHz, 2 x SO-DIMM slots, Max. 16GB
  • Supports 1x mSATA slot & 1x 2.5″ SATA HDD
  • 802.11ac + BT 4.0
  • 3x USB 3.0 (Type A), 1x USB 3.0 (Type C), 1x IR, 1x Audio-out with MIC-In
  • 2x HDMI, 1x DP, 1x GigabitLAN

The Beebox comes with a cdrom (?) with Windows drivers (not Windows 10) on it.

Fitted the Beebox with 16GB ram (Corsair Vengance DDR3L 1600MHz) and an 250GB mSATA SSD (Samsung 850 EVO). Find it still unbelievable that a postage stamp sized memory can hold that much. Btw the N3150 is not fan-less but it practically noiseless.

For kicks, i Installed Ubuntu 15.04 which installed without a hitch. After the initial install and update of the system, the box runs smooth. Debian on the other hand needs to load the Realtek firmwares for Ethernet (RTL8821/8168/8411), Wifi-BT (RTL8821AE) and sound from a separate memory stick during install. Extracted the Debian non-free package (dpkg -x package) and dump it on a empty usb memory stick (Debian-RTL). But after the install, the box hanged on the wired Ethernet and HDMI display.

Dedian way of saying ... oopsAfter the detour, i installed Windows 10 Pro which ups the system price tag at about €578. Everything worked, even sound is played over HDMI. Below the Passmark bench results of the Beebox, Dell E6520 ATG and MSI GS70-2PC-043. The 2D/3D results and in particular the memory results are  very disappointing.

  device-managerPassmark-ASRock Beebox N3150  Passmark Dell E6520  Passmark MSI GS70-2PC-043

Microsoft Wireless Display Adapter

$
0
0

A lot Miracast enabled devices are available when the Wi-Fi Alliance finalized of the Miracast wireless display standard in 2013. It is now possible to wireless mirror the display of an Miracast certified phone, tablet, or laptop to any Miracast certified capable receiver like a TV, projector, or monitor. Note the ‘certified’.

This technology is based on the Wi-Fi Direct standard, which allows for point-to-point connections (video and 5.1 sound) between devices. As the connection uses WPA2 encryption, protected content e.g. Blu-ray and Netflix is allowed to used.

If one believes the Microsoft marketing, casting content to the big screen is now child play.

MWDANormally Microsoft hardware works most of the time right out of the box. Well the Microsoft Wireless Display Adapter (MWDA) is not one of them. All of mine five Windows 10 Pro devices and two Android tables can detect the dammed thing but none can establishing an connection. Seems i bought a €60 HDMI device to display the Windows logo.

Most of the problem solving is written for the Surface Pro and Windows 8.x. Mine boxes seem to have all the required drivers and still no joy.
Note the date of driver…

MWDA-fail2connect MWDA driver
MWDA Setting MWDA connect

Once in a while the following notification appears

MWDA channels MWDA wrong

Below is how Microsoft thinks to resolve the issue by updating the MWDA firmware  (link). Gotcha, you need an connection with MWDA!

If you have trouble connecting your PC to the Wireless Display Adapter

Update Firmware

  1. Open Wireless Display Adapter app from Start Menu -> All Apps -> Microsoft Wireless Display Adapter
  2. Check the Firmware Information on the right side of the page to see if a new Firmware is available for your adapter.
  3. If a new Firmware is available, press/tap the Download Button to download a local copy of new firmware.
  4. Once Firmware download is successful, press/tap the Update Button and keep the app in foreground to complete the Firmware Update to MWDA device.
  5. MWDA restart shall complete the MWDA Firmware Update process.

Reset the Wireless Display Adapter

If you’re having general issues with the adapter or forget your password to modify the Adapter Settings/Update firmware, from the Windows App – resetting the adapter may help. Follow these instructions to reset the Wireless Display Adapter:

  1. Press and hold the Reset button for 10 seconds.
  2. When the button is released, you will see the LED light blink on the adapter and a message on the TV that indicates it is resetting, wait until it indicates “Ready to connect”.
  3. Once the reset is complete, you will need to reconnect your devices to the adapter.
  4. On Windows devices, you will see a message “Tap to fix connection”, clicking on this will remove the Wireless Display Adapter and then automatically start searching for it again. You will need to select the Wireless Display Adapter to complete pairing.

Note that none of the devices mentioned in the compatibility list runs Windows 10.

The MWDA is also an Intel® Wireless Display (WiDi) certified adapter and works with 2-in-1s and tablet devices with Intel WiDi capability. Nahhh i had enough for one day.

Brushless Motor Dynamometer

$
0
0

To get an idea of the trust by an brushless motor with prop, i used the HobbyKing Turnigy Thrust Stand.

Turnigy Thrust Measuring Stand  Turnigy Thrust Stand measurement is affected by the drag from the leads

This ‘cheap’ €45 rig has some issues i.e. the flying leads of the motor, ESC and servo affect the trust measurement for small size motors e.g. 180 class quads . Beside that, one has to jot everything down (battery voltage, current draw, throttle), put it in spreadsheet to get a idea of the efficiency of the motor and prop combo.

RCbenchmark recently released their brushless motor dynometer. It can measure thrust, torque, speed, voltage, current and resistance. And it can control the speed. Best of all, the Chrome App is open source so one has the freedom to change/add/hack it.

RCbenchmark DynometerRCbenchmark DynamoMeter parts

This piece of kit does not come cheap, US$ 445.00 is a lot do. An coupon discount of US$ 66.75 pulled me in. Note that the shipping cost to the Netherlands was US$ 63.52. Customs bill was €122.83 :-( . Why does the Dutch customs add the shipping cost to the product value?

The kit is well constructed, in particular the pcb.  The press fit screw terminals are a really good solution to handle the wide range of wire diameters and high currents. I wonder where these can be purchased.

RCbenchmark PCB, solid sound screw terminals RCbenchmark PCB, press fit terminals. notice side ones...

Raspberry Pi & Automation 2

$
0
0

Messed up LC_CTYPE = “UTF-8” instead of “en_GB.UTF-8”

man: can't set the locale; make sure $LC_* and $LANG are correct
---------------------------------------------------------------------------------
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directoryperl: warning: Setting locale failed.
---------------------------------------------------------------------------------
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
---------------------------------------------------------------------------------

# Files: /etc/locale.gen /etc/default/locale
# commands: env, locale, sudo locale-gen, sudo update-local

I cannot find the cause of it other then, it happened after installing node-RED, that the LC_CTYPE is set wrong (leave LC_ALL as is). Workaround is

pi@void3:~ $ echo export LC_CTYPE="en_GB.UTF-8" >> .profile

WPA SUPPLICANT flooding the log files

# Files: /var/log/syslog, daemon.log

wpa_supplicant[x]: wlan0: WPA: Group rekeying completed with 00:11:xx:xx:xx:xx [GTK=CCMP]

These messages are there due to the fact that the WIFI basestation, to which the Linux box is connecting to, does not (or is switch off) have PMF (Protected Management Frames) 802.11w. The PMF should have three choices Off, Enabled – Optional, Enabled – Required. Choose Enable – Optional. Note that PMF is mandatory to pass 802.11ac certification. On another note, the logs will still have entries with group rekeying but will appear in the rate set by the key rotation interval e.g. every 3600 seconds.

rsyslogd-2007 messages in /var/log/syslog

rsyslogd-2007: action 'action 17' suspended, next retry is Fri Mar 10 01:55:54 2017 [try http://www.rsyslog.com/e/2007 ]
rsyslogd-2007: action 'action 17' suspended, next retry is Fri Mar 10 02:04:04 2017 [try http://www.rsyslog.com/e/2007 ]

These messages are generated by the following part in /etc/rsyslog.conf.

# The named pipe /dev/xconsole is for the `xconsole' utility.  To use it,
# you must invoke `xconsole' with the `-file' option:
#
#    $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
#      busy site..
#
daemon.*;mail.*;\
       news.err;\
       *.=debug;*.=info;\
       *.=notice;*.=warn    |/dev/xconsole
[EOF]

To get rid off the messages, comment out the above section. Or  delete the whole section with

sudo sed -i '/# The named pipe \/dev\/xconsole/,$d' /etc/rsyslog.conf

Raspbian Jessie with Pixel

The previous post was done with 2017-02-16-raspbian-jessie-lite.img on March 5 2017. Repeating the installation on an RPi3 with 2017-03-02-raspbian-jessie.img worksout ok. It is not nessecary to disable the UART in the initial setup.

######  initial setup  #####
sudo rasp-config
- change password, set hostname, enable ssh
- enable SPI, I2C, remote GPIO
reboot

HDMI display

So annoying when display blanks and goes to sleep. When the RPi is booted without the monitor, it will not detect an display. Hence, the hdmi_force_hotplug. Edit /boot/config.txt

# See http://rpf.io/configtxtreadme
# force HDMI
hdmi_force_hotplug=1
# force DMT Display Monitor Timing
hdmi_group=2
# force 1920x1200 on HP LP2475w
hdmi_mode=68
# only power down monitor when lockscreen is active
hdmi_blanking=1

Remote Desktop

When the RPi is not used with as ‘desktop’ and only accessed by SSH and remote desktop, there is no need to start X and the VNC server at boot time.

  • sudo raspi-config
    • select system -> boot to cli
    • disable in interfaces -> VNC
  • sudo apt-get remove vnc*
  • sudo apt-get vnc4server xrdp

On windows use the remote desktop app or install the Microsoft Remote Desktop app from the Apple app store (free), to connect to RPi.

Raspberry Pi & CAN-bus

$
0
0

Based on RPi3 installation with 2017-02-16-raspbian-jessie-lite.img on March 5 2017. Later releases e.g. Raspbian Jessie with Pixel (2017-03-02-raspbian-jessie.img) follow the same installation.

Initial setup, use raspi-config to enable SPI, I2C and remote GPIO.
Update the system, reboot and install can-utils and SocketCAN.

pi@void3:~ $ sudo apt-get -y update && sudo apt-get -y upgrade ; sudo apt-get autoremove
pi@void3:~ $ sudo apt-get -y install can-utils libsocketcan2 libsocketcan-dev

Reference:

  • SocketCAN (github)
  • Linux kernel documentation on CAN networking
  • Raspberry Pi overlays are described in /boot/overlays/README
  • Device Trees, overlays and parameters is in great detail explained here

CAN-bus adapters

Four CAN-bus adapters to install, the LAWICEL USBCAN adapter, the SK Pang PiCAN2 CAN-Bus board, the SK Pang PiCAN2 Duo CAN-bus board and the Sys Tec USB-CAN GW-002-100 adapter.

LAWICEL CANUSBLAWICEL USBCAN adapter

The USBCAN uses an Philips SJA1000 CAN Controller and an Philips 82C251 CAN Tranceiver. On the USB side is an FTDI FT245RL USB controller. The CAN data is formatted as ASCII instead of binary, known as slcan.

Attach the USBCAN to one of the USB ports of the RPi3.

To follow the entries in /var/log/syslog do tail -f /var/log/syslog in another terminal/shell. One could also follow the entries from the kernel ring buffer with dmesg -w

kernel: [40383.223047] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
kernel: [40383.347790] usb 1-1.2: New USB device found, idVendor=0403, idProduct=6001
kernel: [40383.347812] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: [40383.347825] usb 1-1.2: Product: CANUSB
kernel: [40383.347837] usb 1-1.2: Manufacturer: LAWICEL
kernel: [40383.347849] usb 1-1.2: SerialNumber: LWxxxxxx
kernel: [40384.404993] usbcore: registered new interface driver usbserial
kernel: [40384.405090] usbcore: registered new interface driver usbserial_generic
kernel: [40384.405177] usbserial: USB Serial support registered for generic
kernel: [40384.410363] usbcore: registered new interface driver ftdi_sio
kernel: [40384.410472] usbserial: USB Serial support registered for FTDI USB Serial Device
kernel: [40384.410765] ftdi_sio 1-1.2:1.0: FTDI USB Serial Device converter detected
kernel: [40384.410975] usb 1-1.2: Detected FT232RL
kernel: [40384.411932] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0

Check if the OS sees the CANUSB and which modules are currently loaded.

pi@void3:~ $ lsusb
Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

pi@void3:~ $ lsmod
Module                  Size  Used by
ftdi_sio               31321  0
usbserial              22115  1 ftdi_sio
— snip —

Load the required modules and list them.

pi@void3:~ $  sudo modprobe can
pi@void3:~ $  sudo modprobe vcan
pi@void3:~ $  sudo modprobe can_raw
pi@void3:~ $  sudo modprobe slcan
pi@void3:~ $  lsmod
Module                  Size  Used by
vcan                    2065  0
slcan                   5590  0
can_raw                 6852  0
can                    27196  1 can_raw
ftdi_sio               31321  0
usbserial              22115  1 ftdi_sio
-- snip --
kernel: [41207.801732] can: controller area network core (rev 20120528 abi 9)
kernel: [41207.801834] NET: Registered protocol family 29
kernel: [41237.235336] can: raw protocol (rev 20120528)
kernel: [41252.916822] slcan: serial line CAN interface driver
kernel: [41252.916854] slcan: 10 dynamic interface channels.

Now unplug and re-insert the CANUSB, the OS act accordingly.

kernel: [41633.713932] usb 1-1.2: USB disconnect, device number 4
kernel: [41633.714493] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
kernel: [41633.714556] ftdi_sio 1-1.2:1.0: device disconnected
kernel: [41713.065798] usb 1-1.3: new full-speed USB device number 5 using dwc_otg
kernel: [41713.190585] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001
kernel: [41713.190607] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: [41713.190620] usb 1-1.3: Product: CANUSB
kernel: [41713.190632] usb 1-1.3: Manufacturer: LAWICEL
kernel: [41713.190644] usb 1-1.3: SerialNumber: LWxxxxxx
kernel: [41713.194922] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
kernel: [41713.195122] usb 1-1.3: Detected FT232RL
kernel: [41713.201043] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0

Append the modules can, vcan,can_raw,slcan to /etc/modules so loading is done automatically.

sudo su
echo $'can\nvcan\ncan_raw\nslcan' >> /etc/modules

Bind the ttyUSB0 device to slcan device, name the interface slcan0, set CAN-bus speed 250 Kb/s (see canusb manual). Why it is initialized with -o=open -c=close is beyond me…

sudo slcand -o -c -f -s5 /dev/ttyUSB0
slcand[5703]: starting on TTY device /dev/ttyUSB0
slcand[5704]: attached TTY /dev/ttyUSB0 to netdevice slcan0

The slcan0 netdevice should be visible but in the state DOWN. So bring it to UP state.

pi@void3:~ $ ip addr | grep can
4: slcan0: <NOARP> mtu 16 qdisc noop state DOWN group default qlen 10
    link/can

pi@void3:~ $ sudo ifconfig slcan0 up

pi@void3:~ $ ip addr | grep can
4: slcan0: <NOARP,UP,LOWER_UP> mtu 16 qdisc pfifo_fast state UNKNOWN group default qlen 10
    link/can

For testing, i connected the USBCAN to an J1939 ECU and dump some CAN-bus traffic.
Note that the red led is lit and the green led blinks on traffic on the CAN-bus.

pi@void3:~ $ candump slcan0
  slcan0  18FEFC00   [8]  00 00 00 E8 00 00 00 00
  slcan0  0CFF8100   [8]  A0 00 01 00 00 00 FF FF
  slcan0  18FECA00   [8]  00 FF 00 00 00 00 FF FF
  slcan0  0CF00400   [8]  00 CD 7D 00 00 00 00 00
  slcan0  0CF00300   [8]  00 7D 00 00 00 00 00 00
  slcan0  18FEDF00   [8]  CD 00 00 00 00 00 00 00
  slcan0  18FEEF00   [8]  19 00 00 00 00 7D 00 00
  slcan0  18FEE500   [8]  00 00 00 00 00 00 00 00
  slcan0  18FEEE00   [8]  69 46 E0 25 E0 25 5A 00
  slcan0  18FEF200   [8]  00 00 00 00 00 00 7D 00
  slcan0  18FEF600   [8]  00 32 2A 00 00 A0 24 00
  slcan0  18FEE400   [8]  00 00 00 00 00 00 00 00
  slcan0  18FEF700   [8]  00 00 00 00 E0 01 E0 01
  slcan0  0CFF4700   [8]  00 00 00 00 00 00 00 00
  slcan0  18FEFF00   [8]  01 00 00 00 00 00 00 00
  slcan0  0CF00400   [8]  00 CD 7D 00 00 00 00 00
  slcan0  0CF00400   [8]  00 CD 7D 00 00 00 00 00
  slcan0  0CF00300   [8]  00 7D 00 00 00 00 00 00
  slcan0  0CFF4700   [8]  00 00 00 00 00 00 00 00

pi@void3:~ $ netstat -i -l
Kernel Interface table
Iface       MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0       1500 0         0      0      0 0             0      0      0      0 BMU
lo        65536 0         0      0      0 0             0      0      0      0 LRU
slcan0       16 0    101339      0      0 0             0      0      0      0 ORU
wlan0      1500 0    108172      0  25282 0         75044      0      0      0 BMRU

The Old Way i.e. with udev

  • Create three files and fill them with the content below
    • sudo vi /etc/udev/rules.d/90-slcan.rules
    • sudo vi /usr/local/bin/slcan_add.sh
    • sudo vi /usr/local/bin/slcan_remove.sh
  • Make the shell files executable
    • sudo chmod +x /usr/local/bin/slcan_add.sh
    • sudo chmod +x /usr/local/bin/slcan_remove.sh
  • reboot (sudo reboot) to apply the new udev rules
  • test the netdevice slcan0 with candump slcan0
# file: /etc/udev/rules.d/90-slcan.rules
# Lawicel CANUSB module
# For similar devices, change "CANUSB" to "6001".

ACTION=="add", ENV{ID_MODEL}=="CANUSB", ENV{SUBSYSTEM}=="tty", RUN+="/usr/bin/logger [udev] Lawicel CANUSB detected", RUN+="/usr/local/bin/slcan_add.sh $kernel"
ACTION=="remove", ENV{ID_MODEL}=="CANUSB", ENV{SUBSYSTEM}=="usb", RUN+="/usr/bin/logger [udev] Lawicel CANUSB removed", RUN+="/usr/local/bin/slcan_remove.sh"
#!/bin/sh
# file: /usr/local/bin/slcan_add.sh
# Bind the USBCAN device, -s5 (250Kb/s)

slcand -o -c -f -s5 /dev/$1
sleep 1
ifconfig slcan0 up
#!/bin/sh
# file: /usr/local/bin/slcan_remove.sh
# Remove the USBCAN device

pkill slcand
Use udevadm monitor --property to monitor for hints if it does not work.

Commands related to slcan

  • slattach :: attach a network interface to a serial line
  • slcan_attach
  • slcand
  • slcanpty
Usage: slattach [-ehlLmnqv] [-k keepalive] [-o outfill] [-c cmd] [-s speed] [-p protocol] tty
---------------------------------------------------------------------------------
Usage: slcan_attach [options] tty

Options: -o         (send open command 'O\r')
         -c         (send close command 'C\r')
         -f         (read status flags with 'F\r' to reset error states)
         -s <speed> (set CAN speed 0..8)
         -b <btr>   (set bit time register value)
         -d         (only detach line discipline)
         -w         (attach - wait for keypess - detach)
         -n <name>  (assign created netdevice name)

Examples:
         slcan_attach -w -o -f -s6 -c /dev/ttyS1
         slcan_attach /dev/ttyS1
         slcan_attach -d /dev/ttyS1
         slcan_attach -w -n can15 /dev/ttyS1
---------------------------------------------------------------------------------
Usage: slcand [options] <tty> [canif-name]

Options: -o         (send open command 'O\r')
         -c         (send close command 'C\r')
         -f         (read status flags with 'F\r' to reset error states)
         -s <speed> (set CAN speed 0..8)
         -S <speed> (set UART speed in baud)
         -t <type>  (set UART flow control type 'hw' or 'sw')
         -b <btr>   (set bit time register value)
         -F         (stay in foreground; no daemonize)
         -h         (show this help page)

Examples:
         slcand -o -c -f -s6 ttyslcan0
         slcand -o -c -f -s6 ttyslcan0 can0
---------------------------------------------------------------------------------
slcanpty creates a pty for applications using the slcan ASCII protocol and
converts the ASCII data to a CAN network interface (and vice versa)

Usage: slcanpty <pty> <can interface>
e.g. 'slcanpty /dev/ptyc0 can0' creates /dev/ttyc0 for the slcan application
e.g. for pseudo-terminal 'slcanpty /dev/ptmx can0' creates /dev/pts/N

SK Pang electronics PiCAN2 CAN-Bus board for Raspberry Pi 2/3PiCAN2

PiCAN2 board uses uses the Microchip MCP2515 CAN controller with MCP2551 CAN transceiver. Connection are made via DB9 or 3 way screw terminal. Interrupt RX on GPIO25. Manual Schematic

File: /boot/overlay/README

Name:   mcp2515-can0
Info:   Configures the MCP2515 CAN controller on spi0.0
Load:   dtoverlay=mcp2515-can0,<param>=<val>
Params: oscillator              Clock frequency for the CAN controller (Hz)
        spimaxfrequency         Maximum SPI frequence (Hz)
        interrupt               GPIO for interrupt signal

Add to /boot/config.txt

# Enable MCP2515 on SPI
# dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay

After an reboot, lsmod should list two new entries i.e. mcp251x, can_dev.

/etc/modprobe.d/raspi-blacklist.conf is empty, so no worries here.

$ sudo depmod -a
$ sudo ip link set can0 up type can bitrate 250000 listen-only on
  kernel: [epoch] CAN device driver interface
  kernel: [epoch] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
  kernel: [epoch] can: controller area network core (rev 20120528 abi 9)
  kernel: [epocj] NET: Registered protocol family 29
  kernel: [epoch] can: raw protocol (rev 20120528)
$ candump -cae can0,0:0,#FFFFFFF

SK Pang electronics PiCAN2 Duo CAN-Bus board for Raspberry Pi 2/3

PiCAN2 DuoPiCAN2 Duo board uses uses the Microchip MCP2515 CAN controller with MCP2551 CAN transceiver. Connection are made 4 way screw terminal. Interrupt RX on GPIO25 and GPIO24. Manual Schematic

Installation is the same as the PiCAN2 with the additional line in /boot/config.txt

# Enable MCP2515 on SPI
# dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=24
dtoverlay=spi-bcm2835-overlay

SYS TEC USB-CAN GW-002-100SYS TEC electronic GW-002-100

This is an isolated USB CAN adapter from 2008 and is still in use on Windows 10 (unsupported). Linux does not recognize the adapter.

kernel: [48959.081101] usb 1-1.5: new full-speed USB device number 6 using dwc_otg
kernel: [48959.182630] usb 1-1.5: New USB device found, idVendor=0878, idProduct=1102
kernel: [48959.182652] usb 1-1.5: New USB device strings: Mfr=0, Product=0, SerialNumber=0

The manual and systec can code for the one with spare time…

SocketCAN tools

The virtual CAN-bus interface is often used for replaying stored CAN-bus traffic.

$ sudo modprobe vcan
$ sudo ip link add vcan0 type vcan
$ sudo ip link set vcan0 up

candump

candump -cae any,0:0,#FFFFFFFF shows everything, including errors, on the CAN-bus.

candump -cae can0,3CD:7FF shows only data of specific ID’s i.e. 3CD…7FF

candump -l can0,0:0,#FFFFFFFF dumps all data, excluding errors, to a file

Enabling Logfile ‘candump-2017-03-11_160601.log

(1489244835.086277) can0 742#05
(1489244835.091032) can0 0A484082#0000000000000000
(1489244835.096506) can0 732#05
(1489244835.101695) can0 0C000003#01E02E7DFFFFFFFF
(1489244835.106290) can0 722#05
(1489244835.107590) can0 721#05
(1489244835.115500) can0 0CF00400#00CD7D0000000000
(1489244835.119888) can0 0C000003#01E02E7DFFFFFFFF
(1489244835.138204) can0 0C000003#01E02E7DFFFFFFFF
(1489244835.139441) can0 0CFD9303#FFFFFFC3FFFFFFFF

canplayer vcan0=can0 -v -l 10 -I candump-2017-03-11_160601.log replays data to can0

cansniffer can0 shows CAN-bus data grouped by the messages identifiers (ID)

Usage: candump [options] <CAN interface>+
  (use CTRL-C to terminate candump)

Options: -t <type>   (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date)
         -c          (increment color mode level)
         -i          (binary output - may exceed 80 chars/line)
         -a          (enable additional ASCII output)
         -S          (swap byte order in printed CAN data[] - marked with '`' )
         -s <level>  (silent mode - 0: off (default) 1: animation 2: silent)
         -b <can>    (bridge mode - send received frames to <can>)
         -B <can>    (bridge mode - like '-b' with disabled loopback)
         -u <usecs>  (delay bridge forwarding by <usecs> microseconds)
         -l          (log CAN-frames into file. Sets '-s 2' by default)
         -L          (use log file format on stdout)
         -n <count>  (terminate after receiption of <count> CAN frames)
         -r <size>   (set socket receive buffer to <size>)
         -d          (monitor dropped CAN frames)
         -e          (dump CAN error frames in human-readable format)
         -x          (print extra message infos, rx/tx brs esi)
         -T <msecs>  (terminate after <msecs> without any reception)

Up to 16 CAN interfaces with optional filter sets can be specified
on the commandline in the form: <ifname>[,filter]*

Comma separated filters can be specified for each given CAN interface:
 <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)
 <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)
 #<error_mask>       (set error frame filter, see include/linux/can/error.h)

CAN IDs, masks and data content are given and expected in hexadecimal values.
When can_id and can_mask are both 8 digits, they are assumed to be 29 bit EFF.
Without any given filter all data frames are received ('0:0' default filter).

Use interface name 'any' to receive from all CAN interfaces.

Examples:
candump -c -c -ta can0,123:7FF,400:700,#000000FF can2,400~7F0 can3 can8
candump -l any,0~0,#FFFFFFFF    (log only error frames but no(!) data frames)
candump -l any,0:0,#FFFFFFFF    (log error frames and also all data frames)
candump vcan2,92345678:DFFFFFFF (match only for extended CAN ID 12345678)
candump vcan2,123:7FF (matches CAN ID 123 - including EFF and RTR frames)
candump vcan2,123:C00007FF (matches CAN ID 123 - only SFF and non-RTR frames)
Usage: cansniffer [can-interface]
Options: -m <mask>  (initial FILTER default 0x00000000)
         -v <value> (initial FILTER default 0x00000000)
         -q         (quiet - all IDs deactivated)
         -r <name>  (read sniffset.name from file)
         -b         (start with binary mode)
         -B         (start with binary mode with gap - exceeds 80 chars!)
         -c         (color changes)
         -f         (filter on CAN-ID only)
         -t <time>  (timeout for ID display [x100ms] default: 50, 0 = OFF)
         -h <time>  (hold marker on changes [x100ms] default: 10)
         -l <time>  (loop time (display) [x100ms] default: 2)
Use interface name 'any' to receive from all can-interfaces

commands that can be entered at runtime:

q<ENTER>       - quit
b<ENTER>       - toggle binary / HEX-ASCII output
B<ENTER>       - toggle binary with gap / HEX-ASCII output (exceeds 80 chars!)
c<ENTER>       - toggle color mode
#<ENTER>       - notch currently marked/changed bits (can be used repeatedly)
*<ENTER>       - clear notched marked
rMYNAME<ENTER> - read settings file (filter/notch)
wMYNAME<ENTER> - write settings file (filter/notch)
+FILTER<ENTER> - add CAN-IDs to sniff
-FILTER<ENTER> - remove CAN-IDs to sniff

FILTER can be a single CAN-ID or a CAN-ID/Bitmask:
+1F5<ENTER>    - add CAN-ID 0x1F5
-42E<ENTER>    - remove CAN-ID 0x42E
-42E7FF<ENTER> - remove CAN-ID 0x42E (using Bitmask)
-500700<ENTER> - remove CAN-IDs 0x500 - 0x5FF
+400600<ENTER> - add CAN-IDs 0x400 - 0x5FF
+000000<ENTER> - add all CAN-IDs
-000000<ENTER> - remove all CAN-IDs

if (id & filter) == (sniff-id & filter) the action (+/-) is performed,
which is quite easy when the filter is 000
Usage: canplayer <options> [interface assignment]*

Options:              -I <infile>  (default stdin)
                      -l <num>     (process input file <num> times)
                                   (Use 'i' for infinite loop - default: 1)
                      -t           (ignore timestamps: send frames immediately)
                      -g <ms>      (gap in milli seconds - default: 1 ms)
                      -s <s>      (skip gaps in timestamps > 's' seconds)
                      -x           (disable local loopback of sent CAN frames)
                      -v           (verbose: print sent CAN frames)

Interface assignment:  0..n assignments like <write-if>=<log-if>
e.g. vcan2=can0 ( send frames received from can0 on vcan2 )
extra hook: stdout=can0 ( print logfile line marked with can0 on stdout )
No assignments => send frames to the interface(s) they had been received from.

Lines in the logfile not beginning with '(' (start of timestamp) are ignored.
can-utils :
asc2log, bcmserver, can-calc-bit-timing, canbusload, candump, canfdtest, cangen,
cangw, canlogserver, canplayer, cansend, cansniffer, isotpdump, isotpperf,
isotprecv, isotpsend, isotpserver, isotpsniffer, isotptun, log2asc, log2long,
slcan_attach, slcand, slcanpty
Viewing all 48 articles
Browse latest View live